This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/415] pthread_cancel does not unwind stack when thread is cancelled inside signal handler


------- Additional Comments From drepper at redhat dot com  2004-10-07 10:52 -------
What ever you find working or not working is irrelevant here.  It all is
undefined behavior.  You can use it if it works but don't come crying when it
breaks after the next update.  There are no guarantees whatsoever.  POSIX
clearly says (XRAT, page 175):

A correct and complete implementation of cancellation in the presence of
asynchronous signals requires considerable care. An implementation has to push a
cancellation cleanup handler on the cancellation cleanup stack while maintaining
the integrity of the stack data structure. If an asynchronously-generated signal
is posted to the thread during a stack operation, the signal handler cannot
manipulate the cancellation cleanup stack. As a consequence, asynchronous signal
handlers may not cancel threads or otherwise manipulate the cancellation state
of a thread. Threads may, of course, be canceled by another thread that used a
sigwait() function to wait synchronously for an asynchronous signal.


I.e., the application is responsible to not call any interfaces which are
cancellation points in a signal handler if the thread could be canceled.

There is no arguing about making this possible.  It will never happen since it
would amount to making the entire runtime async cancel safe which is completely
unpractical.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID


http://sources.redhat.com/bugzilla/show_bug.cgi?id=415

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]