java/6754: Casting to gnu.gcj.RawData causes SEGV
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Mon May 20 19:27:00 GMT 2002
Adam Megacz wrote:
>Here's the test case; it's logged in the PR as well:
>> - a
>>>>import java.io.*;
>import gnu.gcj.RawData;
>>public class test {
>> public static native RawData foo();
>> public static RawData bar(Object o) {
> return (RawData)o;
> }
>> public static void main(String[] s) throws Exception {
> bar(foo());
> }
>>
This isn't a bug. It isn't really safe to do anything with non-Java
objects in Java code, you certainly can't cast one.
RawData is just a hack to let you store non-Java data, which you don't
want scanned by the GC, in a Java object. You probibly shouldn't
actually use "RawData" in Java source for anything other than field
declarations.
regards
Bryce.
More information about the Java
mailing list