From owner-freebsd-hackers Tue Jul 29 19:09:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA29603 for hackers-outgoing; Tue, 29 Jul 1997 19:09:52 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA29595 for ; Tue, 29 Jul 1997 19:09:48 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id LAA16495; Wed, 30 Jul 1997 11:39:39 +0930 (CST) From: Michael Smith Message-Id: <199707300209.LAA16495@genesis.atrad.adelaide.edu.au> Subject: Re: Almost JDK 1.1.2 port! In-Reply-To: from "Alex.Boisvert" at "Jul 29, 97 06:58:44 pm" To: boia01@pollux.GEL.USherb.CA (Alex.Boisvert) Date: Wed, 30 Jul 1997 11:39:39 +0930 (CST) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Alex.Boisvert stands accused of saying: > > The java virtual machine (java_g) gets a segmentation fault when going > through the _GLOBAL_OFFSET_TABLE_ to execute a function in a dynamic > library (in this case, libawt_g.so). > > The libawt_g.so library is loaded via a dlopen() call. In gdb, I get the > following output after the library is loaded and the VM crashed: > ---- cut here ----- > > Program received signal SIGSEGV, Segmentation fault. > 0x0 in ?? () Ugh. You have almost certainly jumped through a null pointer. What does 'where' tell you? > (gdb) info sharedlibrary > From To Syms Read Shared Object Library > 0x0807a000 0x0808a000 Yes /usr/libexec/ld.so > 0x08091000 0x080ab000 Yes /usr/lib/libm.so.2.0 > 0x080aa000 0x081a5434 Yes /usr/X11R6/lib/libXm.so.1.2 > 0x081a5000 0x081e7000 Yes /usr/X11R6/lib/libXt.so.6.0 > 0x081e6000 0x081f0000 Yes /usr/X11R6/lib/libXext.so.6.1 > 0x081ef000 0x082851a0 Yes /usr/X11R6/lib/libX11.so.6.1 > 0x08285000 0x082ef710 Yes /usr/lib/libc.so.3.0 > 0x09403000 0x0946552c No > /home/alex/jdk/javasrc/build/lib/i386/green_threads/libawt_g.so > (gdb) > > ------ cut here ------ > > Notice the "No" for libawt_g.so in the column "Syms Read". What does > this mean??? It looks like something has failed during the setup of the shared library. > Have I forgotten to do something after dlopen()? Check its return value, maybe? > Regards, > Alex. > > PS: I am using dlsym() to get the address of the function. Are you checking the return value from dlsym? It sounds awfully like you've got NULL back from it and just jumped there... -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[