This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java/5368: gcj-3.0.3 segfaults with 20 line program



>Number:         5368
>Category:       java
>Synopsis:       gcj-3.0.3 segfaults with 20 line program
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 13 07:16:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     ian.bruce@myrealbox.com
>Release:        gcj-3.0.3
>Organization:
>Environment:
linux-2.2.17/alpha
>Description:
Here's the whole story:

$ ls -RF .
.:
b/  test/

./b:
a.java

./test:
gcj_test.java
$ 
$ gcj -v -I. -C test/gcj_test.java 
Reading specs from /usr/lib/gcc-lib/alpha-linux/3.0.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc alpha-linux
Thread model: posix
gcc version 3.0.3
 /usr/lib/gcc-lib/alpha-linux/3.0.3/jc1 test/gcj_test.java -quiet -dumpbase gcj_test.java -g1 -version -fsyntax-only -femit-class-files -o /dev/null -I.
GNU Java version 3.0.3 (alpha-linux)
        compiled by GNU C version 3.0.3.
test/gcj_test.java: In class `gcj_test':
test/gcj_test.java: In method `gcj_test.gcj_segf_dummy(java.lang.String,java.lang.String,java.lang.String)':
test/gcj_test.java:7: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
$ 
$ uname -a
Linux bandit 2.2.17 #1 Thu Jun 29 13:33:28 EDT 2000 alpha unknown
$ 
>How-To-Repeat:
(this just repeats the contents of the archive file)

$ cat b/a.java 
package b;

public class a
{
    public static void qqq(String s1, String s2, String s3)
    {
        System.out.println(s1 + s2 + s3);
    }
}
$ 
$ cat test/gcj_test.java 
import b.a;

public class gcj_test
{
    public static void gcj_segf_dummy(String s1, String s2, String s3)
    {
        b.a.qqq(s1, s2, s3);
    }

    public static boolean b;
}
$ 
>Fix:
The problem seems to be the ambiguity caused by the package 'b' having the same name as a member variable of class 'gcj_test'. If the member name is changed, the segfault goes away. However, the compiler should not segfault on ANY input. This example is easily fixed, but this is not the case when you are working with a large body of existing code, as I was when I discovered this problem.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/gzip; name="segf.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="segf.tar.gz"

H4sICGGOQTwAA3NlZ2YudGFyAO3W3W6CMBgGYI65ih5qtrC2gD3wMrwAU5ARHH/aYmIW731f3XDu
x5ktw2XxfQ6k6oclvLSfJsvvdVfaO284nEdSxTEduVAxPz72PK4iyUMeKik9LrhSscfiAa/poDNW
rxnzCl1/WXfu+3/K9Pknwz0B38h/QpWUv5AyRP6XcJS/DpZ6oweYg9YzBRudzF9K0ecfxcKtfykn
tP75ANfywZXn3+r0QecZS6a+33ZJWaQsLbUxTPuPPiMvH9JdsnTYNMWCrVar0cyuizpnRtyyfihf
h+F4f+7zLzizrbFZFTSdDVoqsWU9MoLd0EnuJRxP95U7f+f/9Q25Mof1bzMz1J+AH+z/aiKw/1/C
2/zzdDl3g9/tBGf3f9rs+/z5Pv+I3mD/v4Siapu1ZUmg3zeA/lk43QdchXt+5ouuqrbfbQk0ZeA6
iat3hUdd4JMJk6YpM127PoUeAQAAAAAAAAAAAAAAAHDCE5Plx3QAKAAA


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]