From nobody Wed Jun 22 11:51:38 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 CC81C876AE7 for ; Wed, 22 Jun 2022 11:51:39 +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 4LShYk37Lqz3HTn for ; Wed, 22 Jun 2022 11:51:38 +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 0D72725A03 for ; Wed, 22 Jun 2022 11:51:38 +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 25MBpbxU024247 for ; Wed, 22 Jun 2022 11:51:37 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25MBpbHJ024246 for emulation@FreeBSD.org; Wed, 22 Jun 2022 11:51:37 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, 22 Jun 2022 11:51:38 +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: New 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=1655898698; 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=gEFXLyEj7HMOXohvkhln88WpgfFVj60Mm5BJh+TVyIM=; b=CZTBOF5184VUTLk/V3bI3BUr1Orra5obDJNtkMX5StUN7D53+HGHr9rLof/tnFUK1wSe9x IFvbvJA6S01vj+zwEMkXj65xKbO7cjoDmhMkQ8kMPlA+F1QDBW5ErAA/1Q4K+QEPPdqZd8 0ln0ft7ksM8A+3sRWvw1pm4H8gYoxpe12LaPoR5KDno2lUhI6QIEoyYAddyAcwwwQLUB9s VcapoP12KF55G8rkNXou2QcvlttCCGi3nF608dr6CvAn6wSm4y0AiR7/6Q3BeoZh3KrUBi WxmF7QaJgdakrefTV4kRS7CDLz05Hi5kJO+9vtZzbvRvb9MaxVsgDA/kA9KgVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655898698; a=rsa-sha256; cv=none; b=Nph5nt598PRNNKIxk4FdChyMiOasm7a3fuSMh/8Uzm997vmCKebZ8TeuuXoQrzm/8xvK3Z THmQkDCNsG04HabQ53y2saen/njoBsCS1yDf2Y2x30c69dT1ynjfymck6Oor+JRBPG65WI imG5WTu/LinzC7+0OQI5QvU5OahjpO/hzvFyn1od6R2LJEuy340HbXWHGnGn3qawZlan96 wlpzAXPB6swUjLtwTjfAp7gU3UdVcVNAPyJA919FJWW3hZaByaRWWeDgDOu18vejde1iPA EeUE1Aqd1+hTNqSc7aRyxi2m5JdmgQIyeyPk2Kvfmoj6hbIjL2O5GoKM8ENpNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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 AuthorDate: 2022-06-22 11:49:40 +0000 Commit: Dmitry Chagin 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.=