RESOLVED FIXED Bug 175604
Make VM::scratchBufferForSize thread safe
https://bugs.webkit.org/show_bug.cgi?id=175604
Summary Make VM::scratchBufferForSize thread safe
Saam Barati
Reported 2017-08-15 16:03:36 PDT
We currently call it from many threads, but it's not thread safe ...
Attachments
patch (5.95 KB, patch)
2017-08-15 16:29 PDT, Saam Barati
ggaren: review+
Saam Barati
Comment 1 2017-08-15 16:29:21 PDT
Build Bot
Comment 2 2017-08-15 16:32:08 PDT
Attachment 318196 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/VM.h:574: The parameter name "size" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 3 2017-08-15 16:48:11 PDT
Comment on attachment 318196 [details] patch r=me
Mark Lam
Comment 4 2017-08-15 16:50:10 PDT
Comment on attachment 318196 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=318196&action=review r=me with issues resolved. > Source/JavaScriptCore/runtime/VM.cpp:1025 > + ScratchBuffer* newBuffer = ScratchBuffer::create(m_sizeOfLastScratchBuffer); Make sure that the newly allocated buffer's activeLength is set to 0. I'm not sure it's an issue, but I'm thinking of GC scanning it incorrectly if the active length is not set.
Saam Barati
Comment 5 2017-08-15 17:01:29 PDT
Comment on attachment 318196 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=318196&action=review >> Source/JavaScriptCore/runtime/VM.cpp:1025 >> + ScratchBuffer* newBuffer = ScratchBuffer::create(m_sizeOfLastScratchBuffer); > > Make sure that the newly allocated buffer's activeLength is set to 0. I'm not sure it's an issue, but I'm thinking of GC scanning it incorrectly if the active length is not set. ScratchBuffer() already sets it to zero
Saam Barati
Comment 6 2017-08-15 17:04:16 PDT
Radar WebKit Bug Importer
Comment 7 2017-08-15 17:04:48 PDT
Note You need to log in before you can comment on or make changes to this bug.