home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os9 / 1197 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  2.8 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!news.Hamburg.Germany.EU.net!abqhh!keihh!kt
  2. From: kt@keihh.hanse.de (Kei Thomsen)
  3. Newsgroups: comp.os.os9
  4. Subject: Re: Strange problem with setjmp()/longjmp() in OS9
  5. Message-ID: <v1O85FG@keihh.hanse.de>
  6. Date: 2 Sep 92 05:33:38 GMT
  7. References: <87473@netnews.upenn.edu>
  8. Lines: 54
  9.  
  10. In article <87473@netnews.upenn.edu> mark@ginger.biophys.upenn.edu (Mark Elliott) writes:
  11.  
  12.  
  13. >    I am programming in OS-9 v2.3 and cannot get setjmp()/longjmp() to
  14. >behave. I would like my signal handling routine to call longjmp() to branch
  15. >to a location in my main() routine as set by setjmp(). The branch occurs, but
  16. >shortly there after I get a Bus Trap error. The curious thing is that the
  17. >Bus Trap error occurs a different places in the code, even in subroutines
  18. >that have been successfully executed several times since the branch.
  19. >    I know that this sounds like a pure programming error in my code (it
  20. >probably is!) but I have made every attempt to figure it out. My question is:
  21.  
  22. >********************************************************************************
  23. >Does any one out there know about some known problem/bug with setjmp()/longjmp()?
  24. >********************************************************************************
  25.  
  26. Yes, I have the same. I had analysed that problem.
  27.  
  28. If the program get a signal, the execption-function is called. If you leave that
  29. function, the OS-9 will make an OS9 F$RTE . But if you jump to another function
  30. with longjmp(), sometimes you get a BusError.
  31. Suddenly the register A5 is $7fffffff and you get a Address- oder BusError.
  32. If you look at the stack at that moment, you see that anybody has saved the CPU and
  33. FPU registers to your programstack. This could only be the kernel.
  34. I've tried this with all Kernels from v2.2 v2.3 and all v2.4 up till Rev. 125.
  35. I get that Error very fast, if I start a program with very much Floatingpointoperations
  36. in the background with the same priotity. With my testprogram, I can reproduce that
  37. error so often you want.
  38.  
  39. This MUST be a Kernelbug.
  40.  
  41. >    I have used setjmp()/longjmp() successfully in small test programs, but
  42. >something is different in my large application. And I am aware of the constraints
  43. >required to use setjmp()/longjmp() (i.e. I have NOT called setjmp() in a
  44. >subroutine which was returned from before longjmp() executed).
  45.  
  46. OK, I have the same.
  47.  
  48. Hi Microware, if you get this news, please send my a Mail.
  49.  
  50. Tschuess, Kei
  51.                    /\
  52.                   |^^|
  53.                   |{}|
  54.    _______________/~~\________________
  55.   / Kei Thomsen   |  | keihh.hanse.de \
  56.  `========--------.  .---------========'
  57.                   ||||
  58.  Wildermuthring 90 || kt@keihh.hanse.de
  59.  2000 Hamburg 62   ||    OS-9 68030 
  60.  Voice 040/5205921 ||
  61.  Modem 040/5200428 ||  300-14400 Baud
  62.                ,---||---, (V32bis)
  63.                '---<>---'
  64.