gcj crashes if a user-thread gives up its rights

Chris Gray chris.gray@kiffer.be
Sat Dec 11 20:42:00 GMT 2004


On Saturday 11 December 2004 16:35, Jost Boekemeier wrote:
> by calling setuid(#uid_nobody).
>
> The reason seems to be that when the user code is
> finished, the thread tries to send a signal to another
> system thread, but doesn't have the permission
> anymore.  gcj then aborts saying that pthread_kill
> failed.
>
> I haven't looked at the code [...]

Nor have I, but in general a thread which has terminated needs to ask some 
other thread to release its resources - maybe a "reaper thread" dedicated to 
this task, or a "thread group manager thread" or whatever. Reason being that 
the statement
  free(this thread's stack)
is not thread-safe. ;->

Chris



More information about the Java mailing list