From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2640 invoked by alias); 12 Sep 2010 15:32:27 -0000 Received: (qmail 2629 invoked by uid 22791); 12 Sep 2010 15:32:26 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 15:32:19 +0000 Received: by iwn33 with SMTP id 33so6069675iwn.0 for ; Sun, 12 Sep 2010 08:32:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.85.206 with SMTP id p14mr4577880ibl.89.1284305537397; Sun, 12 Sep 2010 08:32:17 -0700 (PDT) Received: by 10.231.159.209 with HTTP; Sun, 12 Sep 2010 08:32:17 -0700 (PDT) In-Reply-To: References: Date: Sun, 12 Sep 2010 15:32:00 -0000 Message-ID: Subject: Re: 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/msg00076.txt.bz2 Hi, On Sat, Sep 11, 2010 at 8:24 PM, Srinath Avadhanula wrote: > > I tried to call a C++ function and this crashed GDB (stack below for GDB 7.2). > Just to get more information, I ran gdb-7.2 through valgrind and got the following information: (gdb) call CG::printCfgGraph(cfg, "/tmp/foo.dot") ==27266== ==27266== Invalid free() / delete / delete[] ==27266== at 0x4C20B2E: free (vg_replace_malloc.c:323) ==27266== by 0x457795: do_my_cleanups (utils.c:459) ==27266== by 0x5563F0: throw_exception (exceptions.c:232) ==27266== by 0x5564C3: throw_it (exceptions.c:400) ==27266== by 0x556595: throw_verror (exceptions.c:406) ==27266== by 0x45B4D2: error (utils.c:984) ==27266== by 0x51D5CE: find_overload_match (valops.c:2565) ==27266== by 0x516763: evaluate_subexp_standard (eval.c:1733) ==27266== by 0x5C1B12: evaluate_subexp_c (c-lang.c:1047) ==27266== by 0x5125A1: evaluate_expression (eval.c:76) ==27266== by 0x528B9F: print_command_1 (printcmd.c:969) ==27266== by 0x45693E: execute_command (top.c:422) ==27266== Address 0x1936e920 is 0 bytes inside a block of size 808 free'd ==27266== at 0x4C20B2E: free (vg_replace_malloc.c:323) ==27266== by 0x457795: do_my_cleanups (utils.c:459) ==27266== by 0x5563F0: throw_exception (exceptions.c:232) ==27266== by 0x5564C3: throw_it (exceptions.c:400) ==27266== by 0x556595: throw_verror (exceptions.c:406) ==27266== by 0x45B4D2: error (utils.c:984) ==27266== by 0x51D5CE: find_overload_match (valops.c:2565) ==27266== by 0x516763: evaluate_subexp_standard (eval.c:1733) ==27266== by 0x5C1B12: evaluate_subexp_c (c-lang.c:1047) ==27266== by 0x5125A1: evaluate_expression (eval.c:76) ==27266== by 0x528B9F: print_command_1 (printcmd.c:969) ==27266== by 0x45693E: execute_command (top.c:422) Hopefully, this helps someone debug this faster. Regards, Srinath