how to show cause of segmentation fault with gdb

Oliver Block lists@block-online.eu
Tue Jun 20 22:55:00 GMT 2006


Hi,

the last days I faced the following problem. I was writing a program that used 
c-client library. I defined and assigned a

char *myvar;

and the function expected a 

char myvar[];

Because a deeper function needed write access to that variable the program 
stopped with a segmentation fault. Someone else gave me a hint which is most 
likely the cause of the error. But he guessed, actually.

Is there a safe way show the cause of that error using gdb.

Best Regards,

Oliver



More information about the Gdb mailing list