Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8233)

Issue 313150043: TBR: i#2089 TLS init: add a safe read path for is_thread_tls_initialized()

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 4 months ago by bruening
Modified:
7 years, 4 months ago
Reviewers:
zhaoqin
CC:
dynamorio-devs_googlegroups.com
Visibility:
Public.

Description

Commit log for first patchset: --------------- i#2089 TLS init: add a safe read path for is_thread_tls_initialized() This is a first step toward solving several issues with is_thread_tls_initialized() by switching to using a new safe_read_tls_base() step. A new assembly routine and fault handling path are added, along with globals to avoid the complexity of attempting this during process init or exit. This also fixes the TLS issues with the Windows Subsystem for Linux (i#1986) and with other cases where it is very difficult to determine whether TLS is initialized or not: it is much simpler to simply attempt to read it. The new code is under an off-by-default option -safe_read_tls_init until we have the other pieces of the new TLS scheme in place. Without the forthcoming pieces, we incur a fault on every new thread init and exit. ---------------

Patch Set 1 #

Patch Set 2 : Committed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -54 lines) Patch
M core/arch/x86/x86.asm View 2 chunks +18 lines, -1 line 0 comments Download
M core/optionsx.h View 1 chunk +9 lines, -0 lines 0 comments Download
M core/unix/os.c View 6 chunks +74 lines, -29 lines 0 comments Download
A + core/unix/os_asm_defines.asm View 2 chunks +22 lines, -20 lines 0 comments Download
M core/unix/os_private.h View 1 chunk +6 lines, -0 lines 0 comments Download
M core/unix/os_public.h View 3 chunks +3 lines, -1 line 0 comments Download
M core/unix/signal.c View 2 chunks +15 lines, -2 lines 0 comments Download
M core/unix/tls.h View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 2
bruening
7 years, 4 months ago (2016-12-01 23:01:35 UTC) #1
bruening
7 years, 4 months ago (2016-12-01 23:01:38 UTC) #2
Committed as
https://github.com/DynamoRIO/dynamorio/commit/48869ad3cbf6fc27b708d4e4b0eef66...

Final commit log: 
---------------
i#2089 TLS init: add a safe read path for is_thread_tls_initialized()

This is a first step toward solving several issues with
is_thread_tls_initialized() by switching to using a new
safe_read_tls_base() step.  A new assembly routine and fault handling path
are added, along with globals to avoid the complexity of attempting this
during process init or exit.

This also fixes the TLS issues with the Windows Subsystem for Linux
(i#1986) and with other cases where it is very difficult to determine
whether TLS is initialized or not: it is much simpler to simply attempt to
read it.

The new code is under an off-by-default option -safe_read_tls_init until
we have the other pieces of the new TLS scheme in place.  Without the
forthcoming pieces, we incur a fault on every new thread init and exit.

Review-URL: https://codereview.appspot.com/313150043
---------------
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b