[JDEV] How to avoid crash on Apple OS X : workaround

Jabber Developer jabberdev at funcall.com
Fri May 18 13:57:24 CDT 2001


H

i



A good news 
: 

I have jabber running without a crash (at least in my tes
ts)
 
on my Apple Mac OS X sy
stem
.
The workaround is ugly and someone in the core 
Jabbe
r 
team should investigate what's happenin
g ther
e.
First the workaround to make
 jabber
 :
1. in mio.
c when spawning the mio_main t
h
read, ad
d 
        pth_attr_set(attr, PTH_ATTR_NAME,
 "
mio_ma
in"

);
before
 :
         mio__data->t=pth
_spa
wn(attr,(vo
i
d
*
)_
m
io_main,NUL
L
);

==> this step is important becau
se now 
we will custom
ize 
the pth library to handle particular
y this t
hread!! I know 
it's 
ugly that why
 
someone 
n
eed to look int
o
 it!

2. i
n pth-1.3.7
, modify 
 pth_sche
d.
c :
add the code be
low :
if (pth_current
 != NULL && s
trcmp(
 pth_current->

name, 
"mio_main") =
= 0) {
    sa.sa_h
andler = pth_sc
hed_eventmana
ger_sigha
ndler;

   
 sigfillset(&sa.s
a_
mask);
    sa.sa_flag
s
 =
 
0;
    si
gactio
n(
S
IGUSR2, &
sa, &osa[SIGU
SR
2
]);
}

be
fo
re :
 
 
  pth_sc(sigpro
cmask)
(
SIG_SETMASK, &pth_sigb
lock, 
&

oss
);

==> what it does (if 
I understand correctly this part
 of
 t
he 
code) : it add the S
IG
USR2 signal in the list of hand
le
r 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