From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24837 invoked by alias); 12 Sep 2010 00:24:26 -0000 Received: (qmail 24827 invoked by uid 22791); 12 Sep 2010 00:24:24 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_05,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_BF,TW_CF,TW_XF,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 12 Sep 2010 00:24:19 +0000 Received: by iwn33 with SMTP id 33so5345213iwn.0 for ; Sat, 11 Sep 2010 17:24:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.182.201 with SMTP id cd9mr3518672ibb.21.1284251057784; Sat, 11 Sep 2010 17:24:17 -0700 (PDT) Received: by 10.231.159.209 with HTTP; Sat, 11 Sep 2010 17:24:17 -0700 (PDT) Date: Sun, 12 Sep 2010 00:24:00 -0000 Message-ID: Subject: double free when trying to call a C++ function in GDB From: Srinath Avadhanula To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00073.txt.bz2 Hi, I tried to call a C++ function and this crashed GDB (stack below for GDB 7.2). What I tried to do was the following: (gdb) call CG::printCfgGraph(cfg, "/tmp/foo.dot") Here, the variable cfg was locally of type CG_Cfg, while CG::printCfgGraph accepts CG::Cfg as its first argument. CG_Cfg is a parent class of CG::Cfg. So it looks like GDB is trying to throw an error about not being able to find an overloaded method of that signature (although this seems to work for GDB 6.8). The same stack happens with GDB 7.2.20100906. Regards, Srinath #0 0x00007f8b5517ced5 in raise () from /lib/libc.so.6 #1 0x00007f8b5517e3f3 in abort () from /lib/libc.so.6 #2 0x00007f8b551b9388 in ?? () from /lib/libc.so.6 #3 0x00007f8b551be928 in ?? () from /lib/libc.so.6 #4 0x00007f8b551c0a36 in free () from /lib/libc.so.6 #5 0x0000000000413366 in do_my_cleanups (pmy_chain=0xa3b998, old_chain=0x0) at utils.c:441 #6 0x000000000050f521 in throw_exception (exception={reason = RETURN_ERROR, error = GENERIC_ERROR, message = 0xfc83900 "Cannot resolve function printCfgGraph to any overloaded instance"}) at exceptions.c:232 #7 0x000000000050f5f4 in throw_it (reason=RETURN_ERROR, error=GENERIC_ERROR, fmt=, ap=) at exceptions.c:400 #8 0x000000000050f6c6 in throw_verror (error=, fmt=, ap=0xffffffffffffffff) at exceptions.c:406 #9 0x0000000000417083 in error (string=) at utils.c:966 #10 0x00000000004d6edf in find_overload_match (arg_types=0x7fff448e5290, nargs=, name=0x0, method=, lax=, objp=0x0, fsym=0x10a7a000, valp=0x0, symp=0x7fff448e5520, staticp=0x0, no_adl=1) at valops.c:2567 #11 0x00000000004d00b4 in evaluate_subexp_standard (expect_type=, exp=0xfc83780, pos=0x7fff448e56d4, noside=EVAL_NORMAL) at eval.c:1723 #12 0x0000000000575b83 in evaluate_subexp_c (expect_type=0x31ad, exp=0xfc83780, pos=0x7fff448e56d4, noside=EVAL_NORMAL) at c-lang.c:1047 #13 0x00000000004cbf32 in evaluate_expression (exp=) at eval.c:76 #14 0x00000000004e2330 in print_command_1 (exp=0xca1215 "CG::printCfgGraph(cfg, \"/tmp/foo.dot\")", inspect=0, voidprint=0) at ./printcmd.c:969 #15 0x000000000041250f in execute_command (p=0xca123a ")", from_tty=1) at top.c:422 #16 0x0000000000515d74 in command_handler (command=0xca1210 "call CG::printCfgGraph(cfg, \"/tmp/foo.dot\")") at event-top.c:498 #17 0x00000000005168fc in command_line_handler (rl=) at event-top.c:702 #18 0x00000000005df529 in rl_callback_read_char () at callback.c:205 #19 0x0000000000515dd9 in rl_callback_read_char_wrapper (client_data=0x31ad) at event-top.c:178 #20 0x00000000005147f8 in process_event () at event-loop.c:399 #21 0x000000000051577c in gdb_do_one_event (data=) at event-loop.c:452 #22 0x000000000050f90b in catch_errors (func=0x515690 , func_args=0x0, errstring=0x697b42 "", mask=) at exceptions.c:518 #23 0x000000000048c8a0 in tui_command_loop (data=) at ./tui/tui-interp.c:171 #24 0x0000000000409df9 in captured_command_loop (data=0x31ad) at ./main.c:227 #25 0x000000000050f90b in catch_errors (func=0x409df0 , func_args=0x0, errstring=0x697b42 "", mask=) at exceptions.c:518 #26 0x0000000000409c0e in captured_main (data=) at ./main.c:910 #27 0x000000000050f90b in catch_errors (func=0x408ee0 , func_args=0x7fff448e5b20, errstring=0x697b42 "", mask=) at exceptions.c:518 #28 0x0000000000408cd4 in gdb_main (args=) at ./main.c:919 #29 0x0000000000408ca6 in main (argc=, argv=0x31ad) at gdb.c:34