Thread View: comp.sys.acorn.tech
1 messages
1 total messages
Started by burke
Thu, 06 Aug 1992 19:11
Error trapping in C
Author: burke
Date: Thu, 06 Aug 1992 19:11
Date: Thu, 06 Aug 1992 19:11
21 lines
1738 bytes
1738 bytes
What do you need to do to make a C program bomb-proof? You obviously have to catch SIGSTAK, but is it possible to get SIGINT or SIGTERM? If so, how? The C manual isn't very forthcoming about signals. Also, does wimpt_noerr() stop the program with exit() or abort()? Secondly, what should I do after a signal? Presumably a longjmp to the main routine is the best bet, but what then - after a SIGSTAK, will it be safe to call saveas()? Or I could save to an internal file and then quit, but what if the save fails? Or I could put up a message and just go back to polling, but will all the internal data structures be intact? (and you may just get SIGSTAK again anyway). Acorn are always going on about how you shouldn't die with unsaved data, and then they give you a system whose response to running out of memory is to collapse with a backtrace, and no guidance on how to do it better :-( Any ideas? e----><----p | Stephen Burke | Internet: burke@vxdesy.desy.de H H 1 | Gruppe FH1T (Liverpool) | DECnet: vxdesy::burke (13313::burke) H H 11 | DESY, Notkestrasse 85 | BITNET: BURKE@DESYVAX or SB2@UKACRL HHHHH 1 | 2000 Hamburg 52 | JANET: sb2@uk.ac.rl.ib H H 1 | Germany | Phone: + 49 40 8998 2282 H H 11111 | HERA, the world's largest electron microscope!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads