Subject: pkg/37557: Fix invalid casts in sysutil/xosview/bsd/kernel.cc
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <paul@whooppee.com>
List: pkgsrc-bugs
Date: 12/17/2007 19:40:03
>Number:         37557
>Category:       pkg
>Synopsis:       Fix invalid casts in sysutil/xosview/bsd/kernel.cc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 17 19:40:02 +0000 2007
>Originator:     Paul Goyette
>Release:        NetBSD 4.99.41
>Organization:
----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul@whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette@juniper.net |
----------------------------------------------------------------------
>Environment:
	
	
System: NetBSD quicky.whooppee.com 4.99.41 NetBSD 4.99.41 (QUICKY (ASUS M2N32 WS) 2007-12-09 13:46:07 UTC) #0: Sun Dec 9 06:54:16 PST 2007 paul@quicky.whooppee.com:/usr/obj/objdir/amd64/sys/arch/amd64/compile/QUICKY amd64
Architecture: x86_64
Machine: amd64
>Description:
routine safE_kvm_read() is defined to take a u_long first argument for the
kernel address to be read.  But at lines 1046 and 1054 an address is cast
to an unsigned int.  This results in compiler errors.
	
>How-To-Repeat:
Try to build sysutils/xosview on x86_64
	
>Fix:
Apply the following diffs to sysutils/xosview/patches/patch-aa


--- patch-aa	2007-12-17 11:32:34.000000000 -0800
+++ kernel.cc.diff	2007-12-17 11:31:15.000000000 -0800
@@ -164,3 +164,21 @@
    }
    *bytesXferred = xferred;
  #else
+@@ -1016,7 +1043,7 @@
+ 
+     while (evptr && i < NUM_INTR) {
+ 
+-      safe_kvm_read((unsigned int)evptr, &evcnt, sizeof(evcnt));
++      safe_kvm_read((u_long)evptr, &evcnt, sizeof(evcnt));
+ 
+       evptr = evcnt.ev_list.tqe_next;
+ 
+@@ -1024,7 +1051,7 @@
+       if (evcnt.ev_type != EVCNT_TYPE_INTR)
+ 	continue;
+ 
+-      safe_kvm_read((unsigned int)evcnt.ev_name, evname, evcnt.ev_namelen);
++      safe_kvm_read((u_long)evcnt.ev_name, evname, evcnt.ev_namelen);
+       // If it's a soft interrupt (has a name that starts with "soft"), skip it.
+       if (!strncmp(evname, "soft", 4))
+ 	continue;

>Unformatted: