Re: Sparc/Linux

Date view Thread view Subject view Author view

From: Tim Wilkinson (tim@transvirtual.com)
Date: Wed Sep 30 1998 - 19:36:03 EDT


Daniel,

It looks like the Sparc/Linux longjmp is checking that the frame pointer makes
sense and aborts if it doesn't. It does this by unrolling until the frame
pointer equals the one stored in the jmpbuf. This sounds alot like the
AIX problem. My only solution at the moment is to rewrite them (or get the
code from somewhere else).

Tim

> > Oh great - so the longjmp on the Sparc/Linux unrolls the stack when you
> > do a longjmp to the indicated point in the jmpbuf ... which is just fine
> > if your using setjmp/longjmp for their usual purpose, but no so good if
> > you use it to create threads. I'm looking for a work around ... but it
> > anyone knows one please let me know.
>
> What I used to do is the following at thread creation time:
> create() {
> malloc stack
> setjmp in the father
> the if (setjmp (...)) { launch child process ()
> Using global variables only
> suicide()
> }
> else {
> modify the SP using the apriori knowledge of the SP index
> in the jmpbuf (father)
> }
> }
>
> Under that scheme, the fact that the longjmp unroll the stack is harmless,
> (I remember however that AIX was checking for the SP and exit()ing if not
> "within range" :-(, I had to rewrite them).
>
> That's lead to the second possiblility: take setjmp/longjmp from S/Linux
> libc and modify it, *grin* ...
>
> Daniel
> --
> Daniel.Veillard@w3.org | W3C MIT/LCS NE43-344 | Today's Bookmarks :
> Tel : +1 617 253 5884 | 545 Technology Square | Linux, WWW, rpm2html,
> Fax : +1 617 258 5999 | Cambridge, MA 02139 USA | badminton, Kaffe,
> http://www.w3.org/People/W3Cpeople.html#Veillard | HTTP-NG and Amaya.

--
  Tim Wilkinson                         Tel:     +1 510 704 1660
  Transvirtual Technologies, Inc.,      Fax:     +1 510 704 1893
  Berkeley, CA, USA.                    Email:   tim@transvirtual.com


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:56:58 EDT