Bug 43086 - PR16923 fails with Assertion failed: (class_id)
Summary: PR16923 fails with Assertion failed: (class_id)
Status: RESOLVED DUPLICATE of bug 43839
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.4.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-15 22:10 UTC by Jack Howarth
Modified: 2010-04-21 23:19 UTC (History)
4 users (show)

See Also:
Host: x86_64-apple-darwin*
Target: x86_64-apple-darwin*
Build: x86_64-apple-darwin*
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gdb walk for PR16923 failure (2.86 KB, text/plain)
2010-02-15 22:12 UTC, Jack Howarth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2010-02-15 22:10:57 UTC
On x86_64-apple-darwin9/10, the PR16923 libjava testcase, when linked to the proper libiconv, fails with...

Assertion failed: (class_id), function main, file /sw/src/fink.build/gcc44-4.4.2-1000/gcc-4.4.2/libjava/testsuite/libjava.jni/invocation/PR16923.c, line 35.
Abort

A build of gcc-4.4.2 with the libgcc built with -O0 shows a backtrace of this failure as...

#0  _Jv_AllocPtrFreeObj [inlined] () at java-gc.h:55
#1  _Jv_AllocString (len=Cannot access memory at address 0xf
) at ../../../gcc-4.4.2/libjava/prims.cc:627
Cannot access memory at address 0xf
Comment 1 Jack Howarth 2010-02-15 22:12:41 UTC
Created attachment 19883 [details]
gdb walk for PR16923 failure
Comment 2 mrs@gcc.gnu.org 2010-04-21 18:39:27 UTC
When I run it by hand, I get:

$ /Users/mrs/net/gcc-java/gcc/xgcc -B/Users/mrs/net/gcc-java/gcc/ /Users/mrs/net/gcc/libjava/testsuite/libjava.jni/invocation/PR16923.c   -bind_at_load -multiply_defined suppress -I. -I.. -I/Users/mrs/net/gcc/libjava/testsuite/libjava.jni -I/Users/mrs/net/gcc/libjava/testsuite/../include -I/Users/mrs/net/gcc/libjava/testsuite/../classpath/include -fdollars-in-identifiers -L/Users/mrs/net/gcc-java/x86_64-apple-darwin10/./libjava/.libs -ljvm -shared-libgcc -ldl -lgcj -L/opt/local/lib -liconv  -lm    -o PR16923
$ export CLASSPATH=~/net/gcc/libjava/testsuite/libjava.jni/invocation/PR16923.jar
$ DYLD_LIBRARY_PATH=../.libs:../../libgcc:/opt/local/lib ./PR16923
optionReceived

on x86_64-apple-darwin10 so this would be just a simple matter of ensuring the setting of DYLD_LIBRARY_PATH, CLASSPATH and compiling with -L/opt/local/lib.  I suspect DYLD_LIBRARY_PATH and CLASSPATH  are already correct.  I'm hoping you can confirm this incantation works for you.

I've filed PR43839 that covers getting -L added, which I hope resolves this issue.
Comment 3 mrs@gcc.gnu.org 2010-04-21 19:02:45 UTC
I've been able to confirm that with the hack patch in PR43839, this testcase works on x86_64-apple-darwin10.

*** This bug has been marked as a duplicate of 43839 ***
Comment 4 Jack Howarth 2010-04-21 23:19:58 UTC
Mike,
    The suggestion in Comment 2 works fine with my gcc trunk build on x86_64-apple-darwin10 (assuming one fixes the-liconv linkage manually)...

bash-3.2# /sw/src/fink.build/gcc46-4.5.999-20100418/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc46-4.5.999-20100418/darwin_objdir/gcc/ /sw/src/fink.build/gcc46-4.5.999-20100418/gcc-4.6-20100418/libjava/testsuite/libjava.jni/invocation/PR16923.c   -bind_at_load -multiply_defined suppress -I. -I.. -I/sw/src/fink.build/gcc46-4.5.999-20100418/gcc-4.6-20100418/libjava/testsuite/libjava.jni -I/sw/src/fink.build/gcc46-4.5.999-20100418/gcc-4.6-20100418/libjava/testsuite/../include -I/sw/src/fink.build/gcc46-4.5.999-20100418/gcc-4.6-20100418/libjava/testsuite/../classpath/include -fdollars-in-identifiers -L/sw/src/fink.build/gcc46-4.5.999-20100418/darwin_objdir/x86_64-apple-darwin10.3.0/./libjava/.libs -ljvm -shared-libgcc -lgcj -L/sw/lib -liconv  -lm   -o PR16923
bash-3.2# export CLASSPATH=/sw/src/fink.build/gcc46-4.5.999-20100418/gcc-4.6-20100418/libjava/testsuite/libjava.jni/invocation/PR16923.jar
bash-3.2# DYLD_LIBRARY_PATH=../.libs:../../libgcc:/opt/local/lib ./PR16923
optionReceived