[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/4] linux-user: fix use of SIGRTMIN
From: |
Josh Kunz |
Subject: |
Re: [PATCH 0/4] linux-user: fix use of SIGRTMIN |
Date: |
Mon, 3 Feb 2020 16:03:09 -0800 |
On Sat, Feb 1, 2020 at 4:27 AM Laurent Vivier <address@hidden> wrote:
> This has been tested with Go (golang 1.10.1 linux/arm64, bionic) on x86_64
> fedora 31. We can avoid the failure in this case allowing the unsupported
> signals when we don't provide the "act" parameters to sigaction, only the
> "oldact" one. I have also run the LTP suite with several target and debian
> based distros.
This breaks with go1.13+ (I also verified at hash 753d56d364)[1]. I
tested using an aarch64 guest on an x86 system, but this should
manifest on any architecture when the guest/host have the same number
of signals (and glibc reserves some host signals). From the traceback,
you can see it dies in `initsig` which is called at startup. Any Go
program should fail.
Since go does not use a libc, it assumes that all signals from
[1.._NSIG) are available[2], and will panic if it cannot do an
rt_sigaction for all of them. Go already has some special handling for
QEMU where it silently discards failing rt_sigaction calls to signals
32, 33, and 64 [3]. Since this patch reserves an extra signal for
__SIGRTMIN+1 as well, it blocks out guest signal 63 and Go fails to
initialize.
While I personally support this patch series (current handling of
guest glibc signals is broken), it *will* break Go binaries. I don't
know of a way to avoid this while supporting guest __SIGRTMIN+1,
without either doing true signal multiplexing, or patching Go.
[1] https://gist.github.com/joshkunz/b6c80724072cc1dce79a6253d40b016f
[2]
https://github.com/golang/go/blob/67f0f83216930e053441500e2b28c3fa2b667581/src/runtime/signal_unix.go#L123
[3] https://github.com/golang/go/blob/master/src/runtime/os_linux.go#L466-L473
>
> Laurent Vivier (4):
> linux-user: add missing TARGET_SIGRTMIN for hppa
> linux-user: cleanup signal.c
> linux-user: fix TARGET_NSIG and _NSIG uses
> linux-user: fix use of SIGRTMIN
>
> linux-user/hppa/target_signal.h | 1 +
> linux-user/signal.c | 110 +++++++++++++++++++++++---------
> linux-user/trace-events | 3 +
> 3 files changed, 85 insertions(+), 29 deletions(-)
>
> --
> 2.24.1
>
- [PATCH 1/4] linux-user: add missing TARGET_SIGRTMIN for hppa, (continued)
- [PATCH 1/4] linux-user: add missing TARGET_SIGRTMIN for hppa, Laurent Vivier, 2020/02/01
- [PATCH 3/4] linux-user: fix TARGET_NSIG and _NSIG uses, Laurent Vivier, 2020/02/01
- [PATCH 4/4] linux-user: fix use of SIGRTMIN, Laurent Vivier, 2020/02/01
- [PATCH 2/4] linux-user: cleanup signal.c, Laurent Vivier, 2020/02/01
- RE: [PATCH 0/4] linux-user: fix use of SIGRTMIN, Taylor Simpson, 2020/02/03
- Re: [PATCH 0/4] linux-user: fix use of SIGRTMIN,
Josh Kunz <=