NetBSD Problem Report #47974

From reinoud@heethoofdje.13thmonkey.org  Sat Jun 29 14:17:47 2013
Return-Path: <reinoud@heethoofdje.13thmonkey.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0C1E470F12
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 29 Jun 2013 14:17:47 +0000 (UTC)
Message-Id: <20130629141748.BC9DA28192F1@heethoofdje.13thmonkey.org>
Date: Sat, 29 Jun 2013 16:17:48 +0200 (CEST)
From: reinoud@NetBSD.org
Reply-To: reinoud@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: udf tests fail due to interaction with rump
X-Send-Pr-Version: 3.95

>Number:         47974
>Category:       kern
>Synopsis:       udf tests fail due to interaction with rump
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 29 14:20:00 +0000 2013
>Last-Modified:  Sun Jun 30 18:30:00 +0000 2013
>Originator:     Reinoud Zandijk
>Release:        NetBSD 6.1_STABLE
>Organization:
NetBSD

>Environment:


System: NetBSD heethoofdje.13thmonkey.org 6.1_STABLE NetBSD 6.1_STABLE (GENERIC) i386
Architecture: i386
Machine: i386
>Description:
The automated tests for UDF fail due to interaction problem with rump. They
now all fail with `mount failed: Invalid Argument'.

Known issue with UDF and rump is that for rump_udf(8) to work on optical
media, rump needs to honour its sector size. UDF requests reads/writes on
sector size boundaries and lengths but rump chops them up and the mount fails
due to read errors.

Since the test framework runs on an vnd disc, that ought not to be the
problem. Mounting a vnd with rump_udf(8) works fine due to its 512 byte sector
size. So why does the ATF fail?

I've tried to debug it by running in gdb but that fails due to the threading.
gdb crashes in the process.


>How-To-Repeat:
Check the daily test cases summary for whatever architecture.

>Fix:
Might be due to building glue not done correctly?


>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/47974: udf tests fail due to interaction with rump
Date: Sun, 30 Jun 2013 00:43:24 +0200

 It dies here:

 Breakpoint 1, udf_mount (mp=0x7f7ff77aa000, path=0x416014 "/mnt", 
     data=0x7f7ff7b6e0d8, data_len=0x7f7fffffd8a8)
     at /usr/src/sys/rump/fs/lib/libudf/../../../../fs/udf/udf_vfsops.c:317
 317     {
 (gdb) n
 318             struct lwp *l = curlwp;
 (gdb) 
 326             if (*data_len < sizeof *args)
 (gdb) print *data_len
 $1 = 8
 (gdb) print sizeof *args
 $2 = 80

 and does:

 326             if (*data_len < sizeof *args)
 327                     return EINVAL;


 I can't find my way through the fstest macros right now sizeof(udf_mount_args)
 vs. sizeof(udf_mount_args*) somewhere?

 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: Antti Kantee <pooka@NetBSD.org>
Subject: Re: kern/47974: udf tests fail due to interaction with rump
Date: Sun, 30 Jun 2013 16:04:10 +0200

 It seems that all file systems get passed 8 here, which sounds like a bug
 in rump somewhere.

 Martin

From: Nicolas Joly <njoly@pasteur.fr>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, reinoud@NetBSD.org
Subject: Re: kern/47974: udf tests fail due to interaction with rump
Date: Sun, 30 Jun 2013 16:36:57 +0200

 On Sat, Jun 29, 2013 at 10:45:00PM +0000, Martin Husemann wrote:
 > The following reply was made to PR kern/47974; it has been noted by GNATS.
 > 
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/47974: udf tests fail due to interaction with rump
 > Date: Sun, 30 Jun 2013 00:43:24 +0200
 > 
 >  It dies here:
 >  
 >  Breakpoint 1, udf_mount (mp=0x7f7ff77aa000, path=0x416014 "/mnt", 
 >      data=0x7f7ff7b6e0d8, data_len=0x7f7fffffd8a8)
 >      at /usr/src/sys/rump/fs/lib/libudf/../../../../fs/udf/udf_vfsops.c:317
 >  317     {
 >  (gdb) n
 >  318             struct lwp *l = curlwp;
 >  (gdb) 
 >  326             if (*data_len < sizeof *args)
 >  (gdb) print *data_len
 >  $1 = 8
 >  (gdb) print sizeof *args
 >  $2 = 80
 >  
 >  and does:
 >  
 >  326             if (*data_len < sizeof *args)
 >  327                     return EINVAL;
 >  
 >  
 >  I can't find my way through the fstest macros right now sizeof(udf_mount_args)
 >  vs. sizeof(udf_mount_args*) somewhere?

 Had a quick look into fstest_udf.c, and udftestargs definition looks
 strange :

 struct udftestargs {
         struct ufs_args ta_uargs;
         char ta_devpath[MAXPATHLEN];
         char ta_imgpath[MAXPATHLEN];
 };

 Shouldn't ta_uargs be of type udf_args not ufs_args ?

 -- 
 Nicolas Joly

 Biology IT Center
 Institut Pasteur, Paris.

From: Martin Husemann <martin@duskware.de>
To: Nicolas Joly <njoly@pasteur.fr>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, reinoud@NetBSD.org
Subject: Re: kern/47974: udf tests fail due to interaction with rump
Date: Sun, 30 Jun 2013 16:39:54 +0200

 On Sun, Jun 30, 2013 at 04:36:57PM +0200, Nicolas Joly wrote:
 > struct udftestargs {
 >         struct ufs_args ta_uargs;
 >         char ta_devpath[MAXPATHLEN];
 >         char ta_imgpath[MAXPATHLEN];
 > };
 > 
 > Shouldn't ta_uargs be of type udf_args not ufs_args ?

 Sounds like a winner, thanks!

 Martin

From: Martin Husemann <martin@duskware.de>
To: Nicolas Joly <njoly@pasteur.fr>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, reinoud@NetBSD.org
Subject: Re: kern/47974: udf tests fail due to interaction with rump
Date: Sun, 30 Jun 2013 16:58:47 +0200

 On Sun, Jun 30, 2013 at 04:36:57PM +0200, Nicolas Joly wrote:
 > Shouldn't ta_uargs be of type udf_args not ufs_args ?

 That helps a bit, but the args also need initialization:

 (gdb) 
 349             if (args->version != 1) {
 (gdb) 
 350                     printf("mount_udf: unrecognized argument structure version\n");
 (gdb) print *args
 $3 = {version = 0, fspec = 0x7f7ff77a7050 "/dev/device0.udf", sessionnr = 0, 
   udfmflags = 0, gmtoff = 0, anon_uid = 0, anon_gid = 0, nobody_uid = 0, 
   nobody_gid = 0, sector_size = 0, reserved = '\000' <repeats 31 times>}


 Martin

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47974 CVS commit: src/tests/fs/common
Date: Sun, 30 Jun 2013 15:05:49 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Jun 30 15:05:49 UTC 2013

 Modified Files:
 	src/tests/fs/common: fstest_udf.c

 Log Message:
 Fix copy & pasto, notice by Nicolas Joly, one step closer to solving
 PR kern/47974.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/fstest_udf.c

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

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: reinoud@NetBSD.org
Subject: Re: PR/47974 CVS commit: src/tests/fs/common
Date: Sun, 30 Jun 2013 17:37:44 +0200

 With some more tuning it now end up with:

 udf_mountfs (args=0x7f7ff7b66be0, l=0x7f7ff7b62000, mp=0x7f7ff6fc0000, 
     devvp=0x7f7ff6f01250)
     at /usr/src/sys/rump/fs/lib/libudf/../../../../fs/udf/udf_vfsops.c:612
 612             sector_size = ump->discinfo.sector_size;
 (gdb) 
 614             while ((1 << bshift) < sector_size)
 (gdb) print sector_size
 $7 = 512

 since the discinfo could not be retrieved from the image via MMCGETDISCINFO,
 the default values have been filled in:

 (gdb) print ump->discinfo 
 $9 = {mmc_profile = 1, mmc_class = 1, disc_state = 3 '\003', 
   last_session_state = 3 '\003', bg_format_state = 3 '\003', 
   link_block_penalty = 0 '\000', mmc_cur = 3106, mmc_cap = 3106, 
   disc_flags = 8, disc_id = 0, disc_barcode = 0, application_code = 0 '\000', 
   unused1 = "\000\000", last_possible_lba = 10000, sector_size = 512, 
   num_sessions = 1, num_tracks = 1, first_track = 1, 
   first_track_last_session = 1, last_track_last_session = 1, unused2 = 0, 
   reserved1 = {0, 0, 0, 0}, reserved2 = {0, 0, 0}, reserved3 = {0, 0, 0, 0, 0, 
     0, 0, 0}}


 but with the simplistic aproach to fake a all-0-image instead of newfs_udf
 I used, the mount fails because num_anchors is 0:

 661             /* read all anchors to get volume descriptor sequence */
 662             num_anchors = udf_read_anchors(ump);
 663             if (num_anchors == 0)
 664                     return EINVAL;

 Reinoud, can you add -F support to newfs_udf? Untill then I see no use in
 including the udf tests in the official runs.

 Martin


From: Nicolas Joly <njoly@pasteur.fr>
To: Martin Husemann <martin@duskware.de>
Cc: Nicolas Joly <njoly@pasteur.fr>, gnats-bugs@NetBSD.org,
	kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, reinoud@NetBSD.org
Subject: Re: kern/47974: udf tests fail due to interaction with rump
Date: Sun, 30 Jun 2013 17:00:30 +0200

 On Sun, Jun 30, 2013 at 04:39:54PM +0200, Martin Husemann wrote:
 > On Sun, Jun 30, 2013 at 04:36:57PM +0200, Nicolas Joly wrote:
 > > struct udftestargs {
 > >         struct ufs_args ta_uargs;
 > >         char ta_devpath[MAXPATHLEN];
 > >         char ta_imgpath[MAXPATHLEN];
 > > };
 > > 
 > > Shouldn't ta_uargs be of type udf_args not ufs_args ?
 > 
 > Sounds like a winner, thanks!

 One more thing ... The code use newfs where newfs_udf is needed. But,
 unlike other tools, it can't create filesystem images and only operate
 on devices ...

 -- 
 Nicolas Joly

 Biology IT Center
 Institut Pasteur, Paris.

From: Reinoud Zandijk <reinoud@NetBSD.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org, reinoud@NetBSD.org
Subject: Re: PR/47974 CVS commit: src/tests/fs/common
Date: Sun, 30 Jun 2013 20:27:54 +0200

 On Sun, Jun 30, 2013 at 05:37:44PM +0200, Martin Husemann wrote:
 > but with the simplistic aproach to fake a all-0-image instead of newfs_udf
 > I used, the mount fails because num_anchors is 0:
 > 
 > 661             /* read all anchors to get volume descriptor sequence */
 > 662             num_anchors = udf_read_anchors(ump);
 > 663             if (num_anchors == 0)
 > 664                     return EINVAL;

 Thats logical since it detects the disc is not formatted.

 > Reinoud, can you add -F support to newfs_udf? Untill then I see no use in
 > including the udf tests in the official runs.

 Shouldn't be too hard i guess. I'll check soon.

 With regards,
 Reinoud

>Unformatted:

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.