Commit ec5bdb1f authored by dschuff@chromium.org's avatar dschuff@chromium.org

PNaCl Coordinator: Run StreamEnd RPC even if StreamChunk fails

If the StreamChunk RPC fails, the coordinator currently reports an error
and aborts immedately, but this leaves no useful information for the
user or developer. Instead, call the StreamEnd RPC which returns a
string describing the error (but only if the RPC error was
reported by the application on the other end, and not an
error with the RPC itself).
Also disable the PnaclErrorHandling test until the translator change in
https://codereview.chromium.org/23753003/ rolls into Chrome
(since it, combined with this change, will improve the error message
reported by the translator).

R=jvoung@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3519
TEST=NaClBrowserTestPnacl.ErrorHandling

Review URL: https://chromiumcodereview.appspot.com/23946004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222240 0039d316-1c4b-4281-b951-d872f2087c98
parent 5a991a2d
......@@ -22,12 +22,14 @@
function declareTests(tester) {
// 'bad_pexe' loads a manifest, then loads a pexe that is invalid.
badLoadTest(
tester,
'bad_pexe',
'pnacl_bad_pexe.nmf',
'application/x-pnacl',
'NaCl module load failed: PnaclCoordinator: compile failed.');
// TODO(dschuff): re-enable this test when the change with more detailed
// error reporting rolls in from NaCl.
//badLoadTest(
// tester,
// 'bad_pexe',
// 'pnacl_bad_pexe.nmf',
// 'application/x-pnacl',
// 'NaCl module load failed: PnaclCoordinator: compile failed.');
// 'nonexistent_pexe' loads a manifest, then tries to to load a nonexistent
// pexe and fails.
......
......@@ -200,15 +200,25 @@ void PnaclTranslateThread::DoTranslate() {
&params,
&data[0],
data.size())) {
TranslateFailed(ERROR_PNACL_LLC_INTERNAL,
"Compile stream chunk failed.");
return;
if (llc_subprocess_->srpc_client()->GetLastError() !=
NACL_SRPC_RESULT_APP_ERROR) {
// If the error was reported by the translator, then we fall through
// and call StreamEnd, which returns a string describing the error,
// which we can then send to the Javascript console. Otherwise just
// fail here, since the translator has probably crashed or asserted.
TranslateFailed(ERROR_PNACL_LLC_INTERNAL,
"Compile stream chunk failed. "
"The PNaCl translator has probably crashed.");
return;
}
break;
} else {
PLUGIN_PRINTF(("StreamChunk Successful\n"));
core->CallOnMainThread(
0,
coordinator_->GetCompileProgressCallback(data.size()),
PP_OK);
}
PLUGIN_PRINTF(("StreamChunk Successful\n"));
core->CallOnMainThread(
0,
coordinator_->GetCompileProgressCallback(data.size()),
PP_OK);
} else {
NaClXMutexUnlock(&cond_mu_);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment