Closed Bug 974418 Opened 12 years ago Closed 11 years ago

TSan: data race js/src/vm/NativeObject.h:218 clearShouldConvertDoubleElements

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: decoder, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Whiteboard: [tsan])

Attachments

(3 files)

The attached logfile shows a thread/data race (mozilla-central revision file/tsan-trace100.txt) 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
I think the revision here was meant to be 44ba69cacd7e.
This race is still present.
Summary: TSan: data race js/src/vm/ObjectImpl.h:818 clearShouldConvertDoubleElements → TSan: data race js/src/vm/NativeObject.h:218 clearShouldConvertDoubleElements
Attached file js-jit-header-race.txt —
Here's a more modern trace showing the same problem. Jan, do you know if anybody's able to take a look at this?
Flags: needinfo?(jdemooij)
Attached patch Patch — — Splinter Review
Nathan, sorry for the delay. The problem is that we set/clear the convertDoubleElements flag on the NewArray template object in IonBuilder and CodeGenerator accesses this field. With this patch we no longer modify the template object but store the flag on MNewArray instead. We now also pass the convertDoubleElements flag to the NewArray VM function, to avoid an unnecessary double conversion later on when that path is used (might matter for some large arrays).
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Flags: needinfo?(jdemooij)
Attachment #8575233 - Flags: review?(bhackett1024)
(In reply to Jan de Mooij [:jandem] from comment #4) > Nathan, sorry for the delay. No problem, thanks for looking at this!
...and just to confirm, the posted patch eliminates the data race according to a TSan run.
Attachment #8575233 - Flags: review?(bhackett1024) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: