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/949: debugger seg fault in remote.c::store_register_using_P()


>Number:         949
>Category:       gdb
>Synopsis:       debugger seg fault in remote.c::store_register_using_P()
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 19 19:18:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jeff Prosa
>Release:        GNU gdb 5.3
>Organization:
>Environment:
SunOS 5.6 Generic_105182-17 i86pc i386
gcc version 2.95.2 19991024 (release)
i386-pc-solaris2.6
>Description:
The debugger seg faults during the 'n' command sometimes when the c++ instruction to be debugged involves an STL string.  It does not crash everytime.  If I set a breakpoint one past the offending statement, the debugger does not crash. It only occurs with the 'n' command.  The C++ line of code can be anything:  a declaration, an assignment, a function call (a string function like c_str() or a user defined function with a string being passed in), returning from a function whoese arguments contain one or more strings.
>How-To-Repeat:
(see desc)  Attached is gdb output of core
>Fix:
Maybe check in store_register_using_P() that reg is not NULL before running the sprintf() on line 3552 in remote.c
It could also be a gcc problem because this seg faulting was occuring in gdb version 4.17 as well.  But I would personally put checks to gaurd against gdb from crashing reguardless of what binary is being debugged.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="gdb_crash"
Content-Disposition: inline; filename="gdb_crash"

GNU gdb 5.3
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 "i386-pc-solaris2.6"...

warning: core file may not match specified executable file.
Core was generated by `/export/home/src/src/vmserver/vmserver vmserver.cfg 49001\
'.
Program terminated with signal 5, Trace/breakpoint trap.
#0  0x080da43c in store_register_using_P (regnum=135566528) at remote.c:3552
(gdb) where
#0  0x080da43c in store_register_using_P (regnum=135566528) at remote.c:3552
#1  0x080891c0 in get_number_or_range (pp=0x81494c0) at breakpoint.c:503
#2  0x08088d68 in generic_get_saved_register (raw_buffer=0x81494c0 "",
    optimized=0x804715c, addrp=0x804716c, frame=0x8096e49, regnum=16777216,
    lval=0xdfd07a9e) at blockframe.c:1537
#3  0x08088c92 in frame_saved_regs_register_unwind (frame=0x81494c0,
    cache=0x80f9140, regnum=135236939, optimizedp=0x184, lvalp=0x8140580,
    addrp=0x80f909f, realnump=0x804760c, bufferp=0x8087187) at blockframe.c:1473
#4  0x080873e4 in mi_parse_argv (args=0x816eb10 "127.0.0.1", parse=0x81494c0)
    at ./mi/mi-parse.c:129
#5  0x08087187 in _initialize_mi_main () at ./mi/mi-main.c:1552
#6  0x08086acc in mi_execute_async_cli_command (
    mi=0x3 <Address 0x3 out of bounds>,
    args=0x8047914 "\030z\004\b?z\004\bLz\004\b", from_tty=134510884)
    at ./mi/mi-main.c:1335
#7  0x0808656b in captured_mi_execute_command (uiout=0x3, data=0x8047a18)
    at ./mi/mi-main.c:1117


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