Problems setjmp.h on Fedora 5

Marc Dionne dionne at cs.wisc.edu
Mon Apr 10 12:56:36 UTC 2006


Hi,

In recent versions of glibc, setjmp() now mangles the stack pointer when
it stores it and unmangles it in longjmp().  I suspect your code is trying
to change the stack pointer (since it uses the offset), which won't work
unless it knows how to mangle it properly.

Some options are to implement the mangling algorithm in the code (which is
platform specific and will be a pain to maintain), or switch to using
setcontext/makecontext/getcontext.  That's what was done in OpenAFS to
support FC5.

Marc

> Hello,
>
> Maybe this is out of topic, but it's related to developpement and I
> wasn't able to got the answer elsewhere.
>
> I'm having problem related to setjmp calls under a library
> (statethreads) on Fedora 5.
>
> When I try to compile the application using it, I get :
>
> depmode=gcc3 /bin/sh ./depcomp \
> cc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DLINUX -O -g -O2 -c `test
> -f 'sched.c' || echo './'`sched.c
> sched.c: In function ‘st_thread_create’:
> sched.c:892: erreur: ‘JB_SP’ undeclared (first use in this function)
> sched.c:892: erreur: (Each undeclared identifier is reported only once
> sched.c:892: erreur: for each function it appears in.)
> make[3]: *** [sched.o] Erreur 1
> make[3]: Leaving directory `/home/smXinstall/smX-0.0.0.0/statethreads'
> make[2]: *** [all-recursive] Erreur 1
> make[2]: Leaving directory `/home/smXinstall/smX-0.0.0.0/statethreads'
> make[1]: *** [all] Erreur 2
> make[1]: Leaving directory `/home/smXinstall/smX-0.0.0.0/statethreads'
> make: *** [all-recursive] Erreur 1
> [root at localhost smX-0.0.0.0]#
>
> Under Fedora 4, JB_SP was defined at /usr/include/bits/setjmp.h header.
> Fedora 5 doesn't define it anymore.
>
> It seems that this come from glibc. JB_SP is still defined in the last
> official glibc release (2.4), but in a different header :
> jmpbuf-offsets.h.
>
> I wasn't able to find any definition of JB_SP in any header of Fedora 5.
>
> I tried to define myself the value of JB_SP (4 - the same value found in
> Fedora 4 headers), but the application segfaults.
>
> Any idea ?
>
> Regards
>
> Jose-Marcio






More information about the fedora-devel-list mailing list