views:

27

answers:

1

Running a piece of C code from inside Netbeans 6.8 causes a Segmentation Fault. But the problem doesn't appear when running in debugging mode or from shell. Tried both in external terminal and output window of Netbeans.

The process is threaded, and uses an itimer that sends a signal, which I am masking with pthread_sigmask for threads that are irrelevant.

I saw some things about bugs hiding in debugging mode, but why could they also be hidden when running in shell?

A: 

When your program exhibits any undefined behaviour, any change in the operating environment can cause the application to behave differently. This different behaviour may or may not be a crash.

If the application is multithreaded, you may have some race conditions. Best bet is to take the core dump and investigate.

doron
From dmesg i got that the segfaults happened in the small profiler tool that netbeans has. And indeed, after disabling this, the problem doesn't appear. Still I don't know if it could be a netbeans bug. Anyway thanks for the help.
andysfoug