home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13048 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  2.0 KB

  1. Path: sparky!uunet!utcsri!bonnie.concordia.ca!IRO.UMontreal.CA!CC.UMontreal.CA!gaumondp
  2. From: gaumondp@ERE.UMontreal.CA (Gaumond Pierre)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Problems with signal handling.
  5. Keywords: signal
  6. Message-ID: <1992Aug30.210156.11419@cc.umontreal.ca>
  7. Date: 30 Aug 92 21:01:56 GMT
  8. Sender: news@cc.umontreal.ca (Administration de Cnews)
  9. Organization: Universite de Montreal
  10. Lines: 45
  11.  
  12. I am on a 4D380 SGI machine under IRIX 4.0.1.
  13.  
  14. I am using a function to catch "bus error" and "segmentation fault". I call 
  15. signal(2) once with SIGBUS and once with SIGSEGV. The same function is used to 
  16. catch both signals.
  17.  
  18. I receive the good signal when the function is entered but, with SIGSEGV, the 
  19. code is not one of those expected (if I refer to the manual). The numeric value 
  20. is "4", corresponding to EINTR (interrupted system call).
  21.  
  22. [manual lines]
  23.                Condition                        Signal      Code
  24.  
  25.                ...
  26.                Invalid virtual address          SIGSEGV     EFAULT
  27.                Read-only address                SIGSEGV     EACCESS
  28.                Read beyond mapped object        SIGSEGV     ENXIO
  29.  
  30. Also, EACCESS (with two S) does not exist. EACCES is defined as "permission
  31. denied" in "/usr/include/sys/errno.h".
  32.  
  33. [file lines]
  34. ...
  35. #define    EINTR    4    /* Interrupted system call        */
  36. ...
  37. #define    ENXIO    6    /* No such device or address        */
  38. ...
  39. #define    EACCES    13    /* Permission denied            */
  40. #define    EFAULT    14    /* Bad address                */
  41.  
  42. I would like to know what to expect ...
  43.  
  44. I would like to have a better description of the "bus error" and "segmentation
  45. fault" errors. When do they occur? Are the 3 types of segemntation fault
  46. possible on my machine?
  47.  
  48. Does it exist a function (in C) that can tell me if a pointer is valid or not?
  49.  
  50. Thanks for any information.
  51.  
  52. -- 
  53. Pierre Gaumond.        gaumondp@ERE.UMontreal.CA
  54. Services Informatiques, Universite de Montreal. 
  55. C.P. 6128, Succursale "A", Montreal,            
  56. Quebec, Canada.   H3C 3J7                       
  57.