double free when trying to call a C++ function in GDB

sami wagiaalla swagiaal@redhat.com
Thu Sep 16 17:01:00 GMT 2010


On 09/13/2010 08:58 PM, Srinath Avadhanula wrote:
> Hi Sami,
>
>> provide me with a small reproducer that would be very helpful.
>
> Unfortunately, I am unable to come up with a small reproduction
> program which fails. Let me try to describe the situation we have:
>
> 1. We have a large number of shared libraries which get loaded
> 2. One of the libraries has an overloaded function with two signatures:
>              void printCfgGraph(CG::Cfg* cfg, const char* fname);
>              void printCfgGraph(CG::Region* region, const char* fname);
> 3. CG::Cfg and CG::Region are completely unrelated by inheritance etc.
> 4. We make a call in GDB to:
>              (gdb) call printCfgGraph(mycfg, fname)
>       where mycfg is of type CG_Cfg which is a super-class of CG::Cfg.
> This crashed GDB
>

That did it :). I reproduced it using your description exactly. Filed a 
bug here: http://sourceware.org/bugzilla/show_bug.cgi?id=12028

I should have a fix for ya soon!

Thanks,
   Sami



More information about the Gdb mailing list