NEW 220531
Calling Blob.stream() causes null pointer dereference and be reproduced on Safari Tech Preview
https://bugs.webkit.org/show_bug.cgi?id=220531
Summary Calling Blob.stream() causes null pointer dereference and be reproduced on Sa...
wz906234737
Reported 2021-01-11 21:49:14 PST
Created attachment 417432 [details] the script caused crash 1. Reproduce of the bug: (1) open inspector window in `MiniBrowser`, running the following code (also attached as file) in console (2) script: // =================================== (function () { const _1 = [new File(['content'], 'file1'),'a2'] const _0 = new File(_1, 'file2'); return _0.stream(); })(); // =================================== It will cause a `Segmentation fault` crash. Using gdb to analysis the core dump file, you can find a null pointer dereference. Part of the backtrace: #0 0x00007f32b1cb4322 in JSC::ArrayBufferContents::sizeInBytes() const (this=0x10) at DerivedSources/ForwardingHeaders/JavaScriptCore/ArrayBuffer.h:82 #1 0x00007f32b1cb4301 in JSC::ArrayBufferContents::data() const (this=0x10) at DerivedSources/ForwardingHeaders/JavaScriptCore/ArrayBuffer.h:81 #2 0x00007f32b23804e8 in JSC::ArrayBuffer::data() (this=0x0) at DerivedSources/ForwardingHeaders/JavaScriptCore/ArrayBuffer.h:187 --------^ null pointer here --------- #3 0x00007f32b52745fa in WebCore::FileReaderLoader::didReceiveData(char const*, int) (this=0x7f3297ff9dc8, data=0x7f3297f2e040 "content", dataLength=7) at ../../../Source/WebCore/fileapi/FileReaderLoader.cpp:209 __PRETTY_FUNCTION__ = "virtual void WebCore::FileReaderLoader::didReceiveData(const char*, int)" length = 7 remainingBufferSpace = 9 p.s. If you remove the `_0.stream()`, it will be safe. 2. I also reproduce the bug on `Safari Technology Preview` version on macbook. But it cannot be reproduced on `Safari Stable` version.
Attachments
the script caused crash (140 bytes, text/javascript)
2021-01-11 21:49 PST, wz906234737
no flags
or just using Blob (123 bytes, text/plain)
2021-01-13 00:16 PST, wz906234737
no flags
wz906234737
Comment 1 2021-01-13 00:16:57 PST
Created attachment 417515 [details] or just using Blob
Radar WebKit Bug Importer
Comment 2 2021-01-18 21:50:13 PST
Note You need to log in before you can comment on or make changes to this bug.