NetBSD Problem Report #59314

From www@netbsd.org  Thu Apr 17 14:29:50 2025
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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6DB1B1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 17 Apr 2025 14:29:50 +0000 (UTC)
Message-Id: <20250417142949.309411A923D@mollari.NetBSD.org>
Date: Thu, 17 Apr 2025 14:29:49 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: t_memfd_create:seal_grow is failing
X-Send-Pr-Version: www-1.0

>Number:         59314
>Category:       kern
>Synopsis:       t_memfd_create:seal_grow is failing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 17 14:30:00 +0000 2025
>Last-Modified:  Sat Apr 19 02:00:01 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The SparcBSD Memfdation
>Environment:
>Description:
FAILED: /tmp/build/2025.04.16.12.05.52-sparc64/src/tests/kernel/t_memfd_create.c:270: Mmap failed unexpectedly (Invalid argument)

https://releng.netbsd.org/b5reports/sparc64/2025/2025.04.16.12.05.52/test.html#kernel_t_memfd_create_seal_grow
>How-To-Repeat:
cd /usr/tests/kernel
atf-run t_memfd_create:seal_grow | atf-report
>Fix:
Yes, please!

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-sparc64-maintainer->kern-bug-people
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Thu, 17 Apr 2025 15:55:24 +0000
Responsible-Changed-Why:
Not sparc64-specific -- also failing on alpha:

https://releng.netbsd.org/b5reports/alpha/2025/2025.04.16.12.05.52/test.html#kernel_t_memfd_create_seal_grow


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59314 CVS commit: src/tests/kernel
Date: Thu, 17 Apr 2025 16:02:48 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Thu Apr 17 16:02:48 UTC 2025

 Modified Files:
 	src/tests/kernel: t_memfd_create.c

 Log Message:
 t_memfd_create: Print more diagnostic info about mmap failures.

 PR kern/59314: t_memfd_create:seal_grow is failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/tests/kernel/t_memfd_create.c

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

From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@netbsd.org
Cc: riastradh@NetBSD.org
Subject: Re: kern/59314 (t_memfd_create:seal_grow is failing)
Date: Fri, 18 Apr 2025 00:43:01 +0700

     Date:        Thu, 17 Apr 2025 15:55:24 +0000 (UTC)
     From:        riastradh@NetBSD.org
     Message-ID:  <20250417155524.B8B2A1A923D@mollari.NetBSD.org>

   | Synopsis: t_memfd_create:seal_grow is failing
   |
   | Responsible-Changed-From-To: port-sparc64-maintainer->kern-bug-people
   | Responsible-Changed-By: riastradh@NetBSD.org
   | Responsible-Changed-When: Thu, 17 Apr 2025 15:55:24 +0000
   | Responsible-Changed-Why:
   | Not sparc64-specific -- also failing on alpha:

 This is (probably) not a kernel bug either, but a test bug.

 It looks as if the test is assuming that the page size (and
 hence minimum possible mmap() result, whatever is requested)
 is 4K, what sparc64 and alpha have in common is 8K pages.

 Make "write_buf" in that test be 16K (so sizeof(write_buf)/2
 is still not less than a page) and try them again.

 kre

 (I have no sparcs any more, no emulators either, and my alpha
 has been defunct for decades, though it is still sitting there...)
 so I can't easily test this myself.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59314 CVS commit: src/tests/kernel
Date: Fri, 18 Apr 2025 19:22:14 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Apr 18 19:22:14 UTC 2025

 Modified Files:
 	src/tests/kernel: t_memfd_create.c

 Log Message:
 t_memfd_create: Scale read_buf and write_buf by page size.

 Guessing they were probably written for x86, so assume 8192 bytes
 meant 2*pagesize.

 Suggested by kre@.

 PR kern/59314: t_memfd_create:seal_grow is failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/tests/kernel/t_memfd_create.c

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

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59314 CVS commit: src/tests/kernel
Date: Sat, 19 Apr 2025 01:56:50 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Apr 19 01:56:50 UTC 2025

 Modified Files:
 	src/tests/kernel: t_memfd_create.c

 Log Message:
 t_memfd_create: Cast size_t to off_t, not vice versa.

 off_t is always 64-bit; size_t may be 32- or 64-bit depending on the
 architecture and ABI, so casting off_t to size_t may truncate.

 Should better resolve this build failure (not sure how I missed it,
 definitely compile-tested at least this file on two different
 architectures, one of which was evbmips64-eb and the other I have
 forgotten):

 /tmp/build/2025.04.18.20.51.31-sparc64/src/tests/kernel/t_memfd_create.c:129:9: error: comparison of integer expressions of different signedness: '__off_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]
   129 |         ATF_REQUIRE_EQ_MSG(offset, rwbuf_size,
       |         ^~~~~~~~~~~~~~~~~~

 PR kern/59314: t_memfd_create:seal_grow is failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/tests/kernel/t_memfd_create.c

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.