Printf Core Dumps on A/UX (also accntg bug)

Tim Tessin tjt at samedi.tis.llnl.gov
Tue Jan 10 03:18:22 AEST 1989


In article <3568 at emory.uucp> km at 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 at tis.llnl.gov
UUCP:  {ames,lll-crg,lll-lcc,mordor}!lll-tis!tjt



More information about the Comp.unix.aux mailing list