From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28879 invoked by alias); 27 Sep 2009 02:50:50 -0000 Received: (qmail 28869 invoked by uid 22791); 27 Sep 2009 02:50:48 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from mail-pz0-f192.google.com (HELO mail-pz0-f192.google.com) (209.85.222.192) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Sep 2009 02:50:44 +0000 Received: by pzk30 with SMTP id 30so1475124pzk.24 for ; Sat, 26 Sep 2009 19:50:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.3.13 with SMTP id 13mr114738wfc.302.1254019843091; Sat, 26 Sep 2009 19:50:43 -0700 (PDT) In-Reply-To: <4ABE96C8.6070702@vmware.com> References: <4ABE96C8.6070702@vmware.com> From: Hui Zhu Date: Sun, 27 Sep 2009 02:50:00 -0000 Message-ID: Subject: Re: Record segfault To: Michael Snyder Cc: Joel Brobecker , gdb-patches ml , Marc Khouzam Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00843.txt.bz2 Thanks Michael, Checked in to cvs-head. Hui On Sun, Sep 27, 2009 at 06:33, Michael Snyder wrote: > This seems fine to me. =C2=A0Please 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. =C2=A0Ping >> http://sourceware.org/ml/gdb-patches/2009-09/msg00357.html >> >> Thanks, >> Hui >> >> On Sat, Sep 12, 2009 at 10:39, Hui Zhu 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. =C2= =A0I >>> post it again, wish you like it. >>> >>> Thanks, >>> Hui >>> >>> 2009-09-12 =C2=A0Hui Zhu =C2=A0 >>> >>> =C2=A0 =C2=A0 =C2=A0 * record.c (record_open): Change "query" to "error= ". >>> =C2=A0 =C2=A0 =C2=A0 (cmd_record_stop): Change "query" to "printf_unfil= tered". >>> >>> --- >>> =C2=A0record.c | =C2=A0 14 +++++--------- >>> =C2=A01 file changed, 5 insertions(+), 9 deletions(-) >>> >>> --- a/record.c >>> +++ b/record.c >>> @@ -436,12 +436,8 @@ record_open (char *name, int from_tty) >>> >>> =C2=A0/* Check if record target is already running. =C2=A0*/ >>> =C2=A0if (current_target.to_stratum =3D=3D record_stratum) >>> - =C2=A0 =C2=A0{ >>> - =C2=A0 =C2=A0 =C2=A0if (!nquery >>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (_("Process record target already running= , do you want to >>> delete " >>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"the old record log?"))) >>> - =C2=A0 =C2=A0 =C2=A0 return; >>> - =C2=A0 =C2=A0} >>> + =C2=A0 =C2=A0error (_("Process record target already running. =C2=A0U= se \"record >>> stop\" to " >>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"stop record target first.")= ); >>> >>> =C2=A0/*Reset the beneath function pointers. =C2=A0*/ >>> =C2=A0record_beneath_to_resume =3D NULL; >>> @@ -1157,9 +1153,9 @@ cmd_record_stop (char *args, int from_tt >>> =C2=A0{ >>> =C2=A0if (current_target.to_stratum =3D=3D record_stratum) >>> =C2=A0 =C2=A0{ >>> - =C2=A0 =C2=A0 =C2=A0if (!record_list || !from_tty || query (_("Delete= recorded log and >>> " >>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "stop recording?"))) >>> - =C2=A0 =C2=A0 =C2=A0 unpush_target (&record_ops); >>> + =C2=A0 =C2=A0 =C2=A0unpush_target (&record_ops); >>> + =C2=A0 =C2=A0 =C2=A0printf_unfiltered (_("Process record is stoped an= d all execution " >>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 "log is deleted.\n")); >>> =C2=A0 =C2=A0} >>> =C2=A0else >>> =C2=A0 =C2=A0printf_unfiltered (_("Process record is not started.\n")); >>> >>> >>> On Fri, Sep 11, 2009 at 22:24, Marc Khouzam >>> wrote: >>>> >>>> Hi Hui, >>>> >>>> I see a Segmentation fault when enabling Record when it is already on. >>>> >>>> =EF=BB=BFGNU gdb (GDB) 6.8.50.20090910-cvs >>>> Copyright (C) 2009 Free Software Foundation, Inc. >>>> License GPLv3+: GNU GPL version 3 or later >>>> >>>> This is free software: you are free to change and redistribute it. >>>> There is NO WARRANTY, to the extent permitted by law. =C2=A0Type "show >>>> copying" >>>> and "show warranty" for details. >>>> This GDB was configured as "i686-pc-linux-gnu". >>>> For bug reporting instructions, please see: >>>> ... >>>> Reading symbols from /local/lmckhou/testing/a.out...done. >>>> (gdb) l >>>> 1 =C2=A0 =C2=A0 =C2=A0 int main() >>>> 2 =C2=A0 =C2=A0 =C2=A0 { >>>> 3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int a =3D 0; >>>> 4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int b =3D 1; >>>> 5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0; >>>> 6 =C2=A0 =C2=A0 =C2=A0 } >>>> (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 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int a =3D 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: >>>> =EF=BB=BF(gdb) bt >>>> #0 =C2=A00xb7d2e449 in _int_malloc () from /lib/libc.so.6 >>>> #1 =C2=A00xb7d2fce6 in malloc () from /lib/libc.so.6 >>>> #2 =C2=A00x0808f564 in xmalloc (size=3D16) at ../../src/gdb/utils.c:12= 29 >>>> #3 =C2=A00x0808e585 in make_my_cleanup2 (pmy_chain=3D0x84003e0, >>>> function=3D0x808e50b , arg=3D0x8d0cf50, free_arg=3D0x= 808f63b >>>> ) >>>> =C2=A0 at ../../src/gdb/utils.c:349 >>>> #4 =C2=A00x0808e571 in make_cleanup_restore_integer (variable=3D0x8413= 190) at >>>> ../../src/gdb/utils.c:340 >>>> #5 =C2=A00x0822724e in record_gdb_operation_disable_set () at >>>> ../../src/gdb/record.c:414 >>>> #6 =C2=A00x082283aa in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1081 >>>> #7 =C2=A00x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> #8 =C2=A00x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> #9 =C2=A00x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> #10 0x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> #11 0x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> #12 0x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> #13 0x082283c2 in record_insert_breakpoint (gdbarch=3D0x848c7d8, >>>> bp_tgt=3D0x84e2aa4) at ../../src/gdb/record.c:1082 >>>> ... >>>> >>>> This continues over and over and over .... >>>> >>>> Thanks >>>> >>>> > >