Small example of livelock regression in garbage collector for GCJ 3.3 under Win32

Andrew Haley aph@redhat.com
Tue May 20 16:15:00 GMT 2003


Øyvind Harboe writes:
 > Ah!
 > 
 > Finally I got to the bottom of this. I've managed to 
 > put together a small example that reproduces the 
 > problems I've been seeing. Hopefully this testcase
 > is useful under Linux as well.
 > 
 > Short version: GCJ 3.3 will eventually livelock if an 
 > exception is caused in a finalize method.
 > 
 > Compile the program below. It will livelock under 3.3,
 > with 3.2 it does not livelock.

I can not reproduce this with i686-linux-gnu.  How long does it take?
What _exactly_ are the symptoms of this "livelock"?

There was a deadlock between exception handling and the garbage
collector, but Hans fixed that; AFAICR the fix went into gcc 3.3.

 > 	Foobar xxx;
 > 
 > 	class Foobar
 > 	{
 > 		public void urk()
 > 		{
 > 		};
 > 
 > 		protected void finalize() throws Throwable
 > 		{
 > 			/* cause an exception */
 > 			xxx.urk();

I take it that this is a null pointer exception.  Presumably throwing
any exception here would do the same thing.  Did you tyr?

Andrew.



More information about the Java mailing list