wcs@homxa.UUCP (Bill Stewart HO 4K-437 x0705) (03/29/84)
A year or so ago, someone posted an article explaining the arcane messages C programs put out when they die, e.g. Bus error - core dumped Protection violation Segmentation fault Many of these tend to indicate common types of errors. For example protecton violation often means "subscript way out of range". Several office moves later, I can't find the list. Could some kind wizard post a new explanation, or (if it is archived somewhere) repost the original? Thanks; Bill Stewart ho95b!wcs -- "The first major program written in ADA will be a COBOL interpreter." Stewart, 1984 Bill Stewart AT&T Bell Labs, Holmdel NJ HO 4K-437 x0705 (201-949-0705) ho95b!wcs ucbvax!ihnp4!ho95b!wcs decvax1harpo!ho95b!wcs
david@varian.UUCP (04/12/84)
ho95b!wcs (Bill Stewart) asked if this list, which was posted last year by Dave Curry, could be reposted or sent to him. I think that it is useful enough to be reposted. Thanks to Dave Curry for posting it the first time. David Brown (415) 945-2199 Varian Instruments 2700 Mitchell Dr. Walnut Creek, Ca. 94598 {zehntel,amd70,fortune}!varian!david ========================= >From zehntel!teklabs!ucbcad!ucbvax:decvax!harpo!npoiv!npois!houxm!ihnp4!ihldt!ll1!otuxa!nwuxc!inuxc!pur-ee!davy Mon Dec 6 18:28:04 1982 Subject: Coredump Message Meanings - Summary - (nf) Newsgroups: net.lang.c #N:pur-ee:15500007:000:3266 pur-ee!davy Dec 6 11:05:00 1982 This is the information which I have received in response to my query about the meanings of the various core dump messages given by the shell. I have summarized much of the information in order to keep this article reasonably short (well, 100 lines is shorter than 300....). ------------------ Bus Error - Types of arguments and parameters don't match. - I/O problems - reading past EOF, reading a closed file, bad file pointers, etc. [This refers to stdio only, I think.... --Dave] - Arrays improperly dimensioned. Eg., attempting to access a word starting at an odd address. - Referencing a non-existent bus device. - NULL or unitialized pointer, subscript out of range. Memory Fault - Subscripting arrays past the memory allocation for your program. - NULL or unitialized pointer, subscript out of range. - Attempts to reference data outside valid address space - Parity errors in address space - Recursion (try making your own routines "read" and "write" and then call "scanf" or "printf" and watch what happens). IOT Trap - Execution of IOT (I/O Trap) instruction; also used by the "abort" routine (PDP-11's only). EMT Trap - Emulator Trap Instruction (PDP-11's). Trace/BPT Trap - Execution of the BPT instruction (PDP-11's) - Trace bit set in Processor Status (long)Word - Trying to tell the program to go to an address that doesn't exist. - "Wanton destruction caused execution of data or trashing of instructions." Floating Exception - Invalid floating point operation: - overflow - underflow - divide by zero - log of negative number - float-to-int conversion overflow Segmentation Fault - Subscript out of range. - Handing "printf", etc. a string which is not NULL terminated. Illegal Instruction - Attempt to execute a priviledged instruction, such as "halt". - Execution of nonsense insstruction (e.g., jump to a register). - Forgot -f flag to cc on PDP-11 without floating point hardware. ----- Special Note: John Bruner (pur-ee!bruner) also had this to say about Illegal Instruction: "On the VAXes the 'abort' routine executes a 'halt' and blows away the program with an illegal instruction. Note that SIGTRAP (trace trap) and SIGILL (illegal instruction trap) are not reset when caught. Thus, a generalized trap handler such as sig(s) int s; { fprintf(stderr, "Fatal signal %d\n", sig); abort(); } will (on the VAX) recursively call 'abort' which will attempt to execute a 'halt' [illegal] and trap to 'sig' which will call 'abort'... until you either kill it with a signal it doesn't catch (e.g. SIGKILL=9) or it runs out of stack space (a LONG time on the VAX)." ------------------ In all, I got 5 responses with information about the messages, and three responses asking for a copy of the summary (to those of you who asked, I have sent you each a copy via mail). Thanks go to all who responded: John Bruner (pur-ee!bruner), arizona!tom, ihuxw!thor, Bob Van Valzah (tpdcvax!bobvan), Geoff Collyer (utcsstat!geoff). --Dave Curry pur-ee!davy