public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/1431: SIGSEGV in GC
@ 2000-12-20 12:27 patha
  0 siblings, 0 replies; only message in thread
From: patha @ 2000-12-20 12:27 UTC (permalink / raw)
  To: java-gnats

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6605 bytes --]

>Number:         1431
>Category:       libgcj
>Synopsis:       SIGSEGV in GC
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tromey
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:19:47 PST 2000
>Closed-Date:    Fri Sep 24 16:35:17 PDT 1999
>Last-Modified:  Wed Sep 29 16:50:00 PDT 1999
>Originator:     Patrik Hägglund
>Release:        libgcj-2.95.1
>Organization:
>Environment:
sparc-sun-solaris2.7
>Description:
My HelloWorld program dumps core in _init(). 

Here is the output from gdb:

Starting program: /home/patha/hello/Hello 
[New LWP    2        ]
[New LWP    3        ]

Program received signal SIGSEGV, Segmentation fault.
0x7f950dfc in GC_find_limit (p=0xffbeded4 "", up=1)
    at ../../../boehm-gc/os_dep.c:681
(gdb) bt
#0  0x7f950dfc in GC_find_limit (p=0xffbeded4 "", up=1)
    at ../../../boehm-gc/os_dep.c:681
#1  0x7f950e5c in GC_get_stack_base () at ../../../boehm-gc/os_dep.c:723
#2  0x7f94ff94 in GC_init_inner () at ../../../boehm-gc/misc.c:457
#3  0x7f94ce7c in GC_generic_malloc_inner (lb=2052, k=0)
    at ../../../boehm-gc/malloc.c:91
#4  0x7fabc234 in _Jv_InitGC () at ../../../libjava/boehm.cc:335
#5  0x7faa7bb0 in _Jv_RegisterClasses (classes=0xffbee110)
    at ../../../libjava/java/lang/natClass.cc:582
#6  0x7faa7c3c in _Jv_RegisterClass (klass=0x290dc)
    at ../../../libjava/java/lang/natClass.cc:602
#7  0x1407c in global constructors keyed to Hello.Hello () at Hello.java:4
#8  0x180d4 in __do_global_ctors_aux () at include/new:39
#9  0x1810c in _init () at include/new:39
>How-To-Repeat:
I compiled gcc-2.95.1 with --enable-threads and with 
gnu as and ld. (but not with gnu extentions: --with-gnu-as).

libgcj-2.95.1 was also complied with --enable-threads.
The following patch was applied before to 
libjava/configure.in:

--- configure.in~       Sat Aug 21 16:26:14 1999
+++ configure.in        Thu Sep 23 12:50:16 1999
@@ -376,11 +376,11 @@
      AC_CHECK_LIB(rt, sched_yield, [
        AC_DEFINE(HAVE_SCHED_YIELD)
        THREADLIBS="$THREADLIBS -lrt"
-       THREADSPECS="$THREADSPECS -lrt"], [
+       THREADSPEC="$THREADSPEC -lrt"], [
        AC_CHECK_LIB(posix4, sched_yield, [
          AC_DEFINE(HAVE_SCHED_YIELD)
         THREADLIBS="$THREADLIBS -lposix4"
-         THREADSPECS="$THREADSPECS -lposix4"])])])
+         THREADSPEC="$THREADSPEC -lposix4"])])])
    LIBS="$save_LIBS"
 
    # We require a way to get the time.

libgcj.spec was copied to the current directory and 
CLASSPATH was set to .../share/libgcj.zip

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hej");
    }
}

gcj -L/home/pelab/pub/pkg/libgcj-2.95.1/lib -R/home/pelab/pub/pkg/libgcj-2.95.1/lib --main=Hello -o Hello Hello.java

>Fix:
(I will try to compile without --enable-threads.)
>Release-Note:

>Audit-Trail:

Formerly PR libgcj/52


From: Tom Tromey <tromey@cygnus.com>
To: patha@ida.liu.se
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: libgcj/52: SIGSEGV in GC
Date: Fri, 24 Sep 1999 16:24:56 -0700

 On Solaris you have to use the latest GNU binutils in order to get
 Java programs to run.  You have to install the binutils, then rebuild
 gcc and finally rebuild libgcj.  Bummer, but that will definitely
 work.
 
 I'm going to close this PR.
 
 Tom
 
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Fri Sep 24 16:35:17 1999
State-Changed-Why:
    FYI, this isn't a crash in the GC.  That SEGV is "normal";
    the GC uses it to determine stack boundaries.  It is
    ordinarily caught and handled by the GC -- you can see
    this in the debugger by using "cont" to continue to the
    real segv.
    
        On Solaris you must use the GNU Binutils in order
        to get a working Java executable.  You have to first
        build the binutils, then the compiler, and finally
        the Java runtime for this to work.
        I'm closing this directly because it has been reported a few
        times already, and we definitely know this fix works.

From: Tom Tromey <tromey@cygnus.com>
To: Patrik Hagglund <patha@ida.liu.se>
Cc: Tom Tromey <tromey@cygnus.com>,
        Java Gnats Server <java-gnats@sourceware.cygnus.com>
Subject: Re: libgcj/52: SIGSEGV in GC 
Date: Mon, 27 Sep 1999 11:03:41 -0700

 Patrik> Before I reported the bug, I read the mailing list archive and,
 Patrik> used binutils-2.9.1 for gcc-2.95.1 (--with-as=... and
 Patrik> --with-ld=...). Is there an alpha version of binutils somewhere?
 
 http://sourceware.cygnus.com/binutils/
 
 I don't know whether 2.9.1 is ok or whether you need a newer version.
 If you find out, can you tell me?
 
 It's also possible you found a new bug.  Try using gdb, but "cont"
 after the false segv in the GC to see what is wrong.
 
 T

From: Tom Tromey <tromey@cygnus.com>
To: Patrik Hagglund <patha@ida.liu.se>
Cc: Tom Tromey <tromey@cygnus.com>,
        Java Gnats Server <java-gnats@sourceware.cygnus.com>
Subject: Re: libgcj/52: SIGSEGV in GC 
Date: Wed, 29 Sep 1999 16:48:15 -0700

 >>>>> "Patrik" == Patrik Hagglund <patha@ida.liu.se> writes:
 
 Patrik> Trying my HelloWorld program now gives the following error
 Patrik> message:
 
 Patrik> ./Hello                
 Patrik>   STACK_GROWS_DOWN is defd, but stack appears to grow up
 Patrik>   sp = 0xffbedf24, GC_stackbottom = 0x0
 Patrik>   stack direction 3
 Patrik>   zsh: IOT instruction (core dumped)  ./Hello
 
 I have never seen this before.
 I don't really know what is going on here, I'm afraid.
 You could try asking the list to see if anybody else has seen it.
 
 
 Patrik> (gdb) bt
 Patrik> #0  0x7f798184 in _libc_kill () from /usr/lib/libc.so.1
 Patrik> #1  0x7f739408 in abort () from /usr/lib/libc.so.1
 Patrik> #2  0x7f91ebec in GC_abort (msg=0x7f922fe8 "stack direction 3\n")
 Patrik>     at ../../../boehm-gc/misc.c:775
 Patrik> #3  0x7f91e7f4 in GC_init_inner () at ../../../boehm-gc/misc.c:484
 Patrik> #4  0x7f91b834 in GC_generic_malloc_inner (lb=2052, k=0)
 Patrik>     at ../../../boehm-gc/malloc.c:91
 Patrik> #5  0x7face8c4 in _Jv_InitGC () at ../../../libjava/boehm.cc:415
 Patrik> #6  0x7fab9ee4 in _Jv_RegisterClasses (classes=0xffbee0a8)
 Patrik>     at ../../../libjava/java/lang/natClassLoader.cc:385
 Patrik> #7  0x7fab9f90 in _Jv_RegisterClass (klass=0x2a3bc)
 Patrik>     at ../../../libjava/java/lang/natClassLoader.cc:410
 Patrik> #8  0x14a68 in global constructors keyed to Hello.Hello () at Hello.java:4
 Patrik> #9  0x193b4 in __do_global_ctors_aux () at include/new:39
 Patrik> #10 0x193ec in _init () at include/new:39
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:27 libgcj/1431: SIGSEGV in GC patha

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