Mail Archives: djgpp/1995/04/26/14:24:21
#include<stdio.h>
main(){double x,y; x=0; y=1/x;}
I just ran the above small Gnu C++ program. Instead of any sort of useful
fault remark when it reached the divide-by-zero, it stuck (went into a tight
loop?), and when I ctrl-C'ed out of it, the resulting `hex' dump was this:-
====================
Ctrl-C Hit! Stopped at address 1c2
and nothing at all else. I have go32 1.12, binutils 2.4, bison 1.22,
diffutils 2.6, flex 2.4.7, gas 2.3, gcc 2.6.0, gdb 4.12, gzip 1.2.4,
libg++-2.6.0, make-3.71, patch-2.1, sed-1.18, texinfo-3.10
I am having this and similar flakinesses in a larger serious program also,
including it running OK when compiled normally but halting as abovementioned
when compiled with `-g'. The cause is not an array out of bounds, or a scanf
or printf accessing bad addresses at a `%' in its format, as far as I can see.
- Raw text -