public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/15734] New: internal compiler error: Segmentation fault
@ 2004-05-30 15:51 dolfi at zkm dot de
  2004-05-30 15:52 ` [Bug java/15734] " dolfi at zkm dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dolfi at zkm dot de @ 2004-05-30 15:51 UTC (permalink / raw)
  To: java-prs

Dear GCJ guru,

Compiling a small class created with scala 1.1.1.3 
(http://scala.epfl.ch/downloads/Web_Installers/InstData/Linux/NoVM/install.bin)
I get this message:

~$ scalac Factorial.scala 
~$ gcj --CLASSPATH=/usr/local/Scala/lib Factorial.class 

Factorial.scala: In class `Factorial':
Factorial.scala: In method `Factorial.fact_rec(int)':
Factorial.scala:14: internal compiler error: Segmentation fault

The scala source is below. Unfortunately, there is no way to send you the .class
files created by scalac with this web form. You can either reply to me so I can
send you the rest, or install scala from the above URL -- it's simple ;)

Sorry, can't figure out what a host/target/buid triplet is: I've built gcc with
the 3.3.2 gcc installed on Mandrake 10.0 Linux, kernel 2.6.3-4mdk.

gcj -v gives:
Reading specs from /home/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Reading specs from
/home/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../configure --enable-language=c,c++,f77,java
Thread model: posix
gcc version 3.4.0


object Factorial with Application {

  def fact_rec(n: Int): Int =
    if (n == 0) 1
    else n * fact_rec(n - 1);

  def fact_tail(n: Int): Int =
    if (n == 0) 1
    else {
      def iter(x: Int, result: Int): Int =
        if (x > n) result
        else iter(x + 1, result * x);
      iter(1, 1)
    };

  def fact_iter(n: Int): Int = {
    var i = n;
    var prod = 1;
    while (i > 0) {
      prod = prod * i;
      i = i - 1
    }
    prod
  }

  Console.println("fact_rec(5) = " + fact_rec(5));
  Console.println("fact_rec(10) = " + fact_rec(10));
  Console.println;

  Console.println("fact_tail(5) = " + fact_tail(5));
  Console.println("fact_tail(10) = " + fact_tail(10));
  Console.println;

  Console.println("fact_iter(5) = " + fact_iter(5));
  Console.println("fact_iter(10) = " + fact_iter(10));
}

-- 
           Summary: internal compiler error: Segmentation fault
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dolfi at zkm dot de
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
@ 2004-05-30 15:52 ` dolfi at zkm dot de
  2004-05-30 15:53 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dolfi at zkm dot de @ 2004-05-30 15:52 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From dolfi at zkm dot de  2004-05-30 15:51 -------
Created an attachment (id=6435)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6435&action=view)
this file crashes gcj


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
  2004-05-30 15:52 ` [Bug java/15734] " dolfi at zkm dot de
@ 2004-05-30 15:53 ` pinskia at gcc dot gnu dot org
  2004-05-30 15:59 ` dolfi at zkm dot de
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-30 15:53 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|                            |i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
  2004-05-30 15:52 ` [Bug java/15734] " dolfi at zkm dot de
  2004-05-30 15:53 ` pinskia at gcc dot gnu dot org
@ 2004-05-30 15:59 ` dolfi at zkm dot de
  2004-05-30 16:20 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dolfi at zkm dot de @ 2004-05-30 15:59 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From dolfi at zkm dot de  2004-05-30 15:53 -------
Created an attachment (id=6436)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6436&action=view)
the other class file generated by scalac


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (2 preceding siblings ...)
  2004-05-30 15:59 ` dolfi at zkm dot de
@ 2004-05-30 16:20 ` pinskia at gcc dot gnu dot org
  2004-05-31 14:59 ` dolfi at zkm dot de
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-30 16:20 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-30 15:59 -------
I can reproduce the error when the file "Factorial$.class" does not exist but it I get an error since I do 
not have scala installed.
Can you try the following command, it puts the current directory in the classpath which I think is the 
problem but this is still a bug if that works:
gcj --CLASSPATH=/usr/local/Scala/lib: Factorial.class

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (3 preceding siblings ...)
  2004-05-30 16:20 ` pinskia at gcc dot gnu dot org
@ 2004-05-31 14:59 ` dolfi at zkm dot de
  2004-06-01 22:30 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dolfi at zkm dot de @ 2004-05-31 14:59 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From dolfi at zkm dot de  2004-05-31 14:33 -------
Subject: Re:  internal compiler error: Segmentation fault

>
> ------- Additional Comments From pinskia at gcc dot gnu dot org
> 2004-05-30 15:59 -------
> I can reproduce the error when the file "Factorial$.class" does not exist
> but it I get an error since I do
> not have scala installed.
> Can you try the following command, it puts the current directory in the
> classpath which I think is the
> problem but this is still a bug if that works:
> gcj --CLASSPATH=/usr/local/Scala/lib: Factorial.class

do you mean this?
gcj --CLASSPATH=/usr/local/Scala/lib:. Factorial.class

Anyway, in all cases, I get
Factorial.scala: In class `Factorial':
Factorial.scala: In method `Factorial.fact_rec(int)':
Factorial.scala:14: error: cannot find file for class scala.Application
Factorial.scala:14: error: cannot find file for class scala.ScalaObject

I tried to strace gcj then, and found that in the case where it segfaults,
it does so short after opening /usr/local/Scala/lib, reading the
directory, and closing it:

[pid  3133] open("/usr/local/Scala/lib",
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6
[pid  3133] fstat64(6, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid  3133] fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
[pid  3133] getdents64(6, /* 6 entries */, 4096) = 176
[pid  3133] getdents64(6, /* 0 entries */, 4096) = 0
[pid  3133] close(6)                    = 0
[pid  3133] --- SIGSEGV (Segmentation fault) @ 0 (0) ---

In the other case where it doesn't find scala.Application and
scala.ScalaObject, it attempts the following,

[pid  3137] open("/usr/local/Scala/lib/java/lang",
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or
directory)
[pid  3137] stat64("/usr/local/Scala/lib/java/lang/Object.class",
0xbfffec1c) = -1 ENOENT (No such file or directory)
[pid  3137] stat64("/usr/local/Scala/lib/java/lang/Object.java",
0xbfffec1c) = -1 ENOENT (No such file or directory)

but never tries to open /usr/local/Scala/lib/scala.jar nor any of the 3
other .jar files in that directory...

Good luck, Dolfi

P.S.: I could send you the content of /usr/local/Scala/lib: I'ts about 2.3
MByte.




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (4 preceding siblings ...)
  2004-05-31 14:59 ` dolfi at zkm dot de
@ 2004-06-01 22:30 ` pinskia at gcc dot gnu dot org
  2004-06-26  0:09 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-01 22:30 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-31 14:59 -------
As with any CLASSPATH on any java compiler, you need be adding the .jar file seperately. So the bug is 
when Factorial$.class is missing, it ICEs.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |3.0.4 3.2.3 3.4.0 3.5.0
                   |                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-31 14:59:51
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (5 preceding siblings ...)
  2004-06-01 22:30 ` pinskia at gcc dot gnu dot org
@ 2004-06-26  0:09 ` pinskia at gcc dot gnu dot org
  2004-06-26 20:42 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-26  0:09 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-25 21:10 -------
Patch here: <http://gcc.gnu.org/ml/java-patches/2004-q2/msg00805.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (6 preceding siblings ...)
  2004-06-26  0:09 ` pinskia at gcc dot gnu dot org
@ 2004-06-26 20:42 ` cvs-commit at gcc dot gnu dot org
  2004-06-26 20:45 ` pinskia at gcc dot gnu dot org
  2004-06-26 20:45 ` mckinlay at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-26 20:42 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-26 20:42 -------
Subject: Bug 15734

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bryce@gcc.gnu.org	2004-06-26 20:42:01

Modified files:
	gcc/java       : ChangeLog expr.c 

Log message:
	PR java/15734
	* expr.c (expand_java_field_op): Ensure that target class for static
	field access has been loaded.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1388&r2=1.1389
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/expr.c.diff?cvsroot=gcc&r1=1.193&r2=1.194



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (8 preceding siblings ...)
  2004-06-26 20:45 ` pinskia at gcc dot gnu dot org
@ 2004-06-26 20:45 ` mckinlay at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: mckinlay at redhat dot com @ 2004-06-26 20:45 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2004-06-26 20:44 -------
Fix commited to HEAD.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

* [Bug java/15734] internal compiler error: Segmentation fault
  2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
                   ` (7 preceding siblings ...)
  2004-06-26 20:42 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-26 20:45 ` pinskia at gcc dot gnu dot org
  2004-06-26 20:45 ` mckinlay at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-26 20:45 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


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

end of thread, other threads:[~2004-06-26 20:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-30 15:51 [Bug java/15734] New: internal compiler error: Segmentation fault dolfi at zkm dot de
2004-05-30 15:52 ` [Bug java/15734] " dolfi at zkm dot de
2004-05-30 15:53 ` pinskia at gcc dot gnu dot org
2004-05-30 15:59 ` dolfi at zkm dot de
2004-05-30 16:20 ` pinskia at gcc dot gnu dot org
2004-05-31 14:59 ` dolfi at zkm dot de
2004-06-01 22:30 ` pinskia at gcc dot gnu dot org
2004-06-26  0:09 ` pinskia at gcc dot gnu dot org
2004-06-26 20:42 ` cvs-commit at gcc dot gnu dot org
2004-06-26 20:45 ` pinskia at gcc dot gnu dot org
2004-06-26 20:45 ` mckinlay at redhat dot com

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).