From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4699 invoked by alias); 12 Sep 2009 02:39:38 -0000 Received: (qmail 4689 invoked by uid 22791); 12 Sep 2009 02:39:37 -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-f180.google.com (HELO mail-px0-f180.google.com) (209.85.216.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Sep 2009 02:39:31 +0000 Received: by pxi10 with SMTP id 10so1356042pxi.24 for ; Fri, 11 Sep 2009 19:39:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.209.20 with SMTP id h20mr328219wfg.167.1252723170099; Fri, 11 Sep 2009 19:39:30 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Sat, 12 Sep 2009 02:39:00 -0000 Message-ID: Subject: Re: Record segfault To: Marc Khouzam Cc: gdb-patches ml Content-Type: multipart/mixed; boundary=000e0cd32e2e8e411a04735857c4 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/msg00357.txt.bz2 --000e0cd32e2e8e411a04735857c4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 4776 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 * 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 =3D=3D 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 =3D NULL; @@ -1157,9 +1153,9 @@ cmd_record_stop (char *args, int from_tt { if (current_target.to_stratum =3D=3D 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 wro= te: > 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 co= pying" > 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 reco= rd 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=3D0x8413190= ) at ../../src/gdb/utils.c:340 > #5 =C2=A00x0822724e in record_gdb_operation_disable_set () at ../../src/g= db/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 > > --000e0cd32e2e8e411a04735857c4 Content-Type: text/plain; charset=US-ASCII; name="prec_remove_query.txt" Content-Disposition: attachment; filename="prec_remove_query.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fzhqytk70 Content-length: 1582 LS0tCiByZWNvcmQuYyB8ICAgMTQgKysrKystLS0tLS0tLS0KIDEgZmlsZSBj aGFuZ2VkLCA1IGluc2VydGlvbnMoKyksIDkgZGVsZXRpb25zKC0pCgotLS0g YS9yZWNvcmQuYworKysgYi9yZWNvcmQuYwpAQCAtNDM2LDEyICs0MzYsOCBA QCByZWNvcmRfb3BlbiAoY2hhciAqbmFtZSwgaW50IGZyb21fdHR5KQogCiAg IC8qIENoZWNrIGlmIHJlY29yZCB0YXJnZXQgaXMgYWxyZWFkeSBydW5uaW5n LiAgKi8KICAgaWYgKGN1cnJlbnRfdGFyZ2V0LnRvX3N0cmF0dW0gPT0gcmVj b3JkX3N0cmF0dW0pCi0gICAgewotICAgICAgaWYgKCFucXVlcnkKLQkgIChf KCJQcm9jZXNzIHJlY29yZCB0YXJnZXQgYWxyZWFkeSBydW5uaW5nLCBkbyB5 b3Ugd2FudCB0byBkZWxldGUgIgotCSAgICAgInRoZSBvbGQgcmVjb3JkIGxv Zz8iKSkpCi0JcmV0dXJuOwotICAgIH0KKyAgICBlcnJvciAoXygiUHJvY2Vz cyByZWNvcmQgdGFyZ2V0IGFscmVhZHkgcnVubmluZy4gIFVzZSBcInJlY29y ZCBzdG9wXCIgdG8gIgorCSAgICAgInN0b3AgcmVjb3JkIHRhcmdldCBmaXJz dC4iKSk7CiAKICAgLypSZXNldCB0aGUgYmVuZWF0aCBmdW5jdGlvbiBwb2lu dGVycy4gICovCiAgIHJlY29yZF9iZW5lYXRoX3RvX3Jlc3VtZSA9IE5VTEw7 CkBAIC0xMTU3LDkgKzExNTMsOSBAQCBjbWRfcmVjb3JkX3N0b3AgKGNoYXIg KmFyZ3MsIGludCBmcm9tX3R0CiB7CiAgIGlmIChjdXJyZW50X3RhcmdldC50 b19zdHJhdHVtID09IHJlY29yZF9zdHJhdHVtKQogICAgIHsKLSAgICAgIGlm ICghcmVjb3JkX2xpc3QgfHwgIWZyb21fdHR5IHx8IHF1ZXJ5IChfKCJEZWxl dGUgcmVjb3JkZWQgbG9nIGFuZCAiCi0JICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICJzdG9wIHJlY29yZGluZz8iKSkpCi0JdW5w dXNoX3RhcmdldCAoJnJlY29yZF9vcHMpOworICAgICAgdW5wdXNoX3Rhcmdl dCAoJnJlY29yZF9vcHMpOworICAgICAgcHJpbnRmX3VuZmlsdGVyZWQgKF8o IlByb2Nlc3MgcmVjb3JkIGlzIHN0b3BlZCBhbmQgYWxsIGV4ZWN1dGlvbiAi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAibG9nIGlzIGRlbGV0ZWQu XG4iKSk7CiAgICAgfQogICBlbHNlCiAgICAgcHJpbnRmX3VuZmlsdGVyZWQg KF8oIlByb2Nlc3MgcmVjb3JkIGlzIG5vdCBzdGFydGVkLlxuIikpOwo= --000e0cd32e2e8e411a04735857c4--