Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!lll-lcc!lll-ncis!samedi.tis.llnl.gov!tjt From: tjt@samedi.tis.llnl.gov (Tim Tessin) Newsgroups: comp.unix.aux Subject: Re: Printf Core Dumps on A/UX (also accntg bug) Message-ID: <32@ncis.llnl.gov> Date: 9 Jan 89 17:18:22 GMT References: <3568@emory.uucp> Sender: news@ncis.llnl.gov Reply-To: tjt@samedi (Tim Tessin) Organization: Lawrence Livermore National Laboratory, Livermore CA Lines: 33 In article <3568@emory.uucp> km@emory.uucp (Ken Mandelberg) writes: > I consider this a bug: > > The printf on A/UX will core dump with a floating point > exception on extreme data. For example: > > printf("%g\n", 0x7fffffff); > > will core dump on A/UX. On our BSD and other USG systems, this > prints "NaN", or some appropriate value (depending on the type > of internal floating point format). the following: printf("%f\n", 0x7fffffff); fails also. This was a symptom of a probable compiler bug in the accounting software on A/UX. The accounting command for reporting command records, "acctcms" failed to write its own internal records properly causing a 0x7fffffff to be written. When requested to print in human readable form, blamo! The problem was isolated to a reasonably complex 'if' statement on line 217 of acctcms.c. The binary version shipped with A/UX fails, the binary compiled from AT&T Sys V.2 source fails. I rewrote the 'if' statement in two parts to remove complexity, and it worked. This leads me to believe compiler snafu. Tim Tessin - Lawrence Livermore National Laboratory PHONE: (415) 423-4560 ARPA: tjt@tis.llnl.gov UUCP: {ames,lll-crg,lll-lcc,mordor}!lll-tis!tjt