Bug in initThreads() in thread.c

David Smith dsmith at algonet.se
Wed Sep 9 16:38:14 PDT 1998

Kim, Jongwon (freefish) wrote:
> The location of exception is add method in java.lang.ThreadGroup.java with JDK1.1.6.
> The exception occurred at calling createInitialThread("main") in thread.c.
> The instance variable, threads is not null and length is 0.
> So I modified to following line.
> unhand(standardGroup)->threads = 0; // (HArrayOfObject*)newArray(ThreadClass, 0); by freefish
> I don't understand why others did not complain of this.
> Did I misunderstand that?

You're supposed to use Klasses.jar instead of Sun's classes.  (You do 
use the classes from JDK1.1.6 don't you, otherwise just forget I wrote
this :-)

The version of ThreadGroup.add(Thread t) in Klasses.jar would give an
exception (I think) with threads = 0 and works fine with threads =
(HArrayOfObject*)newArray(ThreadClass, 0).

David Smith

More information about the kaffe mailing list