freebsd-nq/lib/libc
Poul-Henning Kamp b384108ed6 /* You're not supposed to hit this problem */
For some denormalized long double values, a bug in __hldtoa() (called
from *printf()'s %A format) results in a base 16 digit being rounded
up from 0xf to 0x10.

When this digit is subsequently converted to string format, an index
of 10 reaches past the end of the uppper-case hex/char array, picking
up whatever the code segment happen to contain at that address.

This mostly seem to be some character from the upper half of the
byte range.

When using the %a format instead of %A, the first character past
the end of the lowercase hex/char table happens to be index 0 in
the uppercase hex/char table hextable and therefore the string
representation features a '0', which is supposedly correct.

This leads me to belive that the proper fix _may_ be as simple as
masking all but the lower four bits off after incrementing a hex-digit
in libc/gdtoa/_hdtoa.c:roundup().  I worry however that the upper
bit in 0x10 indicates a carry not carried.

Until das@ or bde@ finds time to visit this issue, extend the
hexdigit arrays with a 17th index containing '?' so that we get a
invalid but consistent and printable output in both %a and %A formats
whenever this bug strikes.

This unmasks the bug in the %a format therefore solving the real
issue may both become easier and more urgent.

Possibly related to:	PR 85080
With help by:		bde@
2005-12-13 13:23:27 +00:00
..
alpha Remove fpsetsticky(). This was added for SysV compatibility, but due 2005-03-15 15:53:39 +00:00
amd64 Optimize the instruction alignment. 2005-04-23 18:45:36 +00:00
arm Fix a long line in copyright notice. 2005-10-03 14:43:27 +00:00
compat-43 Include a couple of headers to ensure consistency between the prototype and 2005-09-12 19:52:42 +00:00
db Fix parameter types of close and get members in DB. 2005-09-10 12:40:51 +00:00
gdtoa Don't compile the gdtoa package's strtoIg.c into libc. 2005-01-27 05:44:16 +00:00
gen Switch BUILD_ARCH in Makefile to use uname -p suggested by ru. 2005-12-03 05:11:07 +00:00
gmon Make SYNOPSIS compile. 2005-11-23 15:55:38 +00:00
i386 Include a couple of headers to ensure consistency between the prototype and 2005-09-12 19:52:42 +00:00
ia64 - Define LDBL_NBIT to be a mask indicating the position of the integer 2005-03-07 04:55:40 +00:00
include Move the declaration of __cleanup to libc_private.h as it is used in both 2005-09-12 13:46:32 +00:00
locale -mdoc sweep. 2005-11-17 13:00:00 +00:00
net Fix inet6_opt_get_val() prototype. 2005-11-23 16:07:54 +00:00
nls Better translation. 2005-07-23 21:30:35 +00:00
posix1e There's no longer^Wyet <sys/capability.h>. 2005-11-23 16:24:39 +00:00
powerpc Remove fpsetsticky(). This was added for SysV compatibility, but due 2005-03-15 15:53:39 +00:00
quad - Add prototypes for __cmpdi2() and __ucmpdi2(). 2005-09-12 16:16:12 +00:00
regex Use prototypes for CHIN1() and CHIN(). 2005-09-12 16:02:54 +00:00
rpc Fix prototypes. 2005-11-23 16:44:23 +00:00
softfloat Remove fpsetsticky(). This was added for SysV compatibility, but due 2005-03-15 15:53:39 +00:00
sparc64 Add the functions _Qp_cmp() and _Qp_cmpe() as described in the Sparc 2005-06-21 21:13:07 +00:00
stdio /* You're not supposed to hit this problem */ 2005-12-13 13:23:27 +00:00
stdlib Fix prototype. 2005-11-23 20:34:37 +00:00
stdtime The arguments for time2posix() and posix2time() are time_t values, not 2005-09-11 17:09:50 +00:00
string Fix prototype. 2005-11-24 06:56:21 +00:00
sys Add cross references to siginfo.3. 2005-12-13 03:05:58 +00:00
uuid Keep up with const poisoning in uuid.h,v 1.3. 2005-11-24 07:04:20 +00:00
xdr Fix prototypes. 2005-11-24 07:12:01 +00:00
yp do mutex lock for each yp calls. with this, 2005-05-03 20:30:31 +00:00
Makefile Respect the YES_HESIOD build variable. 2005-08-06 16:53:55 +00:00