Re: __kernel_vsyscall () hangs in SIGCHLD handler

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mikael Pettersson
Date: Wednesday, September 26, 2007 - 12:11 pm

Ulrich Drepper writes:
 > On 9/26/07, John Z. Bohach <jzb2@aexorsyst.com> wrote:
 > > Is there some reason that syslog() sleeps in __kernel_vsyscall() when
 > > invoked from a signal handler?
 > 
 > Only very few functions are allowed to be called from signal handlers.
 >  This is clearly spelled out in the POSIX spec.  Section XSH 2.4.3
 > lists the allowed functions.  syslog of course is not on it.

The Linux kernel itself imposes no restrictions on what you can
do in user-space signal handlers.

However, user-space is a different story. The interrupted thread
may have held a lock, in which case calling code from the signal
handler that tries to take the same lock may result in a deadlock.
Or the thread may be been in the process of updating some private
data, in which case calling code from the signal handler that tries
to access that data may result in data corruption. And then there's
libc which may wrap your signal handler with code doing unspecified
libc magic. And so on, the possibilities for failure are endless :-)
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
__kernel_vsyscall () hangs in SIGCHLD handler, John Z. Bohach, (Wed Sep 26, 7:57 am)
Re: __kernel_vsyscall () hangs in SIGCHLD handler, Ulrich Drepper, (Wed Sep 26, 10:03 am)
Re: __kernel_vsyscall () hangs in SIGCHLD handler, John Z. Bohach, (Wed Sep 26, 11:51 am)
Re: __kernel_vsyscall () hangs in SIGCHLD handler, Mikael Pettersson, (Wed Sep 26, 12:11 pm)