NetBSD Problem Report #37557

From paul@whooppee.com  Mon Dec 17 19:39:49 2007
Return-Path: <paul@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id B67E263B852
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 17 Dec 2007 19:39:49 +0000 (UTC)
Message-Id: <20071217193949.2458459AE@quicky.whooppee.com>
Date: Mon, 17 Dec 2007 11:39:49 -0800 (PST)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: Fix invalid casts in sysutil/xosview/bsd/kernel.cc
X-Send-Pr-Version: 3.95

>Number:         37557
>Category:       pkg
>Synopsis:       Fix invalid casts in sysutil/xosview/bsd/kernel.cc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    veego
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 17 19:40:02 +0000 2007
>Closed-Date:    Mon Dec 17 22:06:13 +0000 2007
>Last-Modified:  Mon Dec 17 22:06:13 +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;

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->veego
Responsible-Changed-By: veego@netbsd.org
Responsible-Changed-When: Mon, 17 Dec 2007 20:20:17 +0000
Responsible-Changed-Why:
I handle it.


From: Bernd Ernesti <veego@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/37557 CVS commit: pkgsrc/sysutils/xosview
Date: Mon, 17 Dec 2007 22:08:12 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	veego
 Date:		Mon Dec 17 22:08:12 UTC 2007

 Modified Files:
 	pkgsrc/sysutils/xosview: Makefile distinfo
 	pkgsrc/sysutils/xosview/patches: patch-aa

 Log Message:
 Apply patch from PR pkg/37557 which fixed a build error on x86_64.


 To generate a diff of this commit:
 cvs rdiff -r1.65 -r1.66 pkgsrc/sysutils/xosview/Makefile
 cvs rdiff -r1.22 -r1.23 pkgsrc/sysutils/xosview/distinfo
 cvs rdiff -r1.18 -r1.19 pkgsrc/sysutils/xosview/patches/patch-aa

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: veego@netbsd.org
State-Changed-When: Mon, 17 Dec 2007 22:06:13 +0000
State-Changed-Why:
I commited the patch. Thank you for the PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.