debugging segmentation fault with lldb

Hello,

I wrote an MPI Master-Slave program and sometimes I get segmentation fault on one of the slave nodes. It does not happen all the time. For example if I run it 10 times, this happens only once.

The problem is that it never happens inside the lldb. Maybe, because lldb initializes the memory even if there exist some uninitialized variable. I am not sure, though.

Does anyone has any suggestions how to find the problem in this case?

Unfortunately, the code is too long to be copied here.

Cheers,
Mohammad

if it never happens in the debugger there's a good chance its an uninitialized variable, go through the slave code and make sure everything is initialized, see if you still have the same problem.

If only i had a penny for every problem that turned out to be uninitialized data!
Thanks for your reply.
There is no way to stop lldb initializing the variables?
no, i believe it initialises the blocks of RAM where the variables are stored, not the variables themselves.

it could also be a timing issue, they often show these traits, works in the debugger but not free running.

if your application stops with a dialog box that's an opportunity to attach a debugger to the process and examine the call stack.
Topic archived. No new replies allowed.