This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
Re: gcj/232: segmentation violation at except.c:2180
- To: apbianco at cygnus dot com
- Subject: Re: gcj/232: segmentation violation at except.c:2180
- From: Fred Gray <fegray at uiuc dot edu>
- Date: 22 May 2000 04:40:01 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Fred Gray <fegray at uiuc dot edu>
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