[kaffe] createDaemon Bug in kaffe-1.0.6

Timothy Stack stack at cs.utah.edu
Thu Jun 27 09:31:51 PDT 2002


> --- Fang Weijian <wjfang at csis.hku.hk> wrote:
> > I found a bug related to createDaemon and gc in
> > kaffe-1.0.6.
> > 
> > In createDaemon() of thread.c, an Hjava_lang_Thread
> > object will be created,
> > and its members, target and group, will be used to
> > store the function and
> > arg of the daemon temporarily. Later, target and
> > group will be reset in
> > startSpecialThread().
> > 
> > However, if a gc is invoked between createDaemon and
> > startSpecialThread, a
> > bug will occur. According to the gc layout of
> > Hjava_lang_Thread, gc will try
> > to mark what the target points to. At this moment,
> > target points to the
> > daemon function that is not in the heap. Then Kaffe
> > will abnormally exit.
> > 
> > I don't know whether this bug has been reported
> > before, and whether it is
> > fixed in the latest version of Kaffe.
> 
> Thanks for the detailed bug report. How did you come
> accross the bug? Do you have some source code example
> that triggers it? That would allow us to test if it
> still exists in current release and to add the test to
> our regression test suite.
> 
> thread.c hasn't chaged much since 1.0.6, except for
> some small fixes, so the bug probably persists. Can
> you think of a way to fix it?

I ran across the same thing JanosVM and just added a couple of
kaffe.util.Ptr's to java.lang.Thread that held the
function pointer and argument.  Unfortunately, i don't have a test
case for it.

> best regards,
> 
> dalibor topic

tim stack




More information about the kaffe mailing list