gecko-dev/ipc/glue
Gabriele Svelto a7c337103a Bug 1697895 - Register the WER runtime exception module in child processes r=KrisWright
This patch sets up a few different things that will be used by the WER runtime
exception module when it needs to notify the main process of a child process
crash.

For every child process we allocate a structure in the main process called
WindowsErrorReportingData that contains three things:
- The address of the function used to notify the main process that there's a
  pending minidump for a given child process
- The PID of said child process
- The name of the minidump that has been generated

The first field is filled up by the main process and will be read by the WER
process when running the runtime exception module, the second and third fields
on the other hand start empty and will be written into by the runtime exception
module after it has generated a minidump.

I know this sounds scary. It is. But bear with me please.

When we register the runtime exception module we can pass it a single
pointer-sized parameter but we need to pass it at least another pointer that
includes data coming from the child process itself (this one is called
InProcessWindowsErrorReportingData). This data currently includes only the
process type but will also include certain annotations in the future
(e.g. bug 1711418). So here's what we do: we store a pointer to the parent
data structure in the child process command-line (cringe) and we read it
from the runtime exception module by reading the crashed process command-line
arguments and parsing them (double-cringe).

Armed with this information the WER runtime exception module can populate
the info for the generated minidump and then push it into the main process
by calling CreateRemoteThread() (which creates a new thread in the main
process, triple-cringe at this point).

Differential Revision: https://phabricator.services.mozilla.com/D115379
2021-06-11 09:59:49 +00:00
..
BackgroundChild.h
BackgroundChildImpl.cpp
BackgroundChildImpl.h
BackgroundImpl.cpp Bug 1683490 - Make PBackground be a refcounted actor, r=asuth 2021-01-21 16:26:50 +00:00
BackgroundParent.h
BackgroundParentImpl.cpp Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
BackgroundParentImpl.h Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
BackgroundUtils.cpp Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
BackgroundUtils.h
BrowserProcessSubThread.cpp
BrowserProcessSubThread.h
ByteBuf.h
ByteBufUtils.h Bug 1693661 - Use mozalloc_handle_oom instead of failing gracefully if we fail to allocate. r=jld 2021-02-25 18:53:25 +00:00
components.conf
CrashReporterClient.cpp
CrashReporterClient.h Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
CrashReporterHelper.h
CrashReporterHost.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
CrashReporterHost.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
CrossProcessMutex.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
CrossProcessMutex_posix.cpp
CrossProcessMutex_unimplemented.cpp
CrossProcessMutex_windows.cpp
CrossProcessSemaphore.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
CrossProcessSemaphore_posix.cpp
CrossProcessSemaphore_unimplemented.cpp
CrossProcessSemaphore_windows.cpp
Endpoint.h Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
EnumSerializer.h Bug 1689415 - Avoid UB when validating enum values in EnumSerializer. r=mccr8 2021-02-02 18:04:05 +00:00
EnvironmentMap.h
FileDescriptor.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
FileDescriptor.h
FileDescriptorSetChild.cpp
FileDescriptorSetChild.h
FileDescriptorSetParent.cpp
FileDescriptorSetParent.h
FileDescriptorShuffle.cpp
FileDescriptorShuffle.h
FileDescriptorUtils.cpp
FileDescriptorUtils.h
ForkServer.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
ForkServer.h
ForkServiceChild.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
ForkServiceChild.h Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
GeckoChildProcessHost.cpp Bug 1697895 - Register the WER runtime exception module in child processes r=KrisWright 2021-06-11 09:59:49 +00:00
GeckoChildProcessHost.h Bug 1697895 - Register the WER runtime exception module in child processes r=KrisWright 2021-06-11 09:59:49 +00:00
IdleSchedulerChild.cpp Bug 1710989 - Apply linter fixes in IdleScheduler code r=smaug DONTBUILD 2021-05-19 02:30:24 +00:00
IdleSchedulerChild.h Bug 1629064 - pt 1. Add IdleScheduler messages for GC r=smaug 2021-05-12 06:46:08 +00:00
IdleSchedulerParent.cpp Bug 1710989 - Apply linter fixes in IdleScheduler code r=smaug DONTBUILD 2021-05-19 02:30:24 +00:00
IdleSchedulerParent.h Bug 1629064 - pt 10. Add telemetry r=smaug 2021-05-12 06:46:11 +00:00
InputStreamParams.ipdlh
InputStreamUtils.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
InputStreamUtils.h
IOThreadChild.h
IPCCore.h
IPCMessageUtils.cpp Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
IPCMessageUtils.h
IPCMessageUtilsSpecializations.cpp Bug 1704658: Implement ParamTraits for RefPtr<nsAtom> r=nika 2021-04-27 08:20:18 +00:00
IPCMessageUtilsSpecializations.h Bug 1704658: Implement ParamTraits for RefPtr<nsAtom> r=nika 2021-04-27 08:20:18 +00:00
IPCStream.ipdlh
IPCStreamAlloc.h
IPCStreamChild.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
IPCStreamDestination.cpp Bug 1681529 - Part 3: Apply InputStreamLengthWrapper after DelayedStartInputStream, r=baku 2021-02-04 18:12:57 +00:00
IPCStreamDestination.h Bug 1681529 - Part 3: Apply InputStreamLengthWrapper after DelayedStartInputStream, r=baku 2021-02-04 18:12:57 +00:00
IPCStreamParent.cpp
IPCStreamSource.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
IPCStreamSource.h Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
IPCStreamUtils.cpp Bug 1681529 - Part 5: Serialize nsIInputStream over IPC with aDelayedStart by default, r=baku 2021-02-04 18:13:07 +00:00
IPCStreamUtils.h Bug 1681529 - Part 5: Serialize nsIInputStream over IPC with aDelayedStart by default, r=baku 2021-02-04 18:13:07 +00:00
IPCTypes.h
IPDLParamTraits.h
LibrarySandboxPreload.cpp Bug 1653659 - Part 2: Add support for Wasm sandboxing hunspell. r=firefox-build-system-reviewers,dmajor 2021-01-14 20:12:19 +00:00
LibrarySandboxPreload.h Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
MessageChannel.cpp Bug 1708042, add support for 'control' priority in ipdl, r=jld,ipc-reviewers 2021-05-21 15:46:46 +00:00
MessageChannel.h Bug 1563624 - Part 2: Automatically reject async IPC responses when the resolver is dropped, r=mccr8 2021-03-18 16:56:10 +00:00
MessageLink.cpp
MessageLink.h
MessagePump.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
MessagePump.h
MiniTransceiver.cpp Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8 2021-04-22 14:32:03 +00:00
MiniTransceiver.h
moz.build Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
Neutering.h
nsIIPCSerializableInputStream.h
PBackground.ipdl Bug 1710004 - Part 2: Make it possible to pre load data into BackgroundSessionStorageManager. r=asuth 2021-06-08 13:42:33 +00:00
PBackgroundSharedTypes.ipdlh Bug 1689147 - Part 5: Change comparable to an extended attribute, r=mccr8 2021-02-09 16:50:23 +00:00
PBackgroundTest.ipdl
PChildToParentStream.ipdl
PFileDescriptorSet.ipdl
PIdleScheduler.ipdl Bug 1629064 - pt 1. Add IdleScheduler messages for GC r=smaug 2021-05-12 06:46:08 +00:00
PParentToChildStream.ipdl
ProcessChild.cpp
ProcessChild.h
ProcessUtils.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
ProcessUtils_bsd.cpp
ProcessUtils_common.cpp Bug 1698045 part 1 - Add xpc::SelfHostedShmem to hold shared memory for JS initialization. r=smaug,tcampbell,ipc-reviewers,jld 2021-05-12 13:57:55 +00:00
ProcessUtils_linux.cpp
ProcessUtils_mac.mm Bug 1682030 - Remove some dead NPAPI code from dom/plugins and related spots. r=jmathies,mconley,ipc-reviewers,mccr8 2021-04-06 19:28:12 +00:00
ProcessUtils_none.cpp
ProtocolMessageUtils.h
ProtocolTypes.ipdlh
ProtocolUtils.cpp Bug 1708500 - Reduce the size of ManagedContainer types, r=mccr8 2021-05-17 20:53:51 +00:00
ProtocolUtils.h Bug 1708500 - Reduce the size of ManagedContainer types, r=mccr8 2021-05-17 20:53:51 +00:00
ProtocolUtilsFwd.h
ScopedXREEmbed.cpp
ScopedXREEmbed.h
SerializedStructuredCloneBuffer.h
SharedMemory.cpp
SharedMemory.h Bug 1699224 - Part 2. Expose SharedMemoryBasic::Unmap for use by callers. r=jld 2021-03-29 22:43:27 +00:00
SharedMemory_posix.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=andi 2021-01-06 17:17:23 +00:00
SharedMemory_windows.cpp
SharedMemoryBasic.h
SharedMemoryBasic_android.cpp
SharedMemoryBasic_android.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
SharedMemoryBasic_chromium.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
SharedMemoryBasic_mach.h Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
SharedMemoryBasic_mach.mm
Shmem.cpp
Shmem.h
ShmemMessageUtils.h
StringUtil.cpp
TaintingIPCUtils.h
TaskFactory.h
Transport.h
Transport_posix.cpp Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin 2021-06-09 04:56:48 +00:00
Transport_posix.h
Transport_win.cpp
Transport_win.h
TransportSecurityInfoUtils.cpp
TransportSecurityInfoUtils.h
URIParams.ipdlh
URIUtils.cpp Bug 1706615 - Part 1: Add a UnstrippedURI into the LoadInfo. r=valentin,necko-reviewers 2021-06-02 19:46:19 +00:00
URIUtils.h
WindowsMessageLoop.cpp Bug 1385014: Use WaitForSingleObjectEx in WaitForSyncNotifyWithA11yReentry when win32k is disabled. r=aklotz 2021-05-06 11:10:20 +00:00
WindowsMessageLoop.h