DEV Community

Discussion on: I'm an Expert in Memory Management & Segfaults, Ask Me Anything!

Collapse
 
gauravbhardwaj03 profile image
gaurav-bhardwaj03

Hello Jason!

I was running a multi threaded code where I am getting a segfault at a particular line.

As shown in the image the curr_node in the code is a healthy node that I am able to check on my debugger.

Collapse
 
codemouse92 profile image
Jason C. McDonald

Hi gaurav,

(1) I can't see the image.

(2) multi-threaded segfaults are scary. Are you able to try and reproduce it single-threaded? If you can, it'll be easier to debug. If you cannot, it may be related to the threading itself.

(3) This is probably a lot deeper than just finding a segfault. You will want to audit your code for thread safety.