From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,f536dcab423155ed,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-11-11 11:57:31 PST Path: nntp.gmd.de!xlink.net!scsing.switch.ch!sun.rediris.es!news.uoregon.edu!vixen.cso.uiuc.edu!uwm.edu!reuter.cse.ogi.edu!orange.cse.ogi.edu!casas From: casas@orange.cse.ogi.edu (Jeremy Casas) Newsgroups: comp.sys.dec Subject: longjmp/sigstack problem workaround anyone? Date: 9 Nov 1994 23:43:48 GMT Organization: Oregon Grad. Inst. Computer Science and Eng., Beaverton Distribution: world Message-ID: <39rmrk$rjm@reuter.cse.ogi.edu> NNTP-Posting-Host: orange.cse.ogi.edu 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 = 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