NetBSD Problem Report #56691
From www@netbsd.org Sat Feb 5 22:12:59 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 3B1671A9239
for <gnats-bugs@gnats.NetBSD.org>; Sat, 5 Feb 2022 22:12:59 +0000 (UTC)
Message-Id: <20220205221257.A6B0D1A923B@mollari.NetBSD.org>
Date: Sat, 5 Feb 2022 22:12:57 +0000 (UTC)
From: abs@absd.org
Reply-To: abs@absd.org
To: gnats-bugs@NetBSD.org
Subject: newfs_v7fs bus error when passed vnd0d
X-Send-Pr-Version: www-1.0
>Number: 56691
>Category: bin
>Synopsis: newfs_v7fs bus error when passed vnd0d
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Feb 05 22:15:00 +0000 2022
>Last-Modified: Sat Feb 05 23:44:14 +0000 2022
>Originator: David Brownlee
>Release: NetBSD 9.99.92
>Organization:
none
>Environment:
NetBSD forsaken.absd.org 9.99.92 NetBSD 9.99.92 (GENERIC) #0: Mon Jan 24 16:56:26 GMT 2022 abs@iris.absd.org:/home/netbsd/src/sys/arch/amd64/compile/obj/GENERIC amd64
>Description:
Attempting to use newfs_v7fs to newfs a vnd0 partition exits with a bus error. Running the same command on the raw file completes without issue
>How-To-Repeat:
dd if=/dev/zero of=/tmp/fs bs=1m count=100
vndconfig vnd0 /tmp/fs
newfs_v7fs -V 4 -F -s 65536 /dev/vnd0d
volume size=65536, ilist size=2621, endian=1234, NAME_MAX=14
zsh: bus error
#0 0x00007d4d16b6cc14 in memcpy () from /lib/libc.so.12
#1 0x00000001ba803d59 in read_mmap (ctx=<optimized out>, buf=<optimized out>, sector=<optimized out>) at .../src/sys/fs/v7fs/v7fs_io_user.c:158
#2 0x00000001ba803ce9 in scratch_read (fs=fs@entry=0x7d4d17223000, blk=blk@entry=1) at .../src/sys/fs/v7fs/v7fs_io.c:97
#3 0x00000001ba8020b3 in v7fs_superblock_load (fs=fs@entry=0x7d4d17223000) at .../src/sys/fs/v7fs/v7fs_superblock.c:78
#4 0x00000001ba801b7b in partition_check (fs=0x7d4d17223000) at .../src/sbin/newfs_v7fs/main.c:81
#5 v7fs_newfs (mount=<optimized out>, maxfile=0) at .../src/sbin/newfs_v7fs/main.c:299
#6 0x00000001ba8044d2 in main (argc=<optimized out>, argv=<optimized out>) at .../src/sbin/newfs_v7fs/newfs_v7fs.c:194
>Fix:
>Release-Note:
>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/56691: newfs_v7fs bus error when passed vnd0d
Date: Sat, 5 Feb 2022 23:21:44 -0000 (UTC)
abs@absd.org writes:
>Attempting to use newfs_v7fs to newfs a vnd0 partition exits with a bus error. Running the same command on the raw file completes without issue
mmap() of a block device succeeds, but doesn't establish a mapping.
When you access the mmap'ed area you get a bus error.
That's probably not related to the vnd driver but to how vn_mmap()
works.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.