Reputation: 11
I have a quite intriguing issue with my program (compiled with gcc 4.6.4 on ubuntu 12.04). When I dynamically build the executable, the program runs flawlessly. But when I build it statically (with -static flag), it gives me a 'core dumped' after exiting (e.g. after 'return 0' in main). Unfortunately, the whole program is too big to pose in here. What are the possibilities?
Upvotes: 1
Views: 516
Reputation: 1
In addition of the two possibilities in johnnycrash answer:
Some functions with __attribute__ ((destructor))
is called, and dump core.
The memory heap is corrupted (check with valgrind)
Some function registered with atexit(3) is crashing
Some library/function is linked "twice"
Upvotes: 2
Reputation: 5344
1) You have a thread still executing. 2) You are overwriting memory and you get lucky with the dynamic libraries.
Upvotes: 1