[kaffe] race during thread creation and gc invocation

Helmer Krämer hkraemer at freenet.de
Mon Dec 20 03:17:13 PST 2004


On Sat, 11 Dec 2004 21:50:54 +0100
Alexander Boettcher <ab764283 at os.inf.tu-dresden.de> wrote:

Hi Alexander,

> i have a race condition in thread.c found which (may) causes Kaffe to
> hang - for our L4 system it happens. 

[skipping lame excuses for not responding earlier]

thanks for the detailed analysis :) I suspect that this may also be
the cause for some of the regression test failures on smp systems.

>  So, jlThread can not be used in this form, a other pointer would be
> necessary in the threadData structure or the gc may not assume that
> jlThread is of type VMThread and has to handle it.
>  
>  What do you think ?

Probably the easiest way would be to simply skip uninitialized
threads in liveThreadWalker. To determine whether a thread is
properly initialized, we can (ab)use threadData.jniEnv and define
a thread as initialized iff threadData.jniEnv is not NULL. The
attached patch does exactly that and seems to work on my i386.
Could you probably give it a try?

Thanks,
Helmer
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: thread.patch
Url: http://kaffe.org/pipermail/kaffe/attachments/20041220/1aa306fa/attachment-0002.txt 


More information about the kaffe mailing list