avoid delivering SIGALRM to background thread - glib/ebook crash when that happens
git-svn-id: https://zeitsenke.de/svn/SyncEvolution/trunk@460 15ad00c4-1369-45f4-8270-35d70d36bdcd
This commit is contained in:
parent
47bcfccee0
commit
d808603aef
|
@ -629,8 +629,20 @@ void EvolutionSyncClient::fatalError(void *object, const char *error)
|
|||
|
||||
#ifdef RUN_GLIB_LOOP
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
static void *mainLoopThread(void *)
|
||||
{
|
||||
// The test framework uses SIGALRM for timeouts.
|
||||
// Block the signal here because a) the signal handler
|
||||
// prints a stack back trace when called and we are not
|
||||
// interessted in the background thread's stack and b)
|
||||
// it seems to have confused glib/libebook enough to
|
||||
// access invalid memory and segfault when it gets the SIGALRM.
|
||||
sigset_t blocked;
|
||||
sigemptyset(&blocked);
|
||||
sigaddset(&blocked, SIGALRM);
|
||||
pthread_sigmask(SIG_BLOCK, &blocked, NULL);
|
||||
|
||||
GMainLoop *mainloop = g_main_loop_new(NULL, TRUE);
|
||||
if (mainloop) {
|
||||
g_main_loop_run(mainloop);
|
||||
|
|
Loading…
Reference in New Issue