[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mes] mes lib: signal() function; sigaction() function

From: Danny Milosavljevic
Subject: [bug-mes] mes lib: signal() function; sigaction() function
Date: Thu, 14 Mar 2019 01:48:30 +0100

Hi Janneke,

I've fixed signal handling in mes on ARM mostly (it still crashes AFTER the
signal handler has been called--but at least it calls it now for the first

I'm pretty sure that sa_mask (and sigset_t itself) has to be large enough
for 64 bits, also on i386 and on x86-64.

There are three possible syscalls in Linux in order to set up signal handlers,

* SYS_signal
* SYS_sigaction
* SYS_rt_sigaction

The first and oldest one is a remnant of a time long past where the MIT
school of design used non-restartable handlers because they were easier
to implement--and I suggest that we do not support it.

glibc doesn't support it either.  It always registers restartable handlers
on signal().

The second one is better and has BSD signal semantics (which are non-insane).

The third one is almost entirely like the second one but they found out that
they need more than 32 signals and thus extended sigset_t.

So I suggest that you remove all mention of SYS_signal and SIG_sigaction.

We already implement signal() in terms of SYS_rt_sigaction, but there's a
strange fallback to SYS_signal which only serves to hide problems in the
former.  I suggest you remove the fallback.

Also, there's an empty stub for sigaction() which we can just implement
in its entirety, copying pretty much the body of signal() from
lib/linux/signal.c .

(The only difference between sigaction() and SYS_rt_sigaction() is that the
latter has an extra argument "sizeof(sigset_t)" at the end but the former

What do you think?

Attachment: pgpAgLM1eXvEB.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]