I am working on an open class of shared variables, and I want to be able to generate a SIGSEGV error to see if my implementation works as I planned. I tried to create a function that changes the pointer and reads it 100 times. Then I call this function on both threads, and the threads execute endlessly inside my program. This does not create the error I want. How should I do it?
edit I do not process segfaults at all, but they are generated in my program if I remove locks. I want to use a non-blocking construct, so I created a generic class of variables that uses CAS to stay locked. Is there a way that I can have a piece of code that will generate segfaults so that I can use my class to verify that it fixes the problem?
source share