# How to repro:
I found this while writing WPT tests for Worklets with SW interception.
1) Apply https://chromium-review.googlesource.com/c/chromium/src/+/758973
2) run-webkit-tests external/wpt/worklets/paint-worklet-service-worker-interception.https.html
This test throws an exception because of 'undefined' attribute access in a controlled window. If it works without the crash, the test should simply time out.
# Callstack
Crash reason: SIGSEGV
Crash address: 0x0
Process uptime: not available
Thread 18 (crashed)
0 libcontent.so!content::EmbeddedWorkerInstance::status() const + 0xc
1 libcontent.so!running_status [service_worker_version.h : 152 + 0x5]
2 libcontent.so!StopWorker [service_worker_version.cc : 506 + 0xc]
3 libcontent.so!DidGetAllRegistrations [service_worker_context_core.cc : 145 + 0xc]
4 libcontent.so!Invoke<const scoped_refptr<content::(anonymous namespace)::ClearAllServiceWorkersHelper> &, const base::WeakPtr<content::ServiceWorkerContextCore> &, content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &> [bind_internal.h : 194 + 0x6]
5 libcontent.so!MakeItSo<void (content::(anonymous namespace)::ClearAllServiceWorkersHelper::*const &)(const base::WeakPtr<content::ServiceWorkerContextCore> &, content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &), const scoped_refptr<content::(anonymous namespace)::ClearAllServiceWorkersHelper> &, const base::WeakPtr<content::ServiceWorkerContextCore> &, content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &> [bind_internal.h : 277 + 0x2b]
6 libcontent.so!RunImpl<void (content::(anonymous namespace)::ClearAllServiceWorkersHelper::*const &)(const base::WeakPtr<content::ServiceWorkerContextCore> &, content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &), const std::__1::tuple<scoped_refptr<content::(anonymous namespace)::ClearAllServiceWorkersHelper>, base::WeakPtr<content::ServiceWorkerContextCore> > &, 0, 1> [bind_internal.h : 351 + 0x10]
7 libcontent.so!Run [bind_internal.h : 333 + 0x13]
8 libcontent.so!Run [callback.h : 94 + 0x9]
9 libcontent.so!DidGetAllRegistrationsInfos [service_worker_storage.cc : 1257 + 0x5]
10 libcontent.so!Invoke<const base::WeakPtr<content::ServiceWorkerStorage> &, const base::RepeatingCallback<void (content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &)> &, std::__1::vector<content::ServiceWorkerDatabase::RegistrationData, std::__1::allocator<content::ServiceWorkerDatabase::RegistrationData> > *, content::ServiceWorkerDatabase::Status> [bind_internal.h : 194 + 0x6]
11 libcontent.so!MakeItSo<void (content::ServiceWorkerStorage::*const &)(const base::RepeatingCallback<void (content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &)> &, std::__1::vector<content::ServiceWorkerDatabase::RegistrationData, std::__1::allocator<content::ServiceWorkerDatabase::RegistrationData> > *, content::ServiceWorkerDatabase::Status), const base::WeakPtr<content::ServiceWorkerStorage> &, const base::RepeatingCallback<void (content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &)> &, std::__1::vector<content::ServiceWorkerDatabase::RegistrationData, std::__1::allocator<content::ServiceWorkerDatabase::RegistrationData> > *, content::ServiceWorkerDatabase::Status> [bind_internal.h : 297 + 0x20]
12 libcontent.so!RunImpl<void (content::ServiceWorkerStorage::*const &)(const base::RepeatingCallback<void (content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &)> &, std::__1::vector<content::ServiceWorkerDatabase::RegistrationData, std::__1::allocator<content::ServiceWorkerDatabase::RegistrationData> > *, content::ServiceWorkerDatabase::Status), const std::__1::tuple<base::WeakPtr<content::ServiceWorkerStorage>, base::RepeatingCallback<void (content::ServiceWorkerStatusCode, const std::__1::vector<content::ServiceWorkerRegistrationInfo, std::__1::allocator<content::ServiceWorkerRegistrationInfo> > &)>, base::internal::OwnedWrapper<std::__1::vector<content::ServiceWorkerDatabase::RegistrationData, std::__1::allocator<content::ServiceWorkerDatabase::RegistrationData> > > > &, 0, 1, 2> [bind_internal.h : 351 + 0x1a]
13 libcontent.so!Run [bind_internal.h : 333 + 0x8]
<snip>
Comment 1 by nhiroki@chromium.org
, Nov 9 2017Looks like EmbeddedWorkerInstance is null on ServiceWorkerVersion::StopWorker(). void ServiceWorkerVersion::StopWorker(base::OnceClosure callback) { switch (running_status()) { case EmbeddedWorkerStatus::STARTING: case EmbeddedWorkerStatus::RUNNING: embedded_worker_->Stop(); <== Nullify |embedded_worker_|??? if (running_status() == EmbeddedWorkerStatus::STOPPED) { <== Crash here RunSoon(std::move(callback)); return; } stop_callbacks_.push_back(std::move(callback)); return; case EmbeddedWorkerStatus::STOPPING: stop_callbacks_.push_back(std::move(callback)); return; case EmbeddedWorkerStatus::STOPPED: RunSoon(std::move(callback)); return; } NOTREACHED(); }