Electrolysis/Logging: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Add some notes about sandboxing.)
Line 2: Line 2:


* need to sort out current state of MOZ logging and other forms of IPC related logging
* need to sort out current state of MOZ logging and other forms of IPC related logging
* How does sandboxing impact this
* Sandboxing.  Approaches to writing logs from sandboxed child processes include:
** Open files early, either during startup or from a sandboxing-specific hook, rather than opening lazily on first use.  Not ideal for log files that might not be used at all.
** Have the parent open file descriptors and send them to the child; see [https://dxr.mozilla.org/mozilla-central/search?q=PCycleCollectWithLogs <tt>PCycleCollectWithLogs</tt>] for one example.  Works well with code using <tt>stdio</tt> or NSPR, and less well with C++ iostreams.
** Send the data in chunks over IPC messages (e.g., using {{bug|1093357}} once that lands); note that Gecko IPC has no flow control, so OOM is a possibility if the receiver can't keep up.  Also problematic if logging is to be done from multiple threads.
* [http://mxr.mozilla.org/mozilla-central/source/xpcom/base/Logging.h Logging.h]
* [http://mxr.mozilla.org/mozilla-central/source/xpcom/base/Logging.h Logging.h]
* {{bug|881389}} (OneLogger) Improve Gecko's logging story
* {{bug|881389}} (OneLogger) Improve Gecko's logging story

Revision as of 22:10, 13 May 2016

Logging Support

  • need to sort out current state of MOZ logging and other forms of IPC related logging
  • Sandboxing. Approaches to writing logs from sandboxed child processes include:
    • Open files early, either during startup or from a sandboxing-specific hook, rather than opening lazily on first use. Not ideal for log files that might not be used at all.
    • Have the parent open file descriptors and send them to the child; see PCycleCollectWithLogs for one example. Works well with code using stdio or NSPR, and less well with C++ iostreams.
    • Send the data in chunks over IPC messages (e.g., using bug 1093357 once that lands); note that Gecko IPC has no flow control, so OOM is a possibility if the receiver can't keep up. Also problematic if logging is to be done from multiple threads.
  • Logging.h
  • bug 881389 (OneLogger) Improve Gecko's logging story

Open Bugs

  • bug 1272704 NSPR logging appears to be broken on Windows from Content processes
  • bug 1014407 Failure when setting stdout or stderr on the Windows process sandboxing policy should be reported as a warning
  • bug 1055227 Make sandbox logging (security/sandbox/chromium/base/shim/base/logging*) actually emit log messsages
  • bug 1198475 Mochitest log file opened directly in content process