This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj crashes if a user-thread gives up its rights
- From: Chris Gray <chris dot gray at kiffer dot be>
- To: Jost Boekemeier <jost2345 at yahoo dot de>, java at gcc dot gnu dot org
- Date: Sat, 11 Dec 2004 21:57:16 +0100
- Subject: Re: gcj crashes if a user-thread gives up its rights
- Organization: /k/ Embedded Java Systems
- References: <20041211153551.78395.qmail@web60110.mail.yahoo.com>
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