public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/36247]  New: Segfault with -findirect-dispatch and --jni
@ 2008-05-16 15:27 william dot fink at gmail dot com
  2008-05-16 18:24 ` [Bug java/36247] " tromey at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: william dot fink at gmail dot com @ 2008-05-16 15:27 UTC (permalink / raw)
  To: gcc-bugs

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 <http://gcc.gnu.org/bugs.html> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-14 19:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-16 15:27 [Bug java/36247] New: Segfault with -findirect-dispatch and --jni william dot fink at gmail dot com
2008-05-16 18:24 ` [Bug java/36247] " tromey at gcc dot gnu dot org
2008-05-16 19:04 ` tromey at gcc dot gnu dot org
2008-05-16 19:40 ` tromey at gcc dot gnu dot org
2008-06-14 19:49 ` tromey at gcc dot gnu dot org
2008-06-14 19:51 ` tromey at gcc dot gnu dot org
2008-06-14 19:51 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).