From nobody Wed Jul 06 11:04:34 2022 X-Original-To: emulation@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 848471D02302 for ; Wed, 6 Jul 2022 11:04:36 +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 4LdGry4tXGz3NgN for ; Wed, 6 Jul 2022 11:04:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 72BBF18EE8 for ; Wed, 6 Jul 2022 11:04:34 +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 266B4YvE059740 for ; Wed, 6 Jul 2022 11:04:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 266B4Yo5059739 for emulation@FreeBSD.org; Wed, 6 Jul 2022 11:04:34 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: emulation@FreeBSD.org Subject: [Bug 253337] Linuxulator: glibc's pthread_getattr_np reports stack size as 124K Date: Wed, 06 Jul 2022 11:04:34 +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: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: emulation@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: Development of Emulators of other operating systems List-Archive: https://lists.freebsd.org/archives/freebsd-emulation List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-emulation@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657105475; 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=s9veleizGxua8eSz1E2jj79OP6YvRNSxTlbTEZbb71Q=; b=fellTGQO0BCRCjfONAJ8PsP+tmm4GFJTTDJf7woI1XjYrfZaGa6UzHyQ2BwLVnipleOrDE iCzWrEatRP2p+VVhWIRPDL+Xp4RHlTDcYl3AiVAGliSyHEASmnnhPrXccGzqr3uOO6JCZq MClei4rpfxQxhqRwM6P/LAUKUS9nq2yjYTpajGyzPj1fQ0SY/jgsWbwryu2/7sZx+ACcXx Ugni+BXyzsA4myQb9Kgmn6/sUAf9NMxJJ4b0IXj4ZY/zrFGF9Vt7bp/6UWbsselweRE7MP Y/RQ3+5lRlk88dKhxQEa/+nVaruKWEEwvNzSp70+LHx+Puf1gUfacQMrMotNVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657105475; a=rsa-sha256; cv=none; b=pjHMmY+ESfzV4c2mrBBVQZ2jrfs2oKFGZSHs/Znmne3tI2Pc3hD/nvPQjmSrTAdxZCSCkS AcMEwy/P2PI6E4Kyo3m2sipYbkYzuMlD0MyhzJNrl8vdB/IWmS6GCwn6rHnv6c8tQ+68NH GV55LXiNLeuGKQ6Uc7oExX5jOZJZYnDusLnUB9B4R0FqtjYP2ztcVFq77Wc0quSb2vmvc6 V9DyvL7rvBPgNTcIeH4hZ65cW4aMEToSaSjIxCEJTpCLme7iJ/sbJ0XmPnTYZtv0UxsDCn X0HBpXJnecVCK3jbacGn9C+7bXKiFOhzKqT5apIsaUKveVv8jltnuqCk4l9J6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253337 --- Comment #15 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Db1d0fe755bb11be36d97885dbab0ac66a= abb5877 commit b1d0fe755bb11be36d97885dbab0ac66aabb5877 Author: Dmitry Chagin AuthorDate: 2022-06-22 11:49:40 +0000 Commit: Dmitry Chagin CommitDate: 2022-07-06 11:02:15 +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 (cherry picked from commit ef1976ccf5420d0912afcb49733c7a88643069da) 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.=