How do you debug a segmentation fault?

How do you debug a segmentation fault?
Answer
The strategy for debugging all of these problems is the same: load the core file into GDB, do a backtrace, move into the scope of your code, and list the lines of code that caused the segmentation fault. This just loads the program called example using the core file called “core”.
 

Tìm kiếm

Back
Top