This is the mail archive of the gdb-patches@sourceware.org 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]

Re: Record segfault


Thanks Michael, Checked in to cvs-head.

Hui

On Sun, Sep 27, 2009 at 06:33, Michael Snyder <msnyder@vmware.com> wrote:
> This seems fine to me. ÂPlease check it into the main branch,
> but don't add it to the release branch unless Joel says it's OK.
>
> Michael
>
> Hui Zhu wrote:
>>
>> Hi Joel,
>>
>> Sorry to disturb you. ÂPing
>> http://sourceware.org/ml/gdb-patches/2009-09/msg00357.html
>>
>> Thanks,
>> Hui
>>
>> On Sat, Sep 12, 2009 at 10:39, Hui Zhu <teawater@gmail.com> wrote:
>>>
>>> Thanks Mark.
>>>
>>> This reason of this issue is because we want close the old record
>>> target with record_close that will be called by "push_target
>>> (&record_ops);"
>>> This line is after "Set the beneath function pointers."
>>>
>>> So it make "record_beneath_to_insert_breakpoint" point to the
>>> record_insert_xxx.
>>>
>>> In 2 months before, I post a patch that change this query to error. ÂI
>>> post it again, wish you like it.
>>>
>>> Thanks,
>>> Hui
>>>
>>> 2009-09-12 ÂHui Zhu Â<teawater@gmail.com>
>>>
>>> Â Â Â * record.c (record_open): Change "query" to "error".
>>> Â Â Â (cmd_record_stop): Change "query" to "printf_unfiltered".
>>>
>>> ---
>>> Ârecord.c | Â 14 +++++---------
>>> Â1 file changed, 5 insertions(+), 9 deletions(-)
>>>
>>> --- a/record.c
>>> +++ b/record.c
>>> @@ -436,12 +436,8 @@ record_open (char *name, int from_tty)
>>>
>>> Â/* Check if record target is already running. Â*/
>>> Âif (current_target.to_stratum == record_stratum)
>>> - Â Â{
>>> - Â Â Âif (!nquery
>>> - Â Â Â Â (_("Process record target already running, do you want to
>>> delete "
>>> - Â Â Â Â Â Â"the old record log?")))
>>> - Â Â Â return;
>>> - Â Â}
>>> + Â Âerror (_("Process record target already running. ÂUse \"record
>>> stop\" to "
>>> + Â Â Â Â Â Â"stop record target first."));
>>>
>>> Â/*Reset the beneath function pointers. Â*/
>>> Ârecord_beneath_to_resume = NULL;
>>> @@ -1157,9 +1153,9 @@ cmd_record_stop (char *args, int from_tt
>>> Â{
>>> Âif (current_target.to_stratum == record_stratum)
>>> Â Â{
>>> - Â Â Âif (!record_list || !from_tty || query (_("Delete recorded log and
>>> "
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "stop recording?")))
>>> - Â Â Â unpush_target (&record_ops);
>>> + Â Â Âunpush_target (&record_ops);
>>> + Â Â Âprintf_unfiltered (_("Process record is stoped and all execution "
>>> + Â Â Â Â Â Â Â Â Â Â Â Â Â "log is deleted.\n"));
>>> Â Â}
>>> Âelse
>>> Â Âprintf_unfiltered (_("Process record is not started.\n"));
>>>
>>>
>>> On Fri, Sep 11, 2009 at 22:24, Marc Khouzam <marc.khouzam@ericsson.com>
>>> wrote:
>>>>
>>>> Hi Hui,
>>>>
>>>> I see a Segmentation fault when enabling Record when it is already on.
>>>>
>>>> ïGNU gdb (GDB) 6.8.50.20090910-cvs
>>>> Copyright (C) 2009 Free Software Foundation, Inc.
>>>> License GPLv3+: GNU GPL version 3 or later
>>>> <http://gnu.org/licenses/gpl.html>
>>>> This is free software: you are free to change and redistribute it.
>>>> There is NO WARRANTY, to the extent permitted by law. ÂType "show
>>>> copying"
>>>> and "show warranty" for details.
>>>> This GDB was configured as "i686-pc-linux-gnu".
>>>> For bug reporting instructions, please see:
>>>> <http://www.gnu.org/software/gdb/bugs/>...
>>>> Reading symbols from /local/lmckhou/testing/a.out...done.
>>>> (gdb) l
>>>> 1 Â Â Â int main()
>>>> 2 Â Â Â {
>>>> 3 Â Â Â Â int a = 0;
>>>> 4 Â Â Â Â int b = 1;
>>>> 5 Â Â Â Â return 0;
>>>> 6 Â Â Â }
>>>> (gdb) start
>>>> Temporary breakpoint 1 at 0x8048415: file a.cc, line 3.
>>>> Starting program: /local/lmckhou/testing/a.out
>>>>
>>>> Temporary breakpoint 1, main () at a.cc:3
>>>> 3 Â Â Â Â int a = 0;
>>>> (gdb) record
>>>> (gdb) record
>>>> Process record target already running, do you want to delete the old
>>>> record log?(y or [n]) y
>>>> (gdb) n
>>>> Segmentation fault
>>>>
>>>> Here is the backtrace:
>>>> ï(gdb) bt
>>>> #0 Â0xb7d2e449 in _int_malloc () from /lib/libc.so.6
>>>> #1 Â0xb7d2fce6 in malloc () from /lib/libc.so.6
>>>> #2 Â0x0808f564 in xmalloc (size=16) at ../../src/gdb/utils.c:1229
>>>> #3 Â0x0808e585 in make_my_cleanup2 (pmy_chain=0x84003e0,
>>>> function=0x808e50b <restore_integer>, arg=0x8d0cf50, free_arg=0x808f63b
>>>> <xfree>)
>>>> Â at ../../src/gdb/utils.c:349
>>>> #4 Â0x0808e571 in make_cleanup_restore_integer (variable=0x8413190) at
>>>> ../../src/gdb/utils.c:340
>>>> #5 Â0x0822724e in record_gdb_operation_disable_set () at
>>>> ../../src/gdb/record.c:414
>>>> #6 Â0x082283aa in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1081
>>>> #7 Â0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> #8 Â0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> #9 Â0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> #10 0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> #11 0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> #12 0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> #13 0x082283c2 in record_insert_breakpoint (gdbarch=0x848c7d8,
>>>> bp_tgt=0x84e2aa4) at ../../src/gdb/record.c:1082
>>>> ...
>>>>
>>>> This continues over and over and over ....
>>>>
>>>> Thanks
>>>>
>>>>
>
>


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