From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7966 invoked by alias); 13 Dec 2002 00:36:29 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7939 invoked from network); 13 Dec 2002 00:36:24 -0000 Received: from unknown (HELO localhost.localdomain) (62.179.175.88) by sources.redhat.com with SMTP; 13 Dec 2002 00:36:24 -0000 Received: from localhost (localhost [127.0.0.1]) by localhost.localdomain (8.12.5/8.12.5) with ESMTP id gBD0aDf4008685; Fri, 13 Dec 2002 01:36:13 +0100 Subject: Re: Strange segfaults of gdb From: Terje Eggestad To: Michal Ludvig , Eli Zaretskii , Michael Snyder Cc: gdb@sources.redhat.com Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 12 Dec 2002 16:36:00 -0000 Message-Id: <1039739774.8645.18.camel@eggis1> Mime-Version: 1.0 X-SW-Source: 2002-12/txt/msg00194.txt.bz2 Hi Back in April you guys had a short discussion on strange segfaults in gdb: http://sources.redhat.com/ml/gdb/2002-04/msg00168.html It seems that I can reliably reproduce it when you link with pthread. See below. It seem that it segfaults on the first or second instruction *byte*, NOT the next instruction... (according to info registers, just before and after attempted single step.) Anyone know whom to report this to? Running SuSE 8.0.99 beta with the latest gcc,gdb,glibc updates. Terje te mjollnir testdl 134> cat main.c main() { int i; i = 2; i += 4; i *= 3; exit(i); }; te mjollnir testdl 135> gcc -v Reading specs from /usr/lib64/gcc-lib/x86_64-suse-linux/3.2.1/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit x86_64-suse-linux Thread model: posix gcc version 3.2.1 20021002 (prerelease) (SuSE Linux) te mjollnir testdl 136> gcc -g -o main main.c te mjollnir testdl 137> gdb main GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-suse-linux"... (gdb) break main Breakpoint 1 at 0x400460: file main.c, line 5. (gdb) run Starting program: /home/te/test/testdl/main Breakpoint 1, main () at main.c:5 5 i = 2; (gdb) n 6 i += 4; (gdb) 7 i *= 3; (gdb) 8 exit(i); (gdb) Program exited with code 022. (gdb) q te mjollnir testdl 138> gcc -g -o main main.c -lpthread te mjollnir testdl 139> gdb -q main (gdb) break main Breakpoint 1 at 0x4004a0: file main.c, line 5. (gdb) run Starting program: /home/te/test/testdl/main [New Thread 1024 (LWP 6458)] [Switching to Thread 1024 (LWP 6458)] Breakpoint 1, 0x004004a1 in main () at main.c:5 5 i = 2; (gdb) n Program received signal SIGSEGV, Segmentation fault. 0x004004a3 in main () at main.c:5 5 i = 2; (gdb) q The program is running. Exit anyway? (y or n) y te mjollnir testdl 140> -- _________________________________________________________________________ Terje Eggestad mailto:terje.eggestad@scali.no Scali Scalable Linux Systems http://www.scali.com Olaf Helsets Vei 6 tel: +47 22 62 89 61 (OFFICE) P.O.Box 150, Oppsal +47 975 31 574 (MOBILE) N-0619 Oslo fax: +47 22 62 89 51 NORWAY _________________________________________________________________________