NEW 202295
Bytecode cache should defer GC and hold API lock while encoding
https://bugs.webkit.org/show_bug.cgi?id=202295
Summary Bytecode cache should defer GC and hold API lock while encoding
Tadeu Zagallo
Reported 2019-09-26 15:30:55 PDT
...
Attachments
Patch (6.92 KB, patch)
2019-09-26 15:49 PDT, Tadeu Zagallo
saam: review+
Tadeu Zagallo
Comment 1 2019-09-26 15:49:28 PDT
Saam Barati
Comment 2 2019-09-26 15:51:41 PDT
Comment on attachment 379691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379691&action=review > Source/JavaScriptCore/ChangeLog:11 > + We already hold the API lock in generateProgramBytecode/generateModuleBytecode, but we should also hold > + the API lock in the larger scope of the public methods in JSScript. Additionally, we should DeferGC as > + part of generateProgramBytecode/generateModuleBytecode, to ensure that the code generated is not collected > + before being serialized. is this definitely what's happening? Can we test it?
Tadeu Zagallo
Comment 3 2019-09-26 15:56:22 PDT
(In reply to Saam Barati from comment #2) > Comment on attachment 379691 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=379691&action=review > > > Source/JavaScriptCore/ChangeLog:11 > > + We already hold the API lock in generateProgramBytecode/generateModuleBytecode, but we should also hold > > + the API lock in the larger scope of the public methods in JSScript. Additionally, we should DeferGC as > > + part of generateProgramBytecode/generateModuleBytecode, to ensure that the code generated is not collected > > + before being serialized. > > is this definitely what's happening? Can we test it? I don't know whether this is actually happening in practice, but I believe the code was not correct before. I'll try to come up with a test, and will land as a follow up if I can reproduce the hypothetical crash.
Radar WebKit Bug Importer
Comment 4 2019-09-26 16:36:10 PDT
Note You need to log in before you can comment on or make changes to this bug.