From owner-freebsd-bugs@freebsd.org Tue Mar 2 15:57:53 2021 Return-Path: Delivered-To: freebsd-bugs@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 0DBEB56E3B6 for ; Tue, 2 Mar 2021 15:57:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4Dqhc06pglz4dV1 for ; Tue, 2 Mar 2021 15:57:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id E9B0B56E3B5; Tue, 2 Mar 2021 15:57:52 +0000 (UTC) Delivered-To: bugs@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 E97B256E328 for ; Tue, 2 Mar 2021 15:57:52 +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 4Dqhc06DLzz4dRX for ; Tue, 2 Mar 2021 15:57:52 +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 C4D1F19984 for ; Tue, 2 Mar 2021 15:57:52 +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 122FvqaA080435 for ; Tue, 2 Mar 2021 15:57:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 122FvqBu080434 for bugs@FreeBSD.org; Tue, 2 Mar 2021 15:57:52 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: bugs@FreeBSD.org Subject: [Bug 253508] [rtld] RTLD_STATIC_TLS_EXTRA should be incresed Date: Tue, 02 Mar 2021 15:57:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: toolchain X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: viktor.stujber+freebsd-bugs_v4CCPfay@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:57:53 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253508 Viktor =C5=A0tujber change= d: What |Removed |Added ---------------------------------------------------------------------------- CC| |viktor.stujber+freebsd-bugs | |_v4CCPfay@gmail.com --- Comment #1 from Viktor =C5=A0tujber --- Any developer can drive up the static tls area size requirement arbitrarily high by flagging their thread variables with __attribute__((tls_model("initial-exec"))), especially if it's done careles= sly on a large struct or array. Increasing the value might be worthwhile if developers find the current value too limiting for modern applications. Otherwise I would first turn to the developer to review and revise their possibly flawed approach. So far I have submitted the issue as https://bugs.php.net/bug.php?id=3D80814 I have not had the time to review code history for freebsd's rtld and php's TSRM to maybe figure out when this all started, why it was done, and if freebsd's RTLD_STATIC_TLS_EXTRA is meant for general-purpose use. An interesting old discussion regarding abuse of initial-exec at https://bugs.freedesktop.org/show_bug.cgi?id=3D35268#c15 brings up -mtls-dialect=3Dgnu2 enabling the use of TLS descriptors to achieve improve= d tls performance. IRC #clang thinks that dynamically loading modules flagged as DF_STATIC_TLS= is sketchy and that those should really only be loaded along with the main executable. There's also a handy blog post from 2 weeks ago by a LLVM developer at https://maskray.me/blog/2021-02-14-all-about-thread-local-storage that I us= ed as a source of info. It considers this usage 'obscure', but then brings up = an 'async signal safety' issue for the dynamic modes. --=20 You are receiving this mail because: You are the assignee for the bug.=