mailing list of musl libc
 help / color / mirror / code / Atom feed
* Conditional signal safety?
@ 2019-06-29  5:54 Markus Wichmann
  2019-06-29  9:33 ` Szabolcs Nagy
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Markus Wichmann @ 2019-06-29  5:54 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-01 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-29  5:54 Conditional signal safety? Markus Wichmann
2019-06-29  9:33 ` Szabolcs Nagy
2019-06-29 16:49 ` Rich Felker
2019-07-01  4:21 ` Florian Weimer
2019-07-01 14:06   ` Rich Felker
2019-07-01 15:55     ` Florian Weimer
2019-07-01 16:13       ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).