3

Are there any well known reasons for sigprocmask() to segfault when used in a multithreaded application?

I have an application that creates multiple threads using clone(). I have determined that for some reason when I use sigprocmask it segfaults (not all the time though). From the backtrace() it also seems like the segfault is occuring when I use sigprocmask() after a siglongjmp().

Any ideas?

4

1 に答える 1

1

2 番目と 3 番目の引数を確認してください。それらが NULL でない場合は、それぞれが への有効なポインターであることを確認してsigset_tください。

sigprocmask()シングルスレッドプロセスに対してのみ公式に定義されていることに注意してください。マルチスレッド プロセスではpthread_sigmask()代わりに を使用する必要がありますerrno

于 2010-02-01T08:58:09.447 に答える