NetBSD Problem Report #49260

From njoly@lynche.sis.pasteur.fr  Mon Oct  6 07:36:19 2014
Return-Path: <njoly@lynche.sis.pasteur.fr>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9790CA65C6
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  6 Oct 2014 07:36:19 +0000 (UTC)
Message-Id: <20141006073616.1AF3ABCA63@lynche.sis.pasteur.fr>
Date: Mon,  6 Oct 2014 09:36:16 +0200 (CEST)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@NetBSD.org
Subject: makefs -t v7fs crash with empty tree
X-Send-Pr-Version: 3.95

>Number:         49260
>Category:       bin
>Synopsis:       makefs -t v7fs crash with empty tree
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 06 07:40:00 +0000 2014
>Originator:     Nicolas Joly
>Release:        NetBSD 7.99.1
>Organization:
Insitut Pasteur
>Environment:
System: NetBSD lynche.sis.pasteur.fr 7.99.1 NetBSD 7.99.1 (LYNCHE) #0: Fri Oct 3 14:13:42 CEST 2014 njoly@lynche.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LYNCHE amd64
Architecture: x86_64
Machine: amd64
>Description:
Trying to create a v7fs file system image from an empty directory tree make
the program crash

njoly@lynche [~/tmp]> mkdir empty.tree
njoly@lynche [~/tmp]> makefs -t v7fs image.v7fs empty.tree
Calculated size of `image.v7fs': 2048 bytes, 1 inodes
zsh: segmentation fault (core dumped)  makefs -t v7fs image.v7fs empty.tree
njoly@lynche [~/tmp]> gdb makefs makefs.core
GNU gdb (GDB) 7.7.1
[...]
ore was generated by `makefs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f7ff6d0d17f in memcpy () from /usr/lib/libc.so.12
(gdb) bt
#0  0x00007f7ff6d0d17f in memcpy () from /usr/lib/libc.so.12
#1  0x000000000041bfb3 in write_mmap (ctx=<optimized out>,
    buf=<optimized out>, sector=<optimized out>)
    at /local/src/NetBSD/src/sys/fs/v7fs/v7fs_io_user.c:169
#2  0x000000000041c587 in make_freeblocklist (buf=0x7f7fffffd560 "2",
    listblk=102, fs=0x7f7ff7b07000)
    at /local/src/NetBSD/src/sbin/newfs_v7fs/main.c:190
#3  make_filesystem (fs=0x7f7ff7b07000, volume_size=volume_size@entry=4,
    ilist_size=ilist_size@entry=1)
    at /local/src/NetBSD/src/sbin/newfs_v7fs/main.c:259
#4  0x000000000041c732 in v7fs_newfs (mount=mount@entry=0x7f7fffffd850,
    maxfile=<optimized out>)
    at /local/src/NetBSD/src/sbin/newfs_v7fs/main.c:304
#5  0x0000000000409286 in v7fs_makefs (image=0x7f7ffffffcf7 "image.v7fs",
    dir=0x7f7ffffffd02 "empty.tree", root=0x7f7ff7b0b080,
    fsopts=0x7f7fffffd900) at /local/src/NetBSD/src/usr.sbin/makefs/v7fs.c:147
#6  0x0000000000428c7a in main (argc=<optimized out>, argv=0x7f7fffffdaa8)
    at /local/src/NetBSD/src/usr.sbin/makefs/makefs.c:305

>How-To-Repeat:
mkdir empty.tree
makefs -t v7fs image.v7fs empty.tree
>Fix:

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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.