Memory leak after C++ exception

Valery Pykhtin pykhtin at prosoft.ural.ru
Thu Oct 14 12:25:38 UTC 2004


Hi all,

I detected memory leak dealing with C++ exceptions. The sympthoms are
following:

1. start new task
2. do smth
3. throw
4. catch
5. task selfdeletes
6. Memory leak ! The chunk of memory allocated from
gcc-3.2.2\libstdc++-v3\libsupc++\eh_globals.cc, line 107 is not freed.

the code around that place
g = (__cxa_eh_globals *) __gthread_getspecific (globals_key);
if (! g)
{
if ((g = (__cxa_eh_globals *)
std::malloc (sizeof (__cxa_eh_globals))) == 0  // **** <===  that is !!! ***
|| __gthread_setspecific (globals_key, (void *) g) != 0)
std::terminate ();
g->caughtExceptions = 0;
g->uncaughtExceptions = 0;
}

My platform bsp is pc586, rtems ver is 4.6.0pre5. I can send the test I used 
to detect the leak.
What can I do now ?

Best regards,
Valery 





More information about the users mailing list