Actually this is not malloc / free that throws an exception, it is a βnewβ one that is definitely located in the C ++ part of your application. It looks like you are providing a parameter that is too large for the βnewβ to host.
'std :: bad_alloc' is called by the following code, for example:
int * p = new int[50000000];
What does backtrace say when you load a crash reset in gdb? If you cannot create a dump, you can ask GDB to stop when an exception is thrown or caught . Unfortunately, some versions of GDB only support the following syntax:
catch throw
which allows you to break the application when any exception is thrown. However, in the help you see that you can run
catch throw std::bad_alloc
in new versions.
And do not forget that:
(gdb) help catch
is a good source for other useful information.
alexkr
source share