From nobody Sun Nov 23 02:44:36 2025 X-Original-To: freebsd-current@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 4dDYG31RJlz6J4LZ for ; Sun, 23 Nov 2025 02:44:59 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-20.consmr.mail.gq1.yahoo.com (sonic301-20.consmr.mail.gq1.yahoo.com [98.137.64.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dDYFz71KBz3YSR for ; Sun, 23 Nov 2025 02:44:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=M+KUdlUu; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1763865892; bh=D0/9sFlrcV17p6N9Ide81Wy+9Km5bSkD0AsSKkzzhiA=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=M+KUdlUu10mnWMeNINUwATkOkbbZfduM7LtFBi1Erpyv8EX0ntqJCj9tDU+9wI92FEk9H91TK8YbG2KXMGyjZkCwotOQcWjavrzmGGzRmH9TRafXIV5svkGiSHihoTeP1Ic/WhasIPoAf2q9/YBjNUmv/akGjOO0RfVnkBsL+pyMgbw8KiO/p/gaykyMSb3eMqi4EHVUvqbB+Lstc6Ozk7I341TqfXkW1/gHclcdL42m5HVm7QVts/9+YrXLdJwaQvfUOC0O9pSnRkY8ZI3/Jpt0Zz2Lvee/t1gSZp/dclV0HVZvC7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2hxUUaVVCYch3UsNQJuvYqSvgA3MOwyw8KxCqOmhwXaPLkjbU0MU3Juy6dXh n91X7u1THY57ebtK8bo19LdqEHPv1ulM4czF7y4kTvC7XauqfVrDneSEdVkpRdfAnCQ9mtaa3AM_ YRU24Nl5YR7CyswFQtz59y0NumGlPthvwgNfiPFHx9k7lNQR_.Bss0pAyvNnvTMftUqAzcbhK8o5 2Cnac2fNCKL41ESMkrIVEog0MUILJxrYR3yfRZk5EOglBpRgO120R3wJoKJqUBG4WJOYmBF0ZT_G sQgfcQ86TOFAFJgxtHu7N8ZeoIPRt_IZ6WZ1dVBlQYDG_lAnx3F4G8p_6rfggYUxLH_uEwQ5yjG8 JAgzGCZ5DHLdEryxtZwzoT2lrChKtXo.gDuZEuFYPUCsUGKW5ByDf1.ovfdXhpX2KlK3CTolD7JS ugJ0S_.SeeggRIfrreiVhnQKJus4xGGRRmj6_S4j3YXK_KJIEmzCyiVVqFYvKhHYKBygkjLSpjUn 2btu4u4C2pFz5wLHKyqjStNJQBgW.Mn4UjL.P3cjyRpnrwesumZzdh920mmtuGBwUJ6yfidMneQI _MAN_BCSFPJN4Hc4CecHPy7.GwDyKWceHIbM5XFO3COrEDktz7EvTOvUOnnCuSfkyl2NED1Mq_rQ bp4fahu4.koF8vP5e7P3HFRqWDc30AanQ7ZExaZAobary2sxfezoENn.ULyTj_O_Q1A_jjWu1.bq QTpfV4LFPz7Zu7iyw X-Sonic-MF: X-Sonic-ID: 94d09ad1-de6f-4b50-b107-4c46ad940947 Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Sun, 23 Nov 2025 02:44:52 +0000 Received: by hermes--production-gq1-fdb64d996-8w8lr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 841f66cef50f011e8857eca645269cb8; Sun, 23 Nov 2025 02:44:47 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: mmap( MAP_ANON) is broken on current. (was Still seeing Failed assertion: "p[i] == 0" on armv7 buildworld) [*** latest test patch update working in i386 and armv7 chroot tests ***] From: Mark Millard In-Reply-To: <48467E94-9A3E-4287-998D-EC9360337275@yahoo.com> Date: Sat, 22 Nov 2025 18:44:36 -0800 Cc: bob prohaska , Adrian Chadd , Carl Shapiro , Ronald Klop , "Herbert J. Skuhra" Content-Transfer-Encoding: quoted-printable Message-Id: <3D910723-3325-425A-9E72-2F6DE99D1067@yahoo.com> References: <75CEABED-3CCB-4DB9-AC82-5980696C2A06@yahoo.com> <48467E94-9A3E-4287-998D-EC9360337275@yahoo.com> To: Konstantin Belousov , meloun.michal@gmail.com, FreeBSD Current , Warner Losh X-Mailer: Apple Mail (2.3826.700.81) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.47 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.969]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org,bsdimp.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.146:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[9]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; APPLE_MAILER_COMMON(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.146:from] X-Rspamd-Queue-Id: 4dDYFz71KBz3YSR On Nov 22, 2025, at 13:55, Mark Millard wrote: > Konstantin Belousov w rote on > Date: Sat, 22 Nov 2025 20:41:27 UTC : >=20 >> On Sat, Nov 22, 2025 at 10:19:38PM +0200, Konstantin Belousov wrote: >>> Please in addition to the patch, enable debug.vm_check_pg_zero. >>=20 >> And use the following patch (one more hunk for = vm_object_page_remove()): >>=20 >> diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c >> index 6b09552c5fee..76808b5ad7f1 100644 >> --- a/sys/vm/vm_map.c >> +++ b/sys/vm/vm_map.c >> @@ -1743,6 +1743,27 @@ vm_map_insert1(vm_map_t map, vm_object_t = object, vm_ooffset_t offset, >> (vm_size_t)(prev_entry->end - prev_entry->start), >> (vm_size_t)(end - prev_entry->end), cred !=3D NULL && >> (protoeflags & MAP_ENTRY_NEEDS_COPY) =3D=3D 0)) { >> + vm_object_t obj =3D prev_entry->object.vm_object; >> + if (obj !=3D NULL) { >> + struct pctrie_iter pages; >> + vm_page_t p; >> + >> + vm_page_iter_init(&pages, obj); >> + p =3D vm_radix_iter_lookup_ge(&pages, >> + OFF_TO_IDX(prev_entry->offset + >> + prev_entry->end - prev_entry->start)); >> + if (p !=3D NULL) { >> + KASSERT(p->pindex >=3D OFF_TO_IDX(prev_entry->offset + >> + prev_entry->end - prev_entry->start + >> + end - start), >> + ("FOUND page %p pindex %#jx " >> + "e %#jx %#jx %#jx %#jx", >> + p, p->pindex, (uintmax_t)prev_entry->offset, >> + (uintmax_t)prev_entry->end, >> + (uintmax_t)prev_entry->start, >> + (uintmax_t)(end - start))); >> + } >> + } >> /* >> * We were able to extend the object. Determine if we >> * can extend the previous map entry to include the >> diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c >> index 5b4517d2bf0c..e87047f9a380 100644 >> --- a/sys/vm/vm_object.c >> +++ b/sys/vm/vm_object.c >> @@ -1988,7 +1988,7 @@ vm_object_page_remove(vm_object_t object, = vm_pindex_t start, vm_pindex_t end, >> (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) =3D=3D = OBJPR_NOTMAPPED, >> ("vm_object_page_remove: illegal options for object %p", object)); >> if (object->resident_page_count =3D=3D 0) >> - return; >> + goto remove_pager; >> vm_object_pip_add(object, 1); >> vm_page_iter_limit_init(&pages, object, end); >> again: >> @@ -2061,6 +2061,7 @@ vm_object_page_remove(vm_object_t object, = vm_pindex_t start, vm_pindex_t end, >> } >> vm_object_pip_wakeup(object); >>=20 >> +remove_pager: >> vm_pager_freespace(object, start, (end =3D=3D 0 ? object->size : end) = - >> start); >> } >> @@ -2189,13 +2190,19 @@ vm_object_coalesce(vm_object_t prev_object, = vm_ooffset_t prev_offset, >> next_size >>=3D PAGE_SHIFT; >> next_pindex =3D OFF_TO_IDX(prev_offset) + prev_size; >>=20 >> - if (prev_object->ref_count > 1 && >> - prev_object->size !=3D next_pindex && >> + if (prev_object->ref_count > 1 || >> + prev_object->size !=3D next_pindex || >> (prev_object->flags & OBJ_ONEMAPPING) =3D=3D 0) { >> VM_OBJECT_WUNLOCK(prev_object); >> return (FALSE); >> } >>=20 >> + KASSERT(next_pindex + next_size > prev_object->size, >> + ("vm_object_coalesce: " >> + "obj %p next_pindex %#jx next_size %#jx obj_size %#jx", >> + prev_object, (uintmax_t)next_pindex, (uintmax_t)next_size, >> + (uintmax_t)prev_object->size)); >> + >> /* >> * Account for the charge. >> */ >> @@ -2222,26 +2229,13 @@ vm_object_coalesce(vm_object_t prev_object, = vm_ooffset_t prev_offset, >> * Remove any pages that may still be in the object from a previous >> * deallocation. >> */ >> - if (next_pindex < prev_object->size) { >> - vm_object_page_remove(prev_object, next_pindex, next_pindex + >> - next_size, 0); >> -#if 0 >> - if (prev_object->cred !=3D NULL) { >> - KASSERT(prev_object->charge >=3D >> - ptoa(prev_object->size - next_pindex), >> - ("object %p overcharged 1 %jx %jx", prev_object, >> - (uintmax_t)next_pindex, (uintmax_t)next_size)); >> - prev_object->charge -=3D ptoa(prev_object->size - >> - next_pindex); >> - } >> -#endif >> - } >> + vm_object_page_remove(prev_object, next_pindex, next_pindex + >> + next_size, 0); >>=20 >> /* >> * Extend the object if necessary. >> */ >> - if (next_pindex + next_size > prev_object->size) >> - prev_object->size =3D next_pindex + next_size; >> + prev_object->size =3D next_pindex + next_size; >>=20 >> VM_OBJECT_WUNLOCK(prev_object); >> return (TRUE); [The Email handling did not preserve much of the whitespace in the above diff.] > This completed the lib/clang/libllvm /and lib/clang/libclang/ > build activity from prior partial runs. So I started > buildworld over after doing the "rm -fr". It has completed > past the : >=20 > /usr/obj/usr/src/i386.i386/lib/clang/ >=20 > part of the buildworld and is continuing. >=20 > So far so good. >=20 >=20 > Is 15.0 going to hold off for the final form of this? Get > an EN later? The i386 chroot on amd64 boot-system test finished just fine: -------------------------------------------------------------- >>> World build completed on Sat Nov 22 21:58:09 UTC 2025 >>> World built in 2330 seconds, ncpu: 32, make -j10 -------------------------------------------------------------- As did the armv7 chroot on aarch64 boot-system test: -------------------------------------------------------------- >>> World build completed on Sat Nov 22 17:55:38 PST 2025 >>> World built in 11501 seconds, ncpu: 8, make -j8 -------------------------------------------------------------- (The -jN numbers combined with the RAM+SWAP figures achieved for each made for useful tests of the original problem.) Prior to the changes, each of those had to be restarted a bunch of times to finish the libprivatellvm.so.19 and=20 libprivateclang.so.19 parts of the overall build. The above tests were both made after the new assignment: # sysctl debug.vm_check_pg_zero=3D1 debug.vm_check_pg_zero: 0 -> 1 that enables some new, expensive INVARIANTS code. Note that the code for testing is not claimed to be the actual fix that will be used. It was for information gathering. As I understand things, the changes involved apply to all supported FreeBSD platforms, not just 32-bit i386 and armv7. It seems jemalloc 5.3.0 used the FreeBSD kernel somewhat differently and ran into a long standing problem: what it was doing should have been valid. None of the investigative update was to the jemalloc code. But it could be that, on review, tradeoff management could involve jemalloc code for all I know. As stands: /usr/src/sys/vm/vm_extern.h.orig /usr/src/sys/vm/vm_fault.c.orig /usr/src/sys/vm/vm_map.c.orig /usr/src/sys/vm/vm_object.c.orig /usr/src/sys/vm/vm_page.c.orig were created so that I could use them to restore my official pkgbase source (that is somewhat older). Side note: I've not sent this note to mmel at freebsd.org as it forwards to meloun.michal at gmail.com and: QUOTE Gmail has detected that this message 550-5.7.1 is likely unsolicited mail. To reduce the amount of spam = sent to 550-5.7.1 Gmail, this message has been blocked. END QUOTE I'll see if a direct send gets the same treatment. =3D=3D=3D Mark Millard marklmi at yahoo.com