home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!bonnie.concordia.ca!IRO.UMontreal.CA!CC.UMontreal.CA!gaumondp
- From: gaumondp@ERE.UMontreal.CA (Gaumond Pierre)
- Newsgroups: comp.sys.sgi
- Subject: Problems with signal handling.
- Keywords: signal
- Message-ID: <1992Aug30.210156.11419@cc.umontreal.ca>
- Date: 30 Aug 92 21:01:56 GMT
- Sender: news@cc.umontreal.ca (Administration de Cnews)
- Organization: Universite de Montreal
- Lines: 45
-
- I am on a 4D380 SGI machine under IRIX 4.0.1.
-
- I am using a function to catch "bus error" and "segmentation fault". I call
- signal(2) once with SIGBUS and once with SIGSEGV. The same function is used to
- catch both signals.
-
- I receive the good signal when the function is entered but, with SIGSEGV, the
- code is not one of those expected (if I refer to the manual). The numeric value
- is "4", corresponding to EINTR (interrupted system call).
-
- [manual lines]
- Condition Signal Code
-
- ...
- Invalid virtual address SIGSEGV EFAULT
- Read-only address SIGSEGV EACCESS
- Read beyond mapped object SIGSEGV ENXIO
-
- Also, EACCESS (with two S) does not exist. EACCES is defined as "permission
- denied" in "/usr/include/sys/errno.h".
-
- [file lines]
- ...
- #define EINTR 4 /* Interrupted system call */
- ...
- #define ENXIO 6 /* No such device or address */
- ...
- #define EACCES 13 /* Permission denied */
- #define EFAULT 14 /* Bad address */
-
- I would like to know what to expect ...
-
- I would like to have a better description of the "bus error" and "segmentation
- fault" errors. When do they occur? Are the 3 types of segemntation fault
- possible on my machine?
-
- Does it exist a function (in C) that can tell me if a pointer is valid or not?
-
- Thanks for any information.
-
- --
- Pierre Gaumond. gaumondp@ERE.UMontreal.CA
- Services Informatiques, Universite de Montreal.
- C.P. 6128, Succursale "A", Montreal,
- Quebec, Canada. H3C 3J7
-