From nobody Sun Apr 16 21:05:49 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q02lf0NJSz44k14 for ; Sun, 16 Apr 2023 21:05:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q02ld5LTVz4G0v for ; Sun, 16 Apr 2023 21:05:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681679149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ks17tDSLz4hJSHCpK0obPF2ycWvOR8aBMhRr/RFB6HU=; b=OZQ28LpcIyLnlLQIi2AfzhZ+jnPpxCNCkKqJufUaE8TlxZfqUXlrB/o7a5jkuOBg7WSKWO 3uFYypuHqyr4VH1lJjczHX4ePIsjJQypKFHkD7MBp/Ha6I3dtStGoXJOaozfAw+bEwBmh9 cvuxwEYd0glZd24ppGCDVHd4FVNISkbW+EJTzsnlyKx7N6OJJEx9MhzGXWlInUbhSLAacN 5UJmaqapy95oZgnhoW6dAAM5Dhqj0uU4L1gyllJTCDH3ObdU93GtT+ygMY0EUW65wzXXzP WMATjFWUFbyLHIwnzYyKKUGsLqvbhaTb8zwDOGmaiHLsw7cUhAsy48b81ypdYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681679149; a=rsa-sha256; cv=none; b=liGmfETwkWlLNfFnIZ2z0r51SvC/YUcHZE53+VSYrgKEy3D0AMo/QS6JjgcNKbgjeY/oNF Tx+LQBh0er+84adujVY419JvYVRj2tKY+WJvsqZUi/h6YiY/ehnCfL3sWudsqeMVF8uh15 z3uQMsaqLcUSG878oFvzAUy3xWCEdkecUUEYR1JbNNcF93Hitv2WE1IIO6d0yTw5yjPBqq 2wfS/QD2ZXxJwwdqYwk4PjleV1F3+3SRJvk7KsiCrywr0sPaapN3ZmbbzCGrUoRnTTiMm1 4ubjimGa4+17uRCYwtxreo5m7mGogiWFp+AOpO91CWRl5V9TXa47zJYV2ZtdbA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q02ld4QqMz12j5 for ; Sun, 16 Apr 2023 21:05:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 33GL5nJg008478 for ; Sun, 16 Apr 2023 21:05:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33GL5nYm008476 for bugs@FreeBSD.org; Sun, 16 Apr 2023 21:05:49 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 270810] munmap does not always sync the underlying file Date: Sun, 16 Apr 2023 21:05:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: geoffrey@dommett.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270810 --- Comment #6 from geoffrey@dommett.com --- The smallest test program that I have replicated this with is below. When run on a linux machine the problem does not occur, when writing to the= nfs server running bsd. When run on a bsd machine, the problem seems to occur if the number of instances run is sufficient that the machine has insufficient ram that it m= ust page between the files and the in memory copy to complete the operation. Wh= en running 50 instances is enough on the machine in front of me with 8gb of ram about 30% of them are corrupt at the end. It does not occur running just a = few instances.=20 Running 50 instances of this test on a bsd machine with 96Gb ram, 1 of them= is corrupt. This same machine exhibits a lot of corruption when 300+ Gb of fil= es are mapped. I think all times I have encountered this have been when the total files ma= pped exceed the physical ram of the machine. leaving in or commenting out the msync, fsync and ftruncate at the end does= not stop the file corruption.=20 #include #include #include #include #include #include int main (int argv , char** argc ) { int fl=3Dopen(argc[1] , O_RDWR | O_CREAT , 0644 ) ; lseek(fl,1000000000 , SEEK_SET); write(fl, "", 1); int * ttv =3D (int*) mmap(0,100000000 , PROT_WRITE | PROT_READ ,MAP_SHARED= , fl , 0) ; for (int j=3D0 ; j<10 ; j++) { for (int ii =3D j ; ii<100000000/4 ; ii+=3D10 ) ttv[ii]=3Dii ; } //msync(ttv , 10000000000, MS_SYNC ) ; //fsync(fl) ; //ftruncate(fl ,9000000000) ; close(fl) ; } --=20 You are receiving this mail because: You are the assignee for the bug.=