[JDEV] Re: [Mac-dev] How to avoid crash on Apple OS X : workaround
Jabber Developer
jabberdev at funcall.com
Fri May 18 14:24:07 CDT 2001
Sorry for the formatting for my previous post! My mailer
screw up everything.
Below (hopefuly) the correct content!
Hi
A good news :
I have jabber running without a crash (at least in my tests)
on my Apple Mac OS X system.
The workaround is ugly and someone in the core Jabber
team should investigate what's happening there.
First the workaround to make jabber :
1. in mio.c when spawning the mio_main thread, add
pth_attr_set(attr, PTH_ATTR_NAME, "mio_main");
before :
mio__data->t=pth_spawn(attr,(void*)_mio_main,NULL);
==> this step is important because now
we will customize the pth library to handle particulary this
thread!! I know
it's ugly that why someone need to look into it!
2. in pth-1.3.7, modify pth_sched.c :
add the code below :
if (pth_current != NULL && strcmp( pth_current->name,
"mio_main") == 0) {
sa.sa_handler = pth_sched_eventmanager_sighandler;
sigfillset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGUSR2, &sa, &osa[SIGUSR2]);
}
before :
pth_sc(sigprocmask)(SIG_SETMASK, &pth_sigblock,
&oss);
==> what it does (if I understand correctly this part of the
code) : it add the SIGUSR2 signal in the list of handler that
should be catched... without this code it seems that the
SIGUSR2 used by the mio_write is raised but without any
handler installed and so generate the crash.
Why the handler was removed from the list I do not know,
and that's the main problem for all the crash I think.
3. You can apparently safely remove the other changes I
mentionned in mio.c :
you can put back the pth_yield() at it's initial place, and
remove the pth_usleep()
Please jabber developer on OS X give it a try and let me
know if it's working.
hope it helps!
More information about the JDev
mailing list