Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 29 Jun 2019 07:54:05 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Conditional signal safety?

Hi all,

at work yesterday I had to build an exception handler (a signal handler
for SIGSEGV, SIGBUS, SIGILL, and SIGFPE). For my purposes, it was really
convenient to just use dladdr() to find out at least what module and
function PC and LR were pointing to when the exception happened, so I
used that function.

Now, dladdr() is not on the list of signal safe functions, but then,
dladdr() is a GNU extension. I wondered if it is signal safe and noticed
that at least musl's implementation is, provided that dlopen() was not
the function that was pre-empted. That got me thinking: Is there such a
thing as "conditional signal safety"?

dladdr() takes a rwlock in read mode. At the moment, this means it can
only block if the lock is write locked, which only dlopen() will ever
do. dladdr() does nothing else that would impede signal safety. But of
course, these are implementation details. What is actually defined about
the interface?

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.