TSan: data race js/src/../../js/src/assembler/assembler/MacroAssemblerX86Common.h:1283 getSSEState

RESOLVED INCOMPLETE

Status

()

Core
JavaScript Engine
--
critical
RESOLVED INCOMPLETE
4 years ago
3 years ago

People

(Reporter: decoder, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [tsan])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 8370097 [details]
Logfile with TSan trace

The attached logfile shows a thread/data race (mozilla-central revision 44ba69cacd7e) detected by TSan (ThreadSanitizer).

Typically, races reported by TSan are not false positives, but it is possible that the race is benign. Even in this case though, we should try to come up with a fix unless this would cause inacceptable performance issues. Also note that seemingly benign races can possibly be harmful (also depending on the compiler and the architecture) [1].

If the bug cannot be fixed, then this bug should be used to either make a compile-time annotation for blacklisting or add an entry to the runtime blacklist.

[1] http://software.intel.com/en-us/blogs/2013/01/06/benign-data-races-what-could-possibly-go-wrong
The background thread is calling MacroAssemblerX86Common::setSSECheckState() for asm.js compilation. This can race with the main thread also calling getSSEState(). I don't think it's a real problem, worst case we call setSSECheckedState multiple times but that's fine.

We could make s_sseCheckState an Atomic or so, or call getSSEState() from JS_Init (or similar location) to force initialization on the main thread.
(Assignee)

Updated

4 years ago
Assignee: general → nobody
I haven't seen any reaces like this, and the code for the JIT has been refactored quite a bit in the 18 months since this report, so I'm going to close this bug.  We can file a new bug later if need be.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.