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/808: --exec and --core combination break backtraces


>Number:         808
>Category:       gdb
>Synopsis:       --exec and --core combination break backtraces
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 30 11:18:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Derek Douville
>Release:        GNU gdb Red Hat Linux (5.2-2)
>Organization:
>Environment:
Redhat Linux, Kernel 2.4.18-11, glibc-2.2.4-29.  Binaries producing backtraces are not stripped.
>Description:
# gdb --exec ../bin/binary --core core.1234 --command /tmp/commandfile --batch 

(/tmp/commandfile contains "bt")

This will produce a backtrace that misses frames:
Program terminated with signal 11, Segmentation fault.
#0  0x00913017 in foo_bar (iparam=0x845544c) at source_code.c:144
144     source_code.c: No such file or directory.
        in source_code.c
#0  0x00913017 in foo_bar (iparam=0x845544c) at source_code.c:144
#1  0x08052517 in ?? ()
#2  0x080523d5 in ?? ()
#3  0x0051f15b in __do_request (pg=0x619128, index=8) at pg2.c:85
#4  0x0051f32a in __doit (pg_arg=0x81bc978) at pg2.c:128
#5  0x00347f87 in pthread_start_thread (arg=0xbe3ffc00) at manager.c:284

The same result is produced if gdb is run in interactive mode with these options:
# gdb --exec ../bin/binary --core core.1234
[Reading/Loaded symbols output here]
(gdb) bt
#0  0x00913017 in foo_bar (iparam=0x845544c) at source_code.c:144
144     source_code.c: No such file or directory.
        in source_code.c
#0  0x00913017 in foo_bar (iparam=0x845544c) at source_code.c:144
#1  0x08052517 in ?? ()
#2  0x080523d5 in ?? ()
#3  0x0051f15b in __do_request (pg=0x619128, index=8) at pg2.c:85
#4  0x0051f32a in __doit (pg_arg=0x81bc978) at pg2.c:128
#5  0x00347f87 in pthread_start_thread (arg=0xbe3ffc00) at manager.c:284

However,  in both test cases if I simply specify binary and corefile (in that order),  and run either interactively or in --batch --command mode,  I get proper backtraces:

# gdb ../../../bin/ml core.23897 --batch --command /tmp/commandfile
Program terminated with signal 11, Segmentation fault.
#0  0x00913017 in foo_bar (iparam=0x845544c) at source_code.c:144
144     source_code.c: No such file or directory.
        in source_code.c
#0  0x00913017 in foo_bar (iparam=0x845544c) at source_code.c:144
#1  0x08052517 in __my_launch (module=0x81085e8, ms=0x84553cc) at my_mtops.c:125
#2  0x080523d5 in my_mtlaunch (args=0x84553cc) at my_mtops.c:90
#3  0x0051f15b in __do_request (pg=0x619128, index=8) at pg2.c:85
#4  0x0051f32a in __doit (pg_arg=0x81bc978) at pg2.c:128
#5  0x00347f87 in pthread_start_thread (arg=0xbe3ffc00) at manager.c:284
>How-To-Repeat:
100% reproducable as shown in description,  against any of our cores.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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