From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078712011393.tru64-unix-managers.marc@archive.invalid> From: Arno Hahma Date: Wed, 03 Jun 1998 07:07:11 +0000 To: tru64-unix-managers Subject: Bug in DEC C V5.6-075? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078712011393 Has anyone encountered problems with the system() call in DU 4.0D, patch level 1? I found a following problem: When a C-program calls an external program with system() and the called program generates a trap of some kind, the calling C-program also dies. For instance, the C-program calls: sprintf(comm,"fpe"); system(comm). The command "fpe" causes a floating point exception. As a result, the C-program also dies of floating point exception or segmentation fault (!?). As far as I have known, system() does not pass traps, signals etc. i.e. whatever happens to the command called by system(), does not affect the calling C-program. Has this changed recently or is it a bug? The problem arised with upgrading the C-compiler to level V5.6-75. The previous one did not behave like that. Interestingly enough, if you compile the program with the -g switch, i.e. debug code included, the problem does not arise at all! Thus, it is impossible to use ladebug to see, whether the problem is really at system() or only later. If you compile with -O (optimize), the C-program generates a segmentation fault, if there are any problems with system(). Currently, I am using the -g as a workaround for all programs, that use the system() call. Otherwise, they crash mysteriously, whenever a routine called by the system() does something wrong, such as the floating exception. ArNO 2