My program is a multi-thread program written in C, and runs on Solaris.
Now, a variable (malloced in heap) is sometimes changed from a valid value to NULL
, so when accessing it, core dump occurs.
I have tried all the methods I know: using libumem, add logs, code walk-through, and nothing can be found.
So when I analyse the core dump file again, I have a fantastic idea: Can I know which thread change the global variable (including malloced from heap)'s value from core dump file? Anyone can give some clues from core dump file?
Can I know which thread change the global variable (including malloced from heap)'s value from core dump file?
No.
A core dump records current state of the process memory at crash point, not the history of it. Just as looking at a photo of a spray-painted graffiti on the wall you can't tell who painted it, looking at NULL
in a core dump will not tell you who put it there.