From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20700 invoked by alias); 16 May 2008 15:27:04 -0000 Received: (qmail 26564 invoked by uid 48); 16 May 2008 09:54:10 -0000 Date: Fri, 16 May 2008 15:27:00 -0000 Subject: [Bug java/36247] New: Segfault with -findirect-dispatch and --jni X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "william dot fink at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg01214.txt.bz2 When compiling a simple java file with gcj the compiler output a segfault. After several test and simplifications, it appears that the conditions of this failure is: - Use the -findirect-dispatch flag - Use the --jni flag - The class contains at last one jni method - The class contains at last one constructor If one this condition is unmet, the compilation succeed. I tried compilling the .java, .class and .jar file, each time with the same result. Using strace the segfaulting program seems to be jc1 I have the same result with: - gcj-4.2 (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu6) - gcj-4.3 (GCC) 4.3.0 [Compiled from sources] -- Compiler output: $ gcj-4.3 -findirect-dispatch --jni Test.java -c Test.java: In class 'Test': Test.java: In method 'foo()': Test.java:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. -- Test case: public class Test { public native void foo (); public Test () { } } -- strace part (with gcj 4.2 on Ubuntu) [pid 13927] execve("/usr/lib/gcc/i486-linux-gnu/4.2.3/jc1", ["/usr/lib/gcc/i486-linux-gnu/4.2."..., "Test.class", "-fhash-synchronization", "-fno-use-divide-subroutine", "-fuse-boehm-gc", "-fnon-call-exceptions", "-fkeep-inline-functions", "-quiet", "-dumpbase", "Test.class", "-mtune=generic", "-auxbase", "Test", "-g1", "-findirect-dispatch", "-fjni", ...], [/* 38 vars */]) = 0 -- Summary: Segfault with -findirect-dispatch and --jni Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: william dot fink at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36247