Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2022 11:51:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        emulation@FreeBSD.org
Subject:   [Bug 253337] Linuxulator: glibc's pthread_getattr_np reports stack size as 124K
Message-ID:  <bug-253337-4077-E0WXlPHkBq@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-253337-4077@https.bugs.freebsd.org/bugzilla/>
References:  <bug-253337-4077@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=3D253337

--- Comment #14 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3Def1976ccf5420d0912afcb49733c7a886=
43069da

commit ef1976ccf5420d0912afcb49733c7a88643069da
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-06-22 11:49:40 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-22 11:49:40 +0000

    linprocfs: Skip printing of the guard page in the /proc/self/maps

    To calculate the base (lowest addressable) address of the stack of the
    initial thread glibc parses /proc/self/maps.
    In fact, the base address is calculated as 'to' value of stack entry of=
 the
    /proc/self/maps - stack size limit (if the stack grows down).
    The base address should fit in between preceding entry and stack entry =
of
    the /proc/self/maps.
    In FreeBSD, since 19bd0d9 (Implement address space guards), we actually
    have two mappings for the stack region. The first one is the no-access
    mapping for the region the stack can grow into (guard page), and the
    second - initial stack region with size sgrowsiz.
    The first mapping confuses Glibc, in the end which is improperly
    calculate stack size and the base address.

    PR:                     253337
    Reviewed by:            kib
    Differential revision:  https://reviews.freebsd.org/D35537
    MFC after:              2 week

 sys/compat/linprocfs/linprocfs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--=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-253337-4077-E0WXlPHkBq>