Changeset 216953 in webkit
- Timestamp:
- May 16, 2017, 4:06:53 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r216952 r216953 1 2017-05-16 Mark Lam <mark.lam@apple.com> 2 3 WorkerRunLoop::Task::performTask() needs to null check context->script() before use. 4 https://bugs.webkit.org/show_bug.cgi?id=172193 5 <rdar://problem/32225346> 6 7 Reviewed by Filip Pizlo. 8 9 According to https://build-safari.apple.com/results/Trunk%20Fuji%20GuardMalloc%20Production%20WK2%20Tests/r216929_459760e0918316187c8e52c6585a3a9ba9181204%20(12066)/results.html, 10 we see a crash with this crash trace: 11 12 Thread 13 Crashed:: WebCore: Worker 13 0 com.apple.WebCore 0x00000001099607b2 WebCore::WorkerScriptController::isTerminatingExecution() const + 18 14 1 com.apple.WebCore 0x000000010995ebbf WebCore::WorkerRunLoop::runCleanupTasks(WebCore::WorkerGlobalScope*) + 143 15 2 com.apple.WebCore 0x000000010995e80f WebCore::WorkerRunLoop::run(WebCore::WorkerGlobalScope*) + 111 16 3 com.apple.WebCore 0x00000001099621b6 WebCore::WorkerThread::workerThread() + 742 17 4 com.apple.JavaScriptCore 0x000000010a964b92 WTF::threadEntryPoint(void*) + 178 18 5 com.apple.JavaScriptCore 0x000000010a964a69 WTF::wtfThreadEntryPoint(void*) + 121 19 6 libsystem_pthread.dylib 0x00007fffbdb5caab _pthread_body + 180 20 7 libsystem_pthread.dylib 0x00007fffbdb5c9f7 _pthread_start + 286 21 8 libsystem_pthread.dylib 0x00007fffbdb5c1fd thread_start + 13 22 23 ... and the crashing address is: 24 25 Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000022 26 27 0x0000000000000022 is the offset of m_scheduledTerminationMutex in the 28 WorkerScriptController. This means that WorkerScriptController::isTerminatingExecution() 29 is passed a NULL this pointer. This means that it's possible to have a race 30 where a WorkerRunLoop::Task gets enqueued beyond the Cleanup task that deletes the 31 context->script(). As a result, WorkerRunLoop::Task::performTask() (called by 32 runCleanupTasks()) may see a null context->script(). 33 34 Hence, WorkerRunLoop::Task::performTask() should null check context->script() 35 before invoking the isTerminatingExecution() query on it. 36 37 No new tests because this is already covered by existing tests. 38 39 * workers/WorkerRunLoop.cpp: 40 (WebCore::WorkerRunLoop::Task::performTask): 41 1 42 2017-05-16 Youenn Fablet <youenn@apple.com> 2 43 -
trunk/Source/WebCore/workers/WorkerRunLoop.cpp
r216876 r216953 255 255 void WorkerRunLoop::Task::performTask(WorkerGlobalScope* context) 256 256 { 257 ASSERT(context->script()); 258 if ((!context->isClosing() && !context->script()->isTerminatingExecution()) || m_task.isCleanupTask()) 257 if ((!context->isClosing() && context->script() && !context->script()->isTerminatingExecution()) || m_task.isCleanupTask()) 259 258 m_task.performTask(*context); 260 259 }
Note:
See TracChangeset
for help on using the changeset viewer.