I have a big code that uses only standard C++ libs and compiles well in gcc. As the code was actually written in VS C++ 6.0. The code runs fine in visual studio but when I use gcc compiler it gives no errors on compilation and when I run it it gives this error
"terminate called after throwing an exception at instance std::bad_alloc what() bad alloc"
One more confusion is that it is a numerical simulation code, it doesn't show any exception while using gdb debugging and terminates successfully but doesn't show the right results. But using gdb it doesn't terminates anywhere. So thats where I am stuck. I am unable to diagnose where does the bad_alloc
is actually happening.
- The code consists of C and C++ routines
- Memory is allocated through new
- gdb doesn't show any segabort or any exception during debugging
How can I debug this problem?