From: Alistair Francis <alistair23@gmail.com>
To: "Andreas K. Huettel" <dilfridge@gentoo.org>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"open list:RISC-V" <qemu-riscv@nongnu.org>,
LIU Zhiwei <baxiantai@gmail.com>,
Alistair Francis <alistair.francis@wdc.com>
Subject: Re: qemu-riscv32 usermode still broken?
Date: Mon, 18 Sep 2023 11:16:15 +1000 [thread overview]
Message-ID: <CAKmqyKP2cSh-U8s9hJfLH1GSsEHXQaL0xjd=s19WCzLdeyOPTA@mail.gmail.com> (raw)
In-Reply-To: <6353228.kQq0lBPeGt@pinacolada>
On Sun, Sep 17, 2023 at 8:38 AM Andreas K. Huettel <dilfridge@gentoo.org> wrote:
>
> Am Donnerstag, 14. September 2023, 03:22:49 CEST schrieb Andreas K. Huettel:
> > > > https://lists.gnu.org/archive/html/bug-bash/2023-09/msg00119.html
> > > > ^ Here I'm trying to find out more.
> > > >
> > > > Bash tests apparently indicate that argv[0] is overwritten, and that
> > > > reading through a pipe or from /dev/tty fails or loses data.
> > > >
> > > > Apart from the bash testsuite failing, symptoms are as follows:
> > > >
> > > > * Something seems wrong in the signal handling (?):
> > >
> > > If it is wrong for signal handling and for 32-bit, I guess it may be
> > > fixed by this patch
> > >
> > > https://www.mail-archive.com/qemu-devel@nongnu.org/msg981238.html
> > >
> > > And this patch has been merged into master branch yesterday.
> > >
> > > May be you can have a try based on the master branch.
> >
> > I added the patch to 8.0.3 (easier for the moment), and this did
> > unfortunately *not* lead to any improvements.
>
> Also with the patch on top of 8.1.0 no improvement or change.
>
> > However, in the meantime on the GNU Make tracker Alejandro Colomar
> > pointed me to another detail based on my oddities [1]:
> >
> > > I think [make] it's failing here:
> > >
> > > <https://git.savannah.gnu.org/cgit/make.git/tree/src/job.c#n757>
> > >
> > > But it's failing with ENOENT, which is not one of the documented
> > > errors for wait(2):
> >
> > So maybe another point to look at would be the origin of the return
> > values of wait, and whether that's wired correctly for rv32...
> >
> > [1] https://savannah.gnu.org/bugs/?64664
>
> In the meantime I tried to nail down a reproducible hang in bash on this
> frankensystem with qemu's gdb interface. This also pointed towards
> child handling and wait [2].
RV32 only has the time64 wait syscall, so it's possible there is a bug
there which then wouldn't appear on other arches.
You can see the glibc implementation of wait here [1] to give you an
idea of how complex it ends up being.
It would be great to get a strace of the failure to narrow down what
it is. From there it should be not too hard to find and fix.
1: https://github.com/bminor/glibc/blob/bb5bbc20702981c287aa3e44640e7d2f2b9a28cf/sysdeps/unix/sysv/linux/wait4.c#L26
Alistair
>
> [2] https://lists.gnu.org/archive/html/bug-bash/2023-09/msg00128.html
>
> Some time ago we already debugged that corner, and Alistair Francis
> came up with a fix that improved the riscv32 situation back then [3].
> Maybe that fix was somehow incomplete? Just speculating...
>
> [3] https://bugs.launchpad.net/qemu/+bug/1906193
>
>
> --
> Andreas K. Hüttel
> dilfridge@gentoo.org
> Gentoo Linux developer
> (council, toolchain, base-system, perl, libreoffice)
next prev parent reply other threads:[~2023-09-18 1:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 22:31 qemu-riscv32 usermode still broken? Andreas K. Huettel
2023-09-13 1:41 ` LIU Zhiwei
2023-09-13 8:06 ` Michael Tokarev
2023-09-13 10:33 ` Andreas K. Huettel
2023-09-14 1:22 ` Andreas K. Huettel
2023-09-16 22:37 ` Andreas K. Huettel
2023-09-18 1:16 ` Alistair Francis [this message]
2023-09-19 20:39 ` Andreas K. Huettel
2024-06-11 4:43 ` Alistair Francis
2024-06-11 8:57 ` Andreas K. Huettel
2024-06-12 1:26 ` Alistair Francis
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='CAKmqyKP2cSh-U8s9hJfLH1GSsEHXQaL0xjd=s19WCzLdeyOPTA@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=baxiantai@gmail.com \
--cc=dilfridge@gentoo.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
/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.
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).