Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question regarding multiple threads and segfaults

What happens when two threads of the same process running on different logical cpu hit a seg fault?

like image 858
mousey Avatar asked Dec 13 '25 04:12

mousey


1 Answers

Default action is for the process to exit. If you handle the segfault, I suppose you could try to arrange for just the thread where it happened to terminate. However, since the only things which cause a segfault to occur naturally (as opposed to raise or kill) stem from undefined behavior, the program is in an indeterminate state and you can't rely on being able to recover anything.

like image 133
R.. GitHub STOP HELPING ICE Avatar answered Dec 14 '25 20:12

R.. GitHub STOP HELPING ICE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!