Xref: utzoo comp.sys.att:12162 comp.lang.c:38469 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!princeton!njsmu!mccc!pjh From: pjh@mccc.edu (Peter J. Holsberg) Newsgroups: comp.sys.att,comp.lang.c Subject: Strange Behavior -- AT&T Std C Message-ID: <1991Apr18.144759.4492@mccc.edu> Date: 18 Apr 91 14:47:59 GMT Organization: The College On The Other Side of Route One Lines: 71 Here's the source: #include #include void main() { printf("Exp(0) = %f\n", exp(0.0)); printf("Exp(1) = %f\n", exp(1.0)); printf("Exp(-1) = %f\n", exp(-1.0)); } Here's a typescript of the compilation, execution, and debugging runs: Script is typescript, started Thu Apr 18 10:41:28 1991 mccc [pjh] /usr/pjh/c> cc -g -o y y.c -lm mccc [pjh] /usr/pjh/c> y Floating exception(coredump) mccc [pjh] /usr/pjh/c> sdb y no source file WHY DOES SDB SAY THIS???? 0x2cc (exp+368:) ffree %st(5) [ %st(5) ] *r ./y SIGNALED 8 process 4444 0x2cc (exp+368:) ffree %st(5) [ %st(5) ] *s SIGNALED 8 process 4444 0x2ce (exp+370:) popl %edi [ %edi ] *s STEPPED process 4444 function main() in y.c 6: printf("Exp(1) = %f\n", exp(1.0)); *s STEPPED process 4444 function main() in y.c 7: printf("Exp(-1) = %f\n", exp(-1.0)); *s SIGNALED 8 process 4444 0x2ce (exp+370:) popl %edi [ %edi ] *s STEPPED process 4444 function main() in y.c 7: printf("Exp(-1) = %f\n", exp(-1.0)); *s STEPPED process 4444 function main() in y.c 8: } *s Exp(0) = 1.000000 Exp(1) = 2.718282 Exp(-1) = 0.367879 GOOD LORD! IT DID THE CALCULATIONS!! Process 4444 has terminated. *s Can't step process, it's a core file. *q mccc [pjh] /usr/pjh/c> Script done Thu Apr 18 10:42:23 1991 This was done, incidentally, both with the original libm.a (that I was *so* sure was buggy!) and a borrowed copy of a later version of libm.a!! What on earth can be causing the "Floating exception(coredump)"???? Thanks, Pete -- Prof. Peter J. Holsberg Mercer County Community College Voice: 609-586-4800 Engineering Technology, Computers and Math UUCP:...!princeton!mccc!pjh 1200 Old Trenton Road, Trenton, NJ 08690 Internet: pjh@mccc.edu Trenton Computer Festival -- 4/20-21/91