Bug 168971

Summary: Null pointer crash when loading module with unresolved import also as a script file
Product: WebKit Reporter: André Bargull <andre.bargull>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description André Bargull 2017-02-28 08:44:01 PST
svn revision: 213147

Test file, t.js:
---
import {x} from "./t.js"
---

STR:
- Start JSC shell with: ~/svn/webkit/WebKitBuild/Debug/bin/jsc -m t.js -f t.js

Crashes with:
---
Thread 1 "jsc" received signal SIGSEGV, Segmentation fault.
0x000000000046f5f0 in JSC::MarkedBlock::vm (this=0x0) at ../../Source/JavaScriptCore/heap/MarkedBlock.h:411
---

Stack trace:
---
#0  0x000000000046f5f0 in JSC::MarkedBlock::vm (this=0x0) at ../../Source/JavaScriptCore/heap/MarkedBlock.h:411
#1  0x000000000047c4fe in JSC::HeapCell::vm (this=0x0) at ../../Source/JavaScriptCore/heap/HeapCellInlines.h:67
#2  0x00007ffff68b2b32 in JSC::Interpreter::execute (this=0x7fffef5fe080, executable=0x7fffaed4c320, callFrame=0x7fffffffcd60, scope=0x0) at ../../Source/JavaScriptCore/interpreter/Interpreter.cpp:1173
#3  0x00007ffff6b9de2e in JSC::JSModuleRecord::evaluate (this=0x7fffaed500a0, exec=0x7fffffffcd60) at ../../Source/JavaScriptCore/runtime/JSModuleRecord.cpp:207
#4  0x00007ffff6b97bc7 in JSC::JSModuleLoader::evaluate (this=0x7fffaedb0190, exec=0x7fffffffcd60, key=..., moduleRecordValue=..., scriptFetcher=...)
    at ../../Source/JavaScriptCore/runtime/JSModuleLoader.cpp:238
#5  0x00007ffff6c28def in JSC::moduleLoaderPrototypeEvaluate (exec=0x7fffffffcd60) at ../../Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp:245
...
---
Comment 1 Radar WebKit Bug Importer 2017-03-01 22:36:03 PST
<rdar://problem/30801142>
Comment 2 Yusuke Suzuki 2017-03-02 01:31:57 PST
Created attachment 303181 [details]
Patch
Comment 3 Yusuke Suzuki 2017-03-02 01:33:59 PST
Created attachment 303182 [details]
Patch
Comment 4 Saam Barati 2017-03-04 17:27:29 PST
Comment on attachment 303182 [details]
Patch

r=me
Comment 5 Yusuke Suzuki 2017-03-06 08:29:55 PST
Comment on attachment 303182 [details]
Patch

Thanks!
Comment 6 WebKit Commit Bot 2017-03-06 08:57:14 PST
Comment on attachment 303182 [details]
Patch

Clearing flags on attachment: 303182

Committed r213452: <http://trac.webkit.org/changeset/213452>
Comment 7 WebKit Commit Bot 2017-03-06 08:57:19 PST
All reviewed patches have been landed.  Closing bug.