OSSP CVS Repository |
|
If the pthread module from the man page is used, pthread_init() sets the function to retrieve the exception context (__ex_ctx) to pthread_ex_ctx(). This function only results with a pointer to an exception context struct when there was that data assiciated to the thread before with pthread_setspecific() which is always done when a thread is created with the create wrapper. But for the main program thread pthread_getspecific returns NULL resulting in a segmantation fault when NULL is referenced later on (this usually occurs in the ex_try macro when accessing the machine context). The attached patch returns the static exception context as __ex_ctx_default() does in the case pthread_getspecific() returns NULL. It also uses the default termination function in pthread_ex_terminate in this case.
|
Type: code Version: Status: fixed Created: 2007-Aug-28 07:13 Severity: 2 Last Change: 2007-Oct-12 21:58 Priority: 2 Subsystem: ex Assigned To: rse Derived From: Creator: anonymous
2007-Oct-12 21:57 | • | Check-in [5973]: Fix example given under "MULTITHREADING ENVIRONMENTS" in the manual page. The problem is that the context can be still not associated and hence be NULL. Submitted by: Frank Hempel <red_socks@gmx.de> (By rse) |
- patch 919 bytes added by anonymous on 2007-Aug-28 05:19:08 UTC.