More information on mysterious garabage collection hang "introduced" in GCJ 3.3

Øyvind Harboe
Fri May 16 12:42:00 GMT 2003

I recently made a posting about my troubles with deadlock and crashes
when trying to switch to GCJ 3.3.

Some more pieces to the puzzle:

- As is indicated in my earlier posting, serial ports and 
the garbage collector is somehow involved.

- I was using's javax.comm. (The reason I started using
this's, is that Suns javax.comm has Java Web Start issues).

- I switched back to Suns javax.comm. This requires a small trick I
picked up in Suns JWS forum:

			// avoid dependency on the silly file
			// works for Java Web Start *and* GCJ.
			String driverName = "com.sun.comm.Win32Driver";
				javax.comm.CommDriver commDriver =
					(javax.comm.CommDriver) Class
			} catch (ClassNotFoundException e)
			} catch (InstantiationException e)
			} catch (IllegalAccessException e)

- I switch to compiling with GCJ 3.3


- The mysterious startup pagefault I reported earlier is gone.
My 3.2 compiled will crash once in a blue moon, even if I use
Suns javax.comm 
- The livelock/deadlock that I previously exprienced with my
GCJ 3.3 executable is gone

I believe these are two seperate problems, since the startup 
pagefault happens regardless of serialport library used.

AFAIK, this fixes all the outstanding showstoppers I had with 
GCJ 3.3 and I've cut a new release candiate of our app that is 
going through QA as I write this.


>From my previous debug session, I *believe* that javax.comm from causes a pagefault in its finalize() method(from JNI?). The

GCJ 3.2 and GCJ 3.3 garbage collector somehow treats this 


More information about the Java mailing list