Bug 57799 - ICE in jcf-parse.c
Summary: ICE in jcf-parse.c
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.8.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2013-07-03 14:57 UTC by Mike Hearn
Modified: 2016-09-30 22:52 UTC (History)
0 users

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hearn 2013-07-03 14:57:55 UTC
Whilst compiling a JAR containing the following snippet of code, I get a segfault that looks like this:

#0  0x0000000000535541 in rewrite_reflection_indexes (arg=0x7fffffffd5f0) at ../../gcc-4.8.1/gcc/java/jcf-parse.c:754
#1  0x000000000050c7d7 in make_class_data (type=0x7ffff5f82dc8) at ../../gcc-4.8.1/gcc/java/class.c:2193
#2  0x000000000050cbb1 in finish_class () at ../../gcc-4.8.1/gcc/java/class.c:2255
#3  0x000000000053946b in parse_class_file () at ../../gcc-4.8.1/gcc/java/jcf-parse.c:1661
#4  0x000000000053a37a in parse_zip_file_entries () at ../../gcc-4.8.1/gcc/java/jcf-parse.c:2101
#5  0x0000000000539dd0 in java_parse_file () at ../../gcc-4.8.1/gcc/java/jcf-parse.c:1931
#6  0x00000000008e60b7 in compile_file () at ../../gcc-4.8.1/gcc/toplev.c:543
#7  0x00000000008e7fed in do_compile () at ../../gcc-4.8.1/gcc/toplev.c:1864
#8  0x00000000008e8158 in toplev_main (argc=22, argv=0x7fffffffdd18) at ../../gcc-4.8.1/gcc/toplev.c:1940
#9  0x0000000000e9b620 in main (argc=22, argv=0x7fffffffdd18) at ../../gcc-4.8.1/gcc/main.c:36

I debugged it a bit, the offending class looks like this:

public class ProtobufParser<MessageType extends MessageLite> {
    public interface Listener<MessageType extends MessageLite> {
        public void messageReceived(ProtobufParser<MessageType> handler, MessageType msg);
        public void connectionOpen(ProtobufParser<MessageType> handler);
        public void connectionClosed(ProtobufParser<MessageType> handler);

The crashing class is the inner ProtobufParser$Listener.class file.

I can send a complete JAR to someone privately if you'd like to debug this further. I tried compiling the ProtobufParser$Listener.class file independently like this:

gcj -c -o x ProtobufParser\$Listener.class

and .... no crash :(
Comment 1 Andrew Pinski 2016-09-30 22:52:06 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.