mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Waldemar Brodkorb <wbx@openadk.org>
To: musl@lists.openwall.com
Subject: Re: [musl] loongarch64 atomics not working?
Date: Tue, 12 Mar 2024 17:18:13 +0100	[thread overview]
Message-ID: <ZfCARQ4Zb1L3pfRC@waldemar-brodkorb.de> (raw)
In-Reply-To: <4f5abddd-09f9-f05f-6cc6-719fc365b449@loongson.cn>

Hi,
lixing wrote,

> 
> 在 2024/3/12 上午10:06, Hongliang Wang 写道:
> > 
> > 
> > 在 2024/3/12 上午8:51, Rich Felker 写道:
> > > There's been a report of mksh hanging on loongarch64, at least under
> > > qemu, apparently hanging in a_cas_p:
> > > 
> > > (gdb) run
> > > Starting program: /mksh
> > > ^C
> > > Program received signal SIGINT, Interrupt.
> > > a_cas_p (p=0x120054288 <vdso_func>, t=0x12003b970 <cgt_init>,
> > > s=0x7fffffffc34c)
> > >      at ./src/internal/atomic.h:94
> > > warning: 94     ./src/internal/atomic.h: No such file or directory
> > > (gdb) bt
> > > #0  a_cas_p (p=0x120054288 <vdso_func>, t=0x12003b970 <cgt_init>,
> > >      s=0x7fffffffc34c) at ./src/internal/atomic.h:94
> > > #1  cgt_init (clk=0, ts=0x7ffffffefb60) at src/time/clock_gettime.c:51
> > > #2  0x000000012003ba4c in __clock_gettime (clk=clk@entry=0,
> > >      ts=ts@entry=0x7ffffffefb60) at src/time/clock_gettime.c:67
> > > #3  0x000000012003830c in gettimeofday (tv=tv@entry=0x7ffffffefba0,
> > >      tz=tz@entry=0x0) at src/time/gettimeofday.c:9
> > > #4  0x000000012002f098 in change_winsz () at var.c:1718
> > > #5  0x0000000120000348 in main_init (lp=<synthetic pointer>,
> > >      sp=<synthetic pointer>, argv=0x7ffffffefd18, argc=1) at main.c:369
> > > #6  main (argc=<optimized out>, argv=<optimized out>) at main.c:738
> > > 
> > > This is very basic usage, just the vdso clock_gettime init code trying
> > > to replace a pointer atomically. Is it working on real hardware? I'm
> > > trying to figure out if this is a qemu bug, or if the asm or the asm
> > > argument constraints are wrong in musl's
> > > arch/loongarch64/atomic_arch.h.
> > > 
> > > Rich
> > > 
> > 
> > We will test it on real hardware to confirm if it can work as soon as
> > possible.
> > 
> > Regards,
> > Hongliang Wang
> 
> Hi, Rich
> 
> We've tested static and dynamic build mksh with commit id
> cbb8a0196aab53165a35339fd91ade599d184f both works ok.
> 
> We compiled qemu 8.2.2 with the following configuration:
> 
> ./configure --prefix=/usr --target-list=loongarch64-linux-user
> --disable-werror --static --disable-docs
> 
> then run with qemu-loongarch64 ./mksh without hang.

Can you check with qemu-system-loongarch64? I use gcc 13.2.0,
binutils 2.42 and Linux 6.6.18 with the defconfig provided.
Qemu is also 8.2.2. Can you provide your QEMU_EFI.fd for download?

For me it hangs.

best regards
 Waldemar

  reply	other threads:[~2024-03-12 16:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12  0:51 Rich Felker
2024-03-12  2:06 ` Hongliang Wang
2024-03-12  8:31   ` lixing
2024-03-12 16:18     ` Waldemar Brodkorb [this message]
2024-03-12 16:47       ` Thorsten Glaser
2024-03-12 17:18         ` Waldemar Brodkorb
2024-03-13  1:42           ` lixing
2024-03-13 14:45             ` Waldemar Brodkorb
2024-03-13 14:52               ` Rich Felker
2024-03-14  5:44                 ` Waldemar Brodkorb
2024-03-14  6:45                   ` lixing
2024-03-14 13:44                     ` Leah Neukirchen
2024-03-15  0:58                       ` lixing
2024-03-12  8:48   ` Jingyun Hua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZfCARQ4Zb1L3pfRC@waldemar-brodkorb.de \
    --to=wbx@openadk.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).