This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/1971: doing a 'next' from start of __libc_main causes segfault


>Number:         1971
>Category:       gdb
>Synopsis:       doing a 'next' from start of __libc_main causes segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 16 12:18:00 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     gnu@greglaw.net
>Release:        6.3
>Organization:
>Environment:
Seen on Debian (Woody) and gentoo Linux
>Description:
Load any C program into the debugger.  Set a breakpoint at __libc_start_main.  Start the pogram.  When the breakpoint is hit, type 'next'.  This results in a segfault.



>How-To-Repeat:
I've attached a complete copy/paste of a shell session that shows in entirity how to reproduce this (on my system, at least!)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="gdb_bug.txt"
Content-Disposition: inline; filename="gdb_bug.txt"

bash-2.05b$ echo -e "#include <stdio.h>\nint main (void) {printf (\"Hello
world\"); return 0;}" > test.c
bash-2.05b$ gcc -g test.c
bash-2.05b$ gdb a.out
GNU gdb 6.3
Copyright 2004 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 "i686-pc-linux-gnu"...Using host libthread_db library
"/lib/tls/libthread_db.so.1".

(gdb) break __libc_start_main
Function "__libc_start_main" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (__libc_start_main) pending.
(gdb) start
Breakpoint 2 at 0x8048394: file test.c, line 2.
Starting program: /home/gel/tests/a.out
Breakpoint 3 at 0xb7ed90c6
Pending breakpoint "__libc_start_main" resolved

Breakpoint 3, 0xb7ed90c6 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) next
Single stepping until exit from function __libc_start_main,
which has no line number information.
Segmentation fault (core dumped)
bash-2.05b$ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]