gcj/232: segmentation violation at except.c:2180
Fred Gray
fegray@uiuc.edu
Sun May 21 21:40:00 GMT 2000
The following reply was made to PR gcj/232; it has been noted by GNATS.
From: Fred Gray <fegray@uiuc.edu>
To: bryce@albatross.co.nz (Bryce McKinlay)
Cc: fegray@uiuc.edu, java-gnats@sourceware.cygnus.com
Subject: Re: gcj/232: segmentation violation at except.c:2180
Date: Sun, 21 May 2000 23:38:05 -0500 (CDT)
>
> The problem is that gcj does not like the use of a static final String as
> a monitor lock.
>
> Workaround: make "lock" an Object, or make it non-final.
>
I think that this is an oversimplification of the situation, because the
following also fails, though only when compiled from bytecode:
public class PR232B
{
private static Object lock = new Object();
private static PR232B instance = null;
public void a()
{
synchronized(lock)
{
instance = new PR232B();
}
}
};
Note that lock is now a non-final Object.
Thanks.
-- Fred
More information about the Java-prs
mailing list