NetBSD Problem Report #47128

From apb@apb.cequrux.com  Fri Oct 26 09:08:29 2012
Return-Path: <apb@apb.cequrux.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id EBF1163CA81
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 26 Oct 2012 09:08:28 +0000 (UTC)
Message-Id: <20121026090826.59DC83B339C@apb-laptoy.apb.alt.za>
Date: Fri, 26 Oct 2012 09:08:26 +0000 (UTC)
From: apb@cequrux.com
To: gnats-bugs@gnats.NetBSD.org
Subject: 32-bit kdump/ktruss fail on 64-bit kernel
X-Send-Pr-Version: 3.95

>Number:         47128
>Category:       bin
>Synopsis:       32-bit kdump/ktruss fail on 64-bit kernel
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 26 09:10:00 +0000 2012
>Last-Modified:  Fri Oct 26 09:24:34 +0000 2012
>Originator:     Alan Barrett
>Release:        NetBSD 6.99.14
>Organization:
Not much
>Environment:
 NetBSD-6.99.14/i386 kdump and ktruss
 NetBSD-6.99.14/amd64 kernel
>Description:
        struct ktr_header includes some fields whose size changes
        between 64-bit and 32-bit machines.

        If you run an i386 version of ktruss under an amd64 kernel, or
        if you ask an i386 version of kdump to parse a dump file that
        was created under an amd64 kernel, then it doesn't work.
>How-To-Repeat:
	See Description.
>Fix:
        struct ktr_header is used for data on disk, so it really should
        be machine independent; a new version of the struct is needed
        for this.  However, the old version should still be supported.

        1) Add several compat versions of struct ktr_header to match all
        possible combinations of sizeof short/int/long in the existing
        struct ktr_header on all existing NetSBD machines.  For example,
        change "short ktr_type" to "int16_t ktr_type", change "long
        tv_usec" to "int32_t tv_usec" in one version of the compat
        struct, and change it to "int64_t tv_usec" in another version of
        the compat struct.

        2) Teach ktruss and kdump to analyse the input data to figure
        out the format, and to handle all known formats.

        3) Add a completely new version of struct ktr_header that
        uses fixed width types throughout (with the same types on all
        machines).  (TBD: big-endian or native machine endian?)
	Add support for it to the kernel, ktruss, and kdump.

>Release-Note:

>Audit-Trail:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.