39
edits
(Add some notes about sandboxing.) |
(More remoting notes.) |
||
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 | ||
* Sandboxing. Approaches to writing | * Sandboxing. Approaches to writing log files 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. | ** 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. | ** 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. Especially good for high-volume data, because writes go directly to the file and the OS handles buffering. | ||
** 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. | ** 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. However, this approach would also work for JS code using MessageManager, whereas IPC FileDescriptor passing is only usable by C/C++. | ||
* [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 |
edits