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

Issue 424893003: Pepper: Move NaCl fatal logging to Chrome IPC. (Closed)

Created:
6 years, 4 months ago by teravest
Modified:
6 years, 4 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, tzik, binji+watch_chromium.org, raymes+watch_chromium.org, teravest+watch_chromium.org, nfullagar1, piman+watch_chromium.org, noelallen1, ihf+watch_chromium.org, hidehiko
Project:
chromium
Visibility:
Public.

Description

Pepper: Move NaCl fatal logging to Chrome IPC. nacl_helper reports the last few log messages to the renderer when a LOG_FATAL message is logged in the plugin. This currently uses the "bootstrap" channel, which we would like to get rid of. This change registers a callback in the loader process to log fatal messages to the JS console as soon as they're reported. I had to add some synchronization to "flush" the task queue for the IPC task runner in this change. That's because ChannelProxy::Send queues the send job on a background thread. Unfortunately, the plugin could exit before that send happens, preventing messages from being logged to the JS console. I tested this manually by forcing a plugin crash after StartModule() in service_runtime.cc. BUG=391039

Patch Set 1 : #

Patch Set 2 : Fix race condition on plugin process exit #

Total comments: 2

Patch Set 3 : fix for dmichael #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -46 lines) Patch
M components/nacl/common/nacl_messages.h View 1 chunk +3 lines, -0 lines 1 comment Download
M components/nacl/loader/nacl_listener.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M components/nacl/loader/nacl_trusted_listener.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M components/nacl/loader/nacl_trusted_listener.cc View 1 2 2 chunks +35 lines, -1 line 2 comments Download
M components/nacl/renderer/nexe_load_manager.h View 2 chunks +1 line, -4 lines 0 comments Download
M components/nacl/renderer/nexe_load_manager.cc View 3 chunks +1 line, -14 lines 0 comments Download
M components/nacl/renderer/ppb_nacl_private_impl.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M components/nacl/renderer/trusted_plugin_channel.h View 3 chunks +7 lines, -1 line 0 comments Download
M components/nacl/renderer/trusted_plugin_channel.cc View 1 2 chunks +25 lines, -2 lines 0 comments Download
M ppapi/api/private/ppb_nacl_private.idl View 1 chunk +1 line, -2 lines 0 comments Download
M ppapi/c/private/ppb_nacl_private.h View 2 chunks +2 lines, -2 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/plugin.cc View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/service_runtime.h View 1 chunk +0 lines, -2 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/service_runtime.cc View 1 chunk +0 lines, -8 lines 0 comments Download
M ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
teravest
6 years, 4 months ago (2014-07-30 18:53:24 UTC) #1
dmichael (off chromium)
https://codereview.chromium.org/424893003/diff/80001/components/nacl/loader/nacl_listener.cc File components/nacl/loader/nacl_listener.cc (right): https://codereview.chromium.org/424893003/diff/80001/components/nacl/loader/nacl_listener.cc#newcode126 components/nacl/loader/nacl_listener.cc:126: base::TimeDelta::FromMilliseconds(50)); I think I'd rather see a SendFatalLog method ...
6 years, 4 months ago (2014-07-30 20:18:52 UTC) #2
teravest
On Wed, Jul 30, 2014 at 2:18 PM, <dmichael@chromium.org> wrote: > > https://codereview.chromium.org/424893003/diff/80001/components/nacl/loader/nacl_listener.cc > File ...
6 years, 4 months ago (2014-07-30 20:44:12 UTC) #3
dmichael (off chromium)
lgtm https://codereview.chromium.org/424893003/diff/140001/components/nacl/loader/nacl_trusted_listener.cc File components/nacl/loader/nacl_trusted_listener.cc (right): https://codereview.chromium.org/424893003/diff/140001/components/nacl/loader/nacl_trusted_listener.cc#newcode63 components/nacl/loader/nacl_trusted_listener.cc:63: return waitable_event_.TimedWait(base::TimeDelta::FromMilliseconds(50)); nit: Might make sense to name ...
6 years, 4 months ago (2014-07-30 21:17:48 UTC) #4
Mark Seaborn
One thing makes me nervous about this: LOG_FATAL is sometimes called in cases where something ...
6 years, 4 months ago (2014-07-30 22:23:26 UTC) #5
teravest
On Wed, Jul 30, 2014 at 4:23 PM, <mseaborn@chromium.org> wrote: > One thing makes me ...
6 years, 4 months ago (2014-07-30 22:37:24 UTC) #6
Mark Seaborn
On 30 July 2014 15:37, Justin TerAvest <teravest@chromium.org> wrote: > On Wed, Jul 30, 2014 ...
6 years, 4 months ago (2014-08-07 15:59:24 UTC) #7
teravest
I spent some time trying to add a test for this. It turns out that ...
6 years, 4 months ago (2014-08-12 21:37:54 UTC) #8
teravest
I wrote a change this morning that uses shared memory for reporting crash information. It ...
6 years, 4 months ago (2014-08-14 18:14:09 UTC) #9
teravest
6 years, 4 months ago (2014-08-20 19:31:11 UTC) #10
I'm closing this issue in favor of the shared memory approach in
  https://codereview.chromium.org/469423002/

Powered by Google App Engine
This is Rietveld 408576698