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

Srinath Avadhanula
Tue Sep 14 00:59:00 GMT 2010

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

I tried to reproduce this, but without any shared libraries. I do not
know if that would make a difference.

Let me know if there is some instrumentation I can add somewhere to
help you narrow this down.


More information about the Gdb mailing list