Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Mar 2021 15:57:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 253508] [rtld] RTLD_STATIC_TLS_EXTRA should be incresed
Message-ID:  <bug-253508-227-ezxmZvv9rX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-253508-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-253508-227@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=3D253508

Viktor =C5=A0tujber <viktor.stujber+freebsd-bugs_v4CCPfay@gmail.com> change=
d:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |viktor.stujber+freebsd-bugs
                   |                            |_v4CCPfay@gmail.com

--- Comment #1 from Viktor =C5=A0tujber <viktor.stujber+freebsd-bugs_v4CCPf=
ay@gmail.com> ---
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253508-227-ezxmZvv9rX>