NetBSD Problem Report #1125
From gnats Wed Jun 7 22:15:31 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id WAA18697 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 7 Jun 1995 22:15:30 -0700
Message-Id: <199506080516.WAA00892@zeta-soft.com>
Date: Wed, 7 Jun 1995 22:16:04 -0700
From: "Scott L. Burson" <gyro@zeta-soft.com>
Reply-To: gyro@zeta-soft.com
To: gnats-bugs@NetBSD.ORG
Subject: `exec'ing ZMAGIC executables whose data size is not page-aligned
X-Send-Pr-Version: 3.2
>Number: 1125
>Category: kern
>Synopsis: `exec'ing ZMAGIC executables whose data size is not page-aligned
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 07 22:20:01 +0000 1995
>Closed-Date: Sat Jun 05 20:46:17 +0000 1999
>Last-Modified: Sat Jun 05 20:47:18 +0000 1999
>Originator: Scott L. Burson
>Release: NetBSD-current circa 5/20/95
>Organization:
ZETA-SOFT, Ltd.
>Environment:
NetBSD/sparc
System: NetBSD ganesh.zeta-soft.com 1.0A NetBSD 1.0A (GANESH) #17: Wed Jun 7 20:52:09 PDT 1995 gyro@ganesh.zeta-soft.com:/usr/src/sys/arch/sparc/compile/GANESH sparc
>Description:
I have some Franz Allegro Common Lisp executables I have been trying to run
under NetBSD-sparc. They wouldn't start up; the problem turned out to be that
the data size in the a.out header was not page-aligned. This bit in two ways:
first, `vm_mmap' failed in an obscure manner (with ENOMEM) if `size' was not
page-aligned. I fixed this in the obvious way, and then the `vm_allocate'
call in `vmcmd_map_zero' blew out during the mapping of the BSS segment,
because it was trying to remap the first page of the segment (which was the
partial page at the end of the data segment). I fixed this by modifying
`exec_aout_prep_zmagic' to be careful about this case.
An experienced kernel hacker should decide whether these are the right fixes.
In particular, one might argue that while the fix to `vm_mmap' may as well be
left in, as it doesn't look like it can do any harm, `exec_aout_prep_zmagic'
should be page-aligning all addresses and sizes in advance.
>How-To-Repeat:
See above.
>Fix:
*** vm/vm_mmap.c.~1~ Fri Mar 10 04:01:29 1995
--- vm/vm_mmap.c Wed Jun 7 19:17:26 1995
***************
*** 679,684 ****
--- 679,685 ----
if (size == 0)
return (0);
+ size = round_page(size); /* Gyro@zeta-soft.com 6/7/95 19:17 */
/* The file offset must be page aligned. */
if (foff & PAGE_MASK)
*** kern/exec_aout.c.~1~ Mon Nov 21 14:45:32 1994
--- kern/exec_aout.c Wed Jun 7 20:40:03 1995
***************
*** 139,146 ****
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
/* set up command for bss segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss,
! epp->ep_daddr + execp->a_data, NULLVP, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
--- 139,149 ----
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
/* set up command for bss segment */
+ /* `round_page' call inserted by Gyro@zeta-soft.com 6/7/95 20:38
+ * If `execp->a_data' is not page aligned, we must be careful not to
+ * overlap the region mapped for the data segment. */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss,
! round_page(epp->ep_daddr + execp->a_data), NULLVP, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: hwr
State-Changed-When: Sun Apr 25 04:48:15 PDT 1999
State-Changed-Why:
Is this still true with VM gone and new UVM? Could you check?
From: "Scott L. Burson" <gyro@zeta-soft.com>
To: gnats-bugs@netbsd.org
Cc: Subject: kern/1125
Date: Sat, 5 Jun 1999 13:25:45 -0700 (PDT)
Hi,
I'm getting an autoreminder that this PR is in the `feedback' state.
Unfortunately, I am unable to provide the requested feedback as I no longer
have a machine here running NetBSD. My guess is that the problem never
affected anyone but me anyway.
-- Scott
State-Changed-From-To: feedback->closed
State-Changed-By: hwr
State-Changed-When: Sat Jun 5 13:46:17 PDT 1999
State-Changed-Why:
Closed on request of submitter.
>Unformatted:
(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.