This patch adds support for ManagedEndpoint instances to be dropped &
gracefully destroyed. Before this change, a ManagedEndpoint which was
dropped without being bound would not clean up its' peer actor, meaning
that messages to and from that actor would be discarded.
This is done by adding a new actor destroy reason for dropping a
ManagedEndpoint.
Differential Revision: https://phabricator.services.mozilla.com/D128776
We still rely on dynamic loading to find the symbols, but since we get
them from libxul, we don't need to load the library before activating
the process sandbox anymore.
Differential Revision: https://phabricator.services.mozilla.com/D128333
Handle crash with the old way if the fork server is prefed out, and waitpid() for all available stat changes of children processes in the forkserver.
Differential Revision: https://phabricator.services.mozilla.com/D110507
Handle crash with the old way if the fork server is prefed out, and waitpid() for all available stat changes of children processes in the forkserver.
Differential Revision: https://phabricator.services.mozilla.com/D110507
Previously we were staring `PBackground` in content processes in
response to receiving the `SetXPCOMProcessAttributes` IPC message, which
is sent immediately after the process is launched. Meanwhile, the
idle scheduler tries to use PBackground when the main thread considers
itself idle. But if thread scheduling is such that the content process
main thread becomes idle before the IPC I/O thread has received and
dispatched that message, then we have a problem (signaled by an assertion
failure).
This patch moves content process `PBackground` startup earlier, to the
end of `ContentProcess::Init`; that point is after enough of IPC and
XPCOM is started for it to work, but before we start spinning the main
thread event loop.
Differential Revision: https://phabricator.services.mozilla.com/D126144
Previously we were staring `PBackground` in content processes in
response to receiving the `SetXPCOMProcessAttributes` IPC message, which
is sent immediately after the process is launched. Meanwhile, the
idle scheduler tries to use PBackground when the main thread considers
itself idle. But if thread scheduling is such that the content process
main thread becomes idle before the IPC I/O thread has received and
dispatched that message, then we have a problem (signaled by an assertion
failure).
This patch moves content process `PBackground` startup earlier, to the
end of `ContentProcess::Init`; that point is after enough of IPC and
XPCOM is started for it to work, but before we start spinning the main
thread event loop.
Differential Revision: https://phabricator.services.mozilla.com/D126144
ipc/chromium/src/chrome/common/ipc_channel_win.cc(133,8): error: variable 'waited' set but not used [-Werror,-Wunused-but-set-variable]
bool waited = false;
^
ipc/mscom/InterceptorLog.cpp(183,12): error: variable 'rv' set but not used [-Werror,-Wunused-but-set-variable]
nsresult rv = mThread->Dispatch(
^
Differential Revision: https://phabricator.services.mozilla.com/D126455
To differentiate the storage permission is granted by either the
permission or the allowList, we need to change the hasStoragePermission
to an enum to represent the storage permission state.
This patch also changes the name of the attribute to make it reasonable
with respect to this change.
Differential Revision: https://phabricator.services.mozilla.com/D126276
This simplifies the logic around MessageTask's lifecycle to make
ownership as clear as possible and reduce the number of redundant
checks.
This new change no longer clears the mChannel member when the
MessageTask is disconnected, instead relying on isInList() to check
whether the MessageTask is still in the channel's mPending list. This is
already being automatically managed as the mPending list is modified,
and should avoid potential usage mistakes.
Differential Revision: https://phabricator.services.mozilla.com/D123140
This change instead recovers from unhandled special messages by reporting a
normal IPC error, which should be handled using the normal IPC error
mechanisms.
Depends on D123148
Differential Revision: https://phabricator.services.mozilla.com/D123149
When this change was first implemented, it ignored dead actors for all types of
messages, but for messages with replies they cannot be ignored, as a reply must
be sent. This should fix that oversight.
Differential Revision: https://phabricator.services.mozilla.com/D123148
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.
This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.
Differential Revision: https://phabricator.services.mozilla.com/D122345
rlbox_wasm2c_sandbox was adjusted to avoid using LoadLibraryA (rejected by
build/clang-plugin/LoadLibraryUsageChecker.cpp), so we adjust
GetSandboxedRLBoxPath (which is used to feed it) to return an UTF-16
string on Windows.
Differential Revision: https://phabricator.services.mozilla.com/D123025
Memory for memfd files isn't subject to any file size limit, unlike
named files in /dev/shm, and is documented as being handled similarly
to anonymous mmap for accounting / resource management purposes.
Therefore, there isn't any need to pre-commit the memory with
posix_fallocate in that case.
Differential Revision: https://phabricator.services.mozilla.com/D121818
This merges the cases for posix_fallocate being unavailable at build
time and being rejected dynamically by the OS (some don't support
it with their implementation of POSIX shm), to make it simple to
dynamically opt out in the memfd case.
Differential Revision: https://phabricator.services.mozilla.com/D121817
This lets the idle scheduler know that we've initiated a GC that we didn't
ask its permission for. Eg the JS engine hit a threshold. It now uses this
info when scheduling GCs for other processes.
Differential Revision: https://phabricator.services.mozilla.com/D120831
This patch also:
* adds an assertion to KillGCRunner() to ensure it's never killed if
needed, now that there are more calls to KillGCRunner(), some calls have
been moved eg in nsJSEnvironment so as not to kill the runner a little
later and keep the assertions happy.
* IdleSchedulerChild will decline a request for a GC if there's already a
request in flight.
* CCGCScheduler will check if a GC is already in progress when handling the
parents' response to a GC request.
Differential Revision: https://phabricator.services.mozilla.com/D120830