[kaffe] StackOverflowError and NegativeArraySizeException

daniel at fh-konstanz.de daniel at fh-konstanz.de
Sat Nov 5 09:20:08 PST 2005


Hello list!

My aim is to port kaffe-1.0.6 on an M68k-Platform with eCos as os.

Hardware Configuration:

Motorola Coldfire 5282 with 8 MB FLASH and 16 MB RAM

I have applied kaffe-1.0.6 because the "sinby" peaople had adapted the
kaffe-1.0.6 source code.

I have compiled kaffe successfully against the eCos library. The result is a
static kaffe binary with a size of about 5 MB. The next step was to upload this
kaffe binary with the debuger "Insight 5.3" into the RAM. On Flash i have ported
 the necessary rt.jar and other native libs, like libnative.a (4 MB).
When starting kaffe, you can see that kaffe tries to open and read 33 Java
classes (for example Integer.class, Double.class) successfully. The last loaded
class was " /lang/Error.class".

After loading the classes, kaffe tries to execute the "do_execute_java_method".
The execute method is "add" - method from the "Thread" Java class. (Thread.add)
 While execute the "do_execute_java_method" following error occurs:

Internal error: caught an unexpected exception.
Please check yozur CLASSPATH and your installation
java/lang/StackOverflowError
at java.lang.RuntimeException.<init>(RuntimeException.java:17)
at
java.lang.NegativeArraySizeException.<init>(NegativeArraySizeException.java:17)

I have defined the following constants with that value:

#define	THREADSTACKSIZE		(16 * 1024)
#define	MIN_HEAPSIZE	(5*1024*1024)
#define	MAX_HEAPSIZE	(64*1024*1024)
#define	ALLOC_HEAPSIZE	(1024*1024)
#define MAINSTACKSIZE (16*1024) 
#define GCSTACKSIZE		16384

In eCos i have limited the MAINSTACKSIZE to 16 kbyte.

Because my system have no console, but a jffs2 filesystem, i have created in the
directory /kaffe/config/m68k/ecos/md.c the function "kaffe_ecos_main", which is
invoked in the kaffes main.c through 
#define MAIN_MD kaffe_ecos_main(&argc, &argv).
In this function i have defined the classpath:

void kaffe_ecos_main(int *pargc, char ***pargv)
{
	        static char *ecos_argv[] = {
		"Kaffe",
		"-classpath",
		"/lib",
		NULL
};

Whats wrong?
Is any stacksize to small because of the stack overflow?

What sizes are suitable for my system? I would be glad about an answer!

Danny!



 




More information about the kaffe mailing list