crashpad_pid_check.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Cheng Zhao <[email protected]>
  3. Date: Tue, 4 Jun 2019 11:30:12 +0900
  4. Subject: crashpad_pid_check.patch
  5. When both browser process and renderer process are connecting to the pipe,
  6. the API may return the PID of browser process as real_pid, which is different
  7. from the PID of renderer process.
  8. This is caused by the crashReporter getting started after the sanbox, after
  9. we redesign crashReporter's API to make it alwasy start before the
  10. sanbox, we can remove this patch.
  11. See following links for more:
  12. https://github.com/electron/electron/pull/18483#discussion_r292703588
  13. https://github.com/electron/electron/pull/18483#issuecomment-501090683
  14. diff --git a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
  15. index 6890a01cc4b333927be6c36ff3392706020f57a3..36da005deed5893989585427216fd1e16d5e9f0c 100644
  16. --- a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
  17. +++ b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
  18. @@ -446,9 +446,16 @@ bool ExceptionHandlerServer::ServiceClientConnection(
  19. DWORD real_pid = 0;
  20. if (get_named_pipe_client_process_id(service_context.pipe(), &real_pid) &&
  21. message.registration.client_process_id != real_pid) {
  22. + // Electron: When both browser process and renderer process are connecting
  23. + // to the pipe, the API may return the PID of browser process as real_pid,
  24. + // which is different from the PID of renderer process.
  25. + //
  26. + // I don't understand why Chromium does not have this issue.
  27. +#if 0
  28. LOG(ERROR) << "forged client pid, real pid: " << real_pid
  29. << ", got: " << message.registration.client_process_id;
  30. return false;
  31. +#endif
  32. }
  33. }