[PATCH weston 1/2] weston: remove SEGV and ABRT handlers
Pekka Paalanen
ppaalanen at gmail.com
Wed Feb 7 13:12:48 UTC 2018
On Wed, 7 Feb 2018 12:03:56 +0000
Simon McVittie <smcv at collabora.com> wrote:
> On Wed, 07 Feb 2018 at 12:51:14 +0200, Pekka Paalanen wrote:
> > Catching an ABRT is kind of ok, catching a SEGV is russian roulette. We
> > have been quite lucky with it, but I've started hitting crashes inside
> > malloc() which causes a deadlock when our SEGV handler needs to malloc()
> > as well (weston_log_timestamp()).
>
> This isn't unique to SIGSEGV: inside any POSIX async-signal handler,
> you can only (portably, safely) use functions that are documented to be
> async-signal-safe, which basically means syscall wrappers. See
> signal-safety(7) on a Linux system.
>
> (If anything in the Wayland/Weston stack reloads configuration on SIGHUP,
> it should probably use the standard "pipe-to-self trick", like e.g.
> dbus-daemon does - write a byte to a pipe using async-signal-safe write(),
> poll that pipe in the main loop, and reload configuration from the main
> loop whenever one or more bytes can be read from the pipe. That's a
> safe pattern.)
Weston handles all other signals via signalfd(), these were the only ones
that used the signal()/sigaction() kind of API.
There is no way to reload config at runtime. :-P
> > Therefore, this code does more harm than it is useful, so remove it. We
> > also drop an optional dependency to libunwind.
>
> I am not a Wayland reviewer, but I think this is an excellent idea. The
> best signal handlers are SIG_DFL and SIG_IGN :-)
Heh, cool.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180207/a26b5030/attachment.sig>
More information about the wayland-devel
mailing list