From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27388 invoked by alias); 24 Sep 2009 03:16:48 -0000 Received: (qmail 27379 invoked by uid 22791); 24 Sep 2009 03:16:46 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12,SARE_MSGID_LONG40,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from mail-px0-f202.google.com (HELO mail-px0-f202.google.com) (209.85.216.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Sep 2009 03:16:42 +0000 Received: by pxi40 with SMTP id 40so1161994pxi.24 for ; Wed, 23 Sep 2009 20:16:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.152.40 with SMTP id z40mr226564wfd.40.1253762200542; Wed, 23 Sep 2009 20:16:40 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Thu, 24 Sep 2009 03:16:00 -0000 Message-ID: Subject: Re: Record segfault To: Joel Brobecker Cc: 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/msg00739.txt.bz2 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 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_inse= rt_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 =C2=A0* record.c (record_open): Change "query" to "e= rror". > =C2=A0 =C2=A0 =C2=A0 =C2=A0(cmd_record_stop): Change "query" to "printf_u= nfiltered". > > --- > =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=A0 if (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=A0Use= \"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=A0 record_beneath_to_resume =3D NULL; > @@ -1157,9 +1153,9 @@ cmd_record_stop (char *args, int from_tt > =C2=A0{ > =C2=A0 if (current_target.to_stratum =3D=3D record_stratum) > =C2=A0 =C2=A0 { > - =C2=A0 =C2=A0 =C2=A0if (!record_list || !from_tty || query (_("Delete r= ecorded 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 and = 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=A0 else > =C2=A0 =C2=A0 printf_unfiltered (_("Process record is not started.\n")); > > > On Fri, Sep 11, 2009 at 22:24, Marc Khouzam w= rote: >> 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 c= opying" >> 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 rec= ord 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:1229 >> #3 =C2=A00x0808e585 in make_my_cleanup2 (pmy_chain=3D0x84003e0, function= =3D0x808e50b , arg=3D0x8d0cf50, free_arg=3D0x808f63b ) >> =C2=A0 =C2=A0at ../../src/gdb/utils.c:349 >> #4 =C2=A00x0808e571 in make_cleanup_restore_integer (variable=3D0x841319= 0) 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 >> >> >