Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: ppapi/native_client/src/trusted/plugin/service_runtime.cc

Issue 10823019: Ensure that errors that occur during load will get crash log info to JS console (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: code review based changes Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/service_runtime.cc
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index 76fb5789b4794f97717eb5d86b752d9bc9e2fa74..8f4fa8e40bb7b8298859ad7f8250ac5666a87904 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -588,6 +588,8 @@ bool ServiceRuntime::InitCommunication(nacl::DescWrapper* nacl_desc,
return false;
}
out_conn_cap = NULL; // ownership passed
+ PLUGIN_PRINTF(("ServiceRuntime::InitCommunication"
+ " starting reverse service\n"));
reverse_service_ = new nacl::ReverseService(conn_cap, rev_interface_->Ref());
if (!reverse_service_->Start()) {
error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_REV_SERVICE,
@@ -624,7 +626,8 @@ bool ServiceRuntime::InitCommunication(nacl::DescWrapper* nacl_desc,
}
bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc,
- ErrorInfo* error_info, const nacl::string& url) {
+ ErrorInfo* error_info, const nacl::string& url,
+ pp::CompletionCallback crash_cb) {
PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n",
reinterpret_cast<void*>(nacl_desc)));
@@ -655,7 +658,22 @@ bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc,
subprocess_.reset(tmp_subprocess.release());
if (!InitCommunication(nacl_desc, error_info)) {
- subprocess_.reset(NULL);
+ // On a load failure the service runtime does not crash itself to
+ // avoid a race where the no-more-senders error on the reverse
+ // channel esrvice thread might cause the crash-detection logic to
+ // kick in before the start_module RPC reply has been received. So
+ // we induce a service runtime crash here. We do not release
+ // subprocess_ since it's needed to collect crash log output after
+ // the error is reported.
+ Log(LOG_FATAL, "reap logs");
+ if (NULL == reverse_service_) {
+ // No crash detector thread.
+ PLUGIN_PRINTF(("scheduling to get crash log\n"));
+ pp::Module::Get()->core()->CallOnMainThread(0, crash_cb, PP_OK);
+ PLUGIN_PRINTF(("should fire soon\n"));
+ } else {
+ PLUGIN_PRINTF(("Reverse service thread will pick up crash log\n"));
+ }
return false;
}
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698