Bug 18212 - nativ compilation with multiple jars fails / gives internal compiler error
nativ compilation with multiple jars fails / gives internal compiler error
Status: NEW
Product: gcc
Classification: Unclassified
Component: java
3.4.2
: P2 normal
: ---
Assigned To: Not yet assigned to anyone
: ice-on-valid-code
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-28 22:10 UTC by Bojan Antonovic
Modified: 2005-07-23 22:39 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-16 01:15:58


Attachments
B.jar (17.20 KB, application/octet-stream)
2004-10-29 14:20 UTC, Bojan Antonovic
Details
X.jar (74.00 KB, application/octet-stream)
2004-10-29 14:20 UTC, Bojan Antonovic
Details
A.jar (212.06 KB, application/octet-stream)
2004-10-29 14:20 UTC, Bojan Antonovic
Details
produces ICE without other jars (241.19 KB, application/octet-stream)
2005-03-07 00:49 UTC, Bojan Antonovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bojan Antonovic 2004-10-28 22:10:47 UTC
given: A.jar, B.jar and X.jar. X.jar depends on A.jar and B.jar.

wanted: nativ compiled X.jar to a.out and x.exec

1 given jar:

working: gcj --main=A.main A.jar
working: gcj -o a.exec --main=A.main A.jar

multiple given jars:

working: gcj --classpath:A.jar:B.jar:. --main=X.main X.jar A.jar B.jar
working: gcj --classpath:A.jar:B.jar:. --main=X.main X/main.class A.jar B.jar

failing:  gcj -o x.exec --classpath:A.jar:B.jar:. --main=X.main X.jar A.jar B.jar
crashing: gcj -o x.exec --classpath:A.jar:B.jar:. --main=X.main X/main.class
A.jar B.jar

When its failing, it compiles other things:
java/awt/Component.java: In class `java.awt.Component':
java/awt/Component.java: In method `java.awt.Component.eventTypeEnabled(int)':
java/awt/Component.java:4127: error: expected type 'int' but stack contains 'void'
java/awt/Component.java:4127: error: verification error at PC=311
java/awt/Component.java:4127: error: types could not be merged
^Cmake: *** [exe] Interrupt

The crash ends in an internal compiler error: Bus error.

I builded GCJ myself. See: http://gcc.gnu.org/ml/gcc/2004-09/msg00677.html

Bojan
Comment 1 Andrew Pinski 2004-10-29 13:08:23 UTC
This is most likely the same as PR 11117.

Could you attach all three jar files?
Comment 2 Bojan Antonovic 2004-10-29 14:19:58 UTC
Subject: Re:  nativ compilation with multiple jars fails /
 gives internal compiler error

pinskia at gcc dot gnu dot org wrote:

>------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-29 13:08 -------
>This is most likely the same as PR 11117.
>
>Could you attach all three jar files?
>
>  
>
You have them in the attachment.

Because they're renamed, the real compilation calls for the classes of X 
are:

working: gcj --classpath=A.jar:B.jar:. --main=ProcessorOptimizer.Main 
ProcessorOptimizer/*.class ProcessorOptimizer/*/*.class A.jar B.jar
crashing: gcj -o x.exec --classpath=A.jar:B.jar:. 
--main=ProcessorOptimizer.Main ProcessorOptimizer/*.class 
ProcessorOptimizer/*/*.class A.jar B.jar
crashing: gcj -o x.exec --classpath=A.jar:B.jar:X.jar:. 
--main=ProcessorOptimizer.Main ProcessorOptimizer/*.class 
ProcessorOptimizer/*/*.class A.jar B.jar

The last crashing one is new.

working:  gcj --classpath=A.jar:B.jar:. --main=ProcessorOptimizer.Main 
X.jar A.jar B.jar
failing:     gcj -o x.exec --classpath=A.jar:B.jar:. 
--main=ProcessorOptimizer.Main X.jar A.jar B.jar
failing:     gcj -o x.exec --classpath=B.jar:A.jar:. 
--main=ProcessorOptimizer.Main X.jar A.jar B.jar

The last failing one is new.

I have tested this calls. I hope _I_ made no bug in the bug report! :)

Bojan



Comment 3 Bojan Antonovic 2004-10-29 14:20:07 UTC
Created attachment 7428 [details]
B.jar
Comment 4 Bojan Antonovic 2004-10-29 14:20:08 UTC
Created attachment 7429 [details]
X.jar
Comment 5 Bojan Antonovic 2004-10-29 14:20:08 UTC
Created attachment 7430 [details]
A.jar
Comment 6 Bojan Antonovic 2004-11-08 16:29:36 UTC
Subject: Re:  nativ compilation with multiple jars fails /
 gives internal compiler error

Problems exists still with GCJ 3.4.3.

Bojan

Comment 7 Tom Tromey 2004-12-01 21:59:18 UTC
Most of these cases work fine for me.

However, this one fails:

opsy. gcj -o Z --classpath=B.jar:A.jar:. --main=ProcessorOptimizer.Main X.jar
A.jar B.jar
java/security/SecureRandom.java:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Comment 8 Bojan Antonovic 2005-03-07 00:49:50 UTC
Created attachment 8349 [details]
produces ICE without other jars
Comment 9 Bojan Antonovic 2005-03-07 00:59:04 UTC
The part of the bug that produces the ICE (bus error) can be reproduced by
extracting and compiling all classes from a single jar. Unzip all classes from
SMOOD.jar by

unzip -l SMOOD.jar

and then compile with

gcj  -o smood.exe --main=smood.Main smood/Main.class smood/*/*.class
smood/*/*/*.class smood/*/*/*/*.class

gives

smood/Main.class:0: internal compiler error: Bus error

This ICE is not yet reproducable with other jars or with less files. However,
because bug 18212 can be splitted to bug 20351 and an other possible new one, it
can be soon removed as duplicate of two known bugs, as soon the one for the ICE
is found.
Comment 10 Bojan Antonovic 2005-03-07 17:11:43 UTC
Bug 18212 can be splitted, and be seen as duplicate, of bugs 20351 and 20362.

I mark it as duplicate of bug 20362. (If patches for 20362 and 20351 fail for
18212, it can be reopened). 

*** This bug has been marked as a duplicate of 20362 ***
Comment 11 Ranjit Mathew 2005-03-09 11:03:29 UTC
I can still see a crash similar to what Tom is seeing, but the other two
bugs are fixed - the break-up was not correct.