From: SourceForge.net <no...@so...> - 2005-02-28 09:12:52
|
Bugs item #1116542, was opened at 2005-02-04 23:03 Message generated for change (Comment added) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1116542&group_id=10894 Category: 12. ByteArray Object Group: current: 8.4.9 Status: Open Resolution: Works For Me Priority: 8 Submitted By: Don Porter (dgp) Assigned to: Donal K. Fellows (dkf) Summary: bogus [binary format d] output Initial Comment: % info patch 8.4.9 % parray tcl_platform tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = alpha tcl_platform(os) = Linux tcl_platform(osVersion) = 2.2.23 tcl_platform(platform) = unix tcl_platform(user) = dgp tcl_platform(wordSize) = 8 % binary scan [binary format d 83] c* v; set v 0 0 0 0 0 0 0 0 It appears the [binary format d] spits out all x00 bytes. This is fixed in 8.5a3. Can someone who knows what happened backport the fix please? ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2005-02-28 09:12 Message: Logged In: YES user_id=79902 If there's a bug like this on linux-alpha, should there be updates to configure to detect it and install a compat/ workaround in that case? (Fix looks good BTW, but the test probably ought to use a value that has an exact binary representation: 1.25 instead of 1.2?) ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2005-02-25 22:22 Message: Logged In: YES user_id=80530 Attached patch is a partial backport from the HEAD that corrects this problem. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2005-02-25 21:55 Message: Logged In: YES user_id=80530 This is apparently a problem with memcpy() on this system. Replacing "sizeof(double)" with "1+sizeof(double)" makes things work. Leaving it as it is, only one byte is copied by memcpy() instead of the full 8 bytes of the double value. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2005-02-25 19:29 Message: Logged In: YES user_id=72656 This works fine for me with AMD64/Linux, Sol8-64 and HP-UX 11 64-bit (pa-risc). ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2005-02-25 19:19 Message: Logged In: YES user_id=80530 Bug was likely introduced with this change: 9/15/97 (bug fix) Alignment problems in "binary format" would cause a crash on some platforms when formatting floating point numbers. (SS) ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2005-02-25 19:02 Message: Logged In: YES user_id=80530 Bug arrived in Tcl 8.0p1: % info patch 8.0 % binary scan [binary format d 1.2] d w; set w 1.2 % info patch 8.0p1 % binary scan [binary format d 1.2] d w; set w 2.51973479379e-322 How can we not have tests in the test suite that [binary scan] and [binary format] are inverse functions? ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2005-02-25 18:41 Message: Logged In: YES user_id=80530 FWIW, this brokenness showed up sometime between Tcl 8.0 and Tcl 8.0.3. Still investigating... ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2005-02-09 14:31 Message: Logged In: YES user_id=79902 What happened was TIP#129, but why that makes a difference I really don't know. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1116542&group_id=10894 |