Skip to content
Tcl Source Code View Ticket
Login

View Ticket

expr failures on NetBSD

Closed / Wont Fix1618447fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-12-18 22:58:50
observed on the SF CF host  x86-netbsd1:

==== expr-29.1 smallest representible number FAILED
---- Result was:
0 0x806fe00001fffffe 0 0x806fe00001fffffe 0 0x806fe00001fffffe
---- Result should have been (exact matching):
0 0x0000000000000001 0 0x0000000000000001 0 0x0000000000000000
==== expr-29.1 FAILED
==== expr-29.2 smallest representible number FAILED
---- Result was:
0 0x006fe00001fffffe 0 0x006fe00001fffffe 0 0x006fe00001fffffe
---- Result should have been (exact matching):
0 0x8000000000000001 0 0x8000000000000001 0 0x8000000000000000
==== expr-29.2 FAILED
==== expr-29.3 silent underflow on input conversion FAILED
---- Result was:
1 -1.41848459010333e-306
---- Result should have been (exact matching):
1 0.0
==== expr-29.3 FAILED
==== expr-29.4 silent underflow on input conversion FAILED
---- Result was:
1 1.41848459010333e-306
---- Result should have been (exact matching):
1 -0.0
==== expr-29.4 FAILED
==== expr-42.1 denormals FAILED
---- Result was:
-1.41848459010333e-306
---- Result should have been (exact matching):
5e-324
==== expr-42.1 FAILED
dgp Ticket [1618447fff]: 1 change [History diff]2006-12-19 10:50:55
kennykbplain2007-01-03 23:16:01
Logged In: YES 
user_id=99768
Originator: NO

This is a bug in NetBSD's frexp() routine, and not in Tcl itself.

http://mail-index.netbsd.org/netbsd-bugs/2006/02/20/0016.html

In fact I see at:

http://ftp.cs.umn.edu/pub/NetBSD/NetBSD-current/src/lib/libc/gen/frexp_ieee754.c

that there's still a comment in the source:

/*
 * Fractions in [0.5..1.0) have an exponent of 2^-1.
 * Leave Inf and NaN alone, however.
 * WHAT ABOUT DENORMS?
 */

and no attempt to handle denormalized quantities.

I'm somewhat at a loss what to do when something as fundamental as frexp in the standard C library doesn't work.
mistachkinplain2007-01-20 18:04:47
Logged In: YES 
user_id=113501
Originator: NO


I'm seeing exactly the same failures on FreeBSD 4.11 STABLE.
kennykbplain2007-03-21 02:42:39
Logged In: YES 
user_id=99768
Originator: NO

This is a problem with certain libm's in BSD-on-x86.  NetBSD has fixed it:

http://www.nabble.com/PR-32861-CVS-commit:--netbsd-3--src-lib-libc-gen-t1339191.html

and, to quote Joe English on the Tcl'ers Chat:

"working around bugs in other people's libm's is a black pit of despair."

I suggest taking it up with the maintainers of whatever *BSD you are running.
Log in (anonymous is fine) to add a comment.