From owner-freebsd-emulation@freebsd.org Sat Feb 13 17:16:47 2021 Return-Path: Delivered-To: freebsd-emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35724532CD6 for ; Sat, 13 Feb 2021 17:16:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DdH8v0r6mz4lHM for ; Sat, 13 Feb 2021 17:16:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 1CB92532DDB; Sat, 13 Feb 2021 17:16:47 +0000 (UTC) Delivered-To: emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C7FD532CD5 for ; Sat, 13 Feb 2021 17:16:47 +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 4DdH8v0Cnzz4lkK for ; Sat, 13 Feb 2021 17:16:47 +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 EAD2B1B053 for ; Sat, 13 Feb 2021 17:16:46 +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 11DHGk5r045654 for ; Sat, 13 Feb 2021 17:16:46 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 11DHGkpd045653 for emulation@FreeBSD.org; Sat, 13 Feb 2021 17:16:46 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www 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: Sat, 13 Feb 2021 17:16:47 +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: cem@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 MIME-Version: 1.0 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 17:16:47 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253337 --- Comment #7 from Conrad Meyer --- In exec, we map the stack with vm_map_stack() with rlim_cur (I think); in vm_map_stack, we set the init_ssize with MIN(sysctl kern.sgrowsiz, rlim_cur= ).=20=20 kern.sgrowsiz is 128kB. There's a comment about the behavior in vm/vm_map.c:4565. At line 4585 we insert the normal stack mapping. At line 4599 we insert the reservation for the unallocated portion of the stack with no access (---). We won't insert the --- mapping if gap_bot =3D=3D gap_top, which I think on= ly happens if kern.sgrowsiz happens to match the stack rlimit.rl_cur. So... a crappy workaround here might be to set kern.sgrowsiz to 8MB.=20 Obviously, that's system-wide, and doesn't chase rlim_cur. I'm not sure of= the ramifications. I don't think this actually faults in backing physical memo= ry pages, and both RW- and no-prot (---) pages consume the same amount of virt= ual memory. So it might be pretty harmless. --=20 You are receiving this mail because: You are the assignee for the bug.=