From: casas@orange.cse.ogi.edu (Jeremy Casas)
Subject: longjmp/sigstack problem workaround anyone?
Date: 9 Nov 1994 23:43:48 GMT [thread overview]
Message-ID: <39rmrk$rjm@reuter.cse.ogi.edu> (raw)
Hi, I have a program that calls longjmp() from within a signal handler
that uses a temporary stack installed using sigstack().
The system: DEC 3000 Model 400 AXP - OSF/1 V1.3
The problem: I'm getting a IOT Trap within the longjmp() routine. I
don't have the source for longjmp() but by stepping through the
assembly instructions using dbx, it appears that within longjmp(), a test
like the following is made:
longjmp(jmpbuf)
{
....
target_sp = <get_target_sp from jmpbuf>
if (target_sp < current_sp) {
generate Invalid Operand Trap
}
....
}
While this check is generally beneficial, it generates an IOT in the case
when longjmp() is called from a signal handler using a temporary stack.
Since the temporary stack is allocated in the data segment and the
stack segment is below both the text and data segments, the test
made in longjmp() will always be true. That is, we have the following
case:
- target_sp points to an address in the real stack segment
- current_sp points to an address in the temporary stack in the
data segment
- stack segment is in a lower address than the data segment
- therefore, target_sp is ALWAYS < current_sp --> IOT!
My question: does anyone know of a workaround? any suggestions on how
to resolve this problem?
Thanks in advance!
jeremy
--
Jeremy Casas OGI: casas@cse.ogi.edu (503) 690-1125
Research Associate URL: http://www.cse.ogi.edu/~casas/
Oregon Graduate Institute of Science & Technology
reply other threads:[~1994-11-09 23:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox