qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sean Bruno <sbruno@freebsd.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Looking for a linux-user mode test
Date: Wed, 28 Dec 2016 10:12:50 -0700	[thread overview]
Message-ID: <db8a59e9-f4b3-1cb5-c1ed-82158b61b008@freebsd.org> (raw)
In-Reply-To: <CAFEAcA8ZuCxeFz83moePn80GFUbh0wGu4+T2wHdTSN=LE6-1CQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3104 bytes --]



On 12/28/16 10:05, Peter Maydell wrote:
> On 28 December 2016 at 15:06, Sean Bruno <sbruno@freebsd.org> wrote:
>> After some recent-ish changes to how user mode executes things/stuff,
>> I'm running into issues with the out of tree bsd-user mode code that
>> FreeBSD has been maintaining.  It looks like the host_signal_handler()
>> is never executed or registered correctly in our code.  I'm curious if
>> the linux-user code can handle this bit of configure script from m4.
>>
>> https://people.freebsd.org/~sbruno/stack.c
> 
> Hmm. That code does:
>  * set up a SIGSEGV signal handler to run on its own stack
>  * go into an infinite recursion, expecting to run out of
>    stack and trigger a SEGV
> which is a bit of an obscure corner case of signal handling.
> 
> We recently fixed a lot of signal handler related bugs in linux-user
> by doing a significant overhaul of that code. If bsd-user is still
> using the old broken approach it's probably still got lots of bugs
> in it. Alternatively, it's possible we changed some of the core
> code in that process and broke bsd-user by mistake.
> 
> Ideally all of that rework (including the support for properly
> interrupting syscalls without races) should be ported over to
> bsd-user at some point.

If you have a moment to point me at the merge commit that pulled in the
majority of this overhaul, I'll take a moment to review it for
application to bsd-user.

> 
>> If someone has the time/inclination, can this code be compiled for ARMv6
>> and executed in a linux chroot with the -strace argument applied?  I see
>> the following, which after much debugging seems to indicate that the
>> host_signal_handler() code is never executed as this code is requesting
>> that SIGSEGV be masked to its own handler.
> 
> Built for ARMv7 since I don't have an ARMv6 cross compiler
> or system, but it works ok for linux (also, built with -static
> rather than run in a chroot, for convenience):
> 
> e104462:xenial:qemu$ ./build/arm-linux/arm-linux-user/qemu-arm -strace
> ~/linaro/qemu-misc-tests/stack
> 29798 uname(0xf6fff1f0) = 0
> 29798 brk(NULL) = 0x0007f000
> 29798 brk(0x0007fd00) = 0x0007fd00
> 29798 readlink("/proc/self/exe",0xf6ffe328,4096) = 43
> 29798 brk(0x000a0d00) = 0x000a0d00
> 29798 brk(0x000a1000) = 0x000a1000
> 29798 access("/etc/ld.so.nohwcap",F_OK) = -1 errno=2 (No such file or directory)
> 29798 sigaltstack(0xf6fff2e0,(nil)) = 0
> 29798 rt_sigaction(SIGSEGV,0xf6fff1b0,NULL) = 0
> --- SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr = 0xf67ffffc} ---
> 29798 exit_group(0)
> 
> (the enhancement to linux-user's strace to print the line on signal
> delivery is also a pretty new change.)
> 

Thanks.  This is what I expect to see.

>> https://people.freebsd.org/~sbruno/qemu-bsd-user-arm.txt
>>
>> Prior to 7e6c57e2957c7d868f74bd0d53b5e861b495e1c7 this DTRT for our
>> ARMv6 targets.
> 
> This commit hash doesn't seem to be in QEMU master.
> 

*sigh* ... that was the merge commit to the bsd-user branch I maintain.
Ignore it.

> thanks
> -- PMM
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

  reply	other threads:[~2016-12-28 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 15:06 [Qemu-devel] Looking for a linux-user mode test Sean Bruno
2016-12-28 17:05 ` Peter Maydell
2016-12-28 17:12   ` Sean Bruno [this message]
2016-12-28 18:13     ` Peter Maydell

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=db8a59e9-f4b3-1cb5-c1ed-82158b61b008@freebsd.org \
    --to=sbruno@freebsd.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).