Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Oct 2021 16:13:00 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 259076] pthread_mutex_init fails with limited AS
Message-ID:  <bug-259076-227-nWLrQ0RDlK@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-259076-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-259076-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259076

Konstantin Belousov <kib@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kib@FreeBSD.org

--- Comment #1 from Konstantin Belousov <kib@FreeBSD.org> ---
Yes, I think something along these lines should help.
Can you confirm?

diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c
index 6604aa7201f8..61c18abb0d49 100644
--- a/libexec/rtld-elf/rtld_malloc.c
+++ b/libexec/rtld-elf/rtld_malloc.c
@@ -184,7 +184,9 @@ morecore(int bucket)
                nblks =3D 1;
        }
        if (amt > pagepool_end - pagepool_start)
-               if (morepages(amt/pagesz + NPOOLPAGES) =3D=3D 0)
+               if (morepages(amt / pagesz + NPOOLPAGES) =3D=3D 0 &&
+                   /* Retry with min required size */
+                   morepages(amt / pagesz) =3D=3D 0)
                        return;
        op =3D (union overhead *)pagepool_start;
        pagepool_start +=3D amt;

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259076-227-nWLrQ0RDlK>