Tk Library Source Code

View Ticket
Login
Ticket UUID: 1323146
Title: dns: ip test fail on 64-bit systems
Type: Bug Version: None
Submitter: dgp Created on: 2005-10-10 17:44:25
Subsystem: dns Assigned To: aakhter
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2005-10-19 01:04:20
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2005-10-18 17:53:05
Description:
Did this testing with Tcl 8.4.11-cvs
to avoid any question whether bignum
bugs were at fault.

These tests fails on a 64-bit system:

==== ::ip:maskToInt-2 dotted form FAILED
==== Contents of test case:

        ::ip::maskToInt 255.255.255.255
    
---- Result was:
-1
---- Result should have been (exact matching):
4294967295
==== ::ip:maskToInt-2 FAILED


==== ::ip:nextNet-7 1.1.1.1/32 -> 1.1.29.0 by 2 FAILED
==== Contents of test case:

        ip::nextNet 1.1.1.1 255.255.255.255 2
    
---- Result was:
0xffffffff01010103
---- Result should have been (exact matching):
0x01010103
==== ::ip:nextNet-7 FAILED
User Comments: dgp added on 2005-10-19 01:04:20:
Logged In: YES 
user_id=80530

Dude, I did plenty of pre-release
testing, but you sneaked this module
in just days before release, missing
all the testing that was done.

The closer to the deadline you make
code changes, the less testing you
can reasonably expect them to get.

kot added on 2005-10-19 00:57:02:
Logged In: YES 
user_id=173641

If only you did a PRE-release testing on a single 64-bit 
platform :-(

andreas_kupries added on 2005-10-19 00:53:04:
Logged In: YES 
user_id=75003

Committed to CVS head. Only one change to the patch: The
masking expression got braced.

andreas_kupries added on 2005-10-19 00:51:09:
Logged In: YES 
user_id=75003

Aamer, I have a 64bit system (linux/amd64) and have verified
the patch as well. I will commit it in a few minutes,
currently doing the admin work for it.

Beyond that, yes, you do have write access to the Tcllib CVS
at SF. It enabled that at the time I added you as a developer.

aakhter added on 2005-10-18 21:33:31:
Logged In: YES 
user_id=736414

The bug is currently assigned to me, but I don't have a 64 bit 
system to work on this. Do I have write access to CVS to 
commit this fix?

dgp added on 2005-10-18 21:05:55:
Logged In: YES 
user_id=80530


Yes, that patch corrects
the failing tests.

kot added on 2005-10-18 12:22:55:
Logged In: YES 
user_id=173641

I think, I found a fix. For some reason, attachments seem  
disabled on this page, so here is the patch inline (be careful  
of the white-space mangling):  
  
--- modules/dns/ipMore.tcl      Fri Sep 30 14:03:58 2005  
+++ modules/dns/ipMore.tcl      Tue Oct 18 01:15:38 2005  
@@ -400,8 +400,9 @@  
 proc ::ip::maskToInt {mask} {  
     if {[string is integer -strict $mask]} {  
-        set maskInt [expr {(0xFFFFFFFF << (32 - $mask)) &  
0xFFFFFFFF}]  
+        set maskInt [expr {(0xFFFFFFFF << (32 - $mask))}]  
     } else {  
         binary scan [Normalize4 $mask] I maskInt  
     }  
+    set maskInt [expr $maskInt & 0xFFFFFFFF]  
     return [expr wide([format "0x%08x" $maskInt])]  
 }  
 
This seems to work for me...

kot added on 2005-10-18 11:55:58:
Logged In: YES 
user_id=173641

Yes. I'm seeing this too -- on FreeBSD-6.0/amd64. Please, 
advise.

andreas_kupries added on 2005-10-12 01:22:33:
Logged In: YES 
user_id=75003

Reassigned to author of the commands in the failing tests.