Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Issue 1301853002: win: Crash handler server (Closed)

Created:
5 years, 4 months ago by scottmg
Modified:
5 years, 3 months ago
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

win: Crash handler server This replaces the registration server, and adds dispatch to a delegate on crash requests. (As you are already aware) we went around in circles on trying to come up with a slightly-too-fancy threading design. All of them seemed to have problems when it comes to out of order events, and orderly shutdown, so I've gone back to something not-too-fancy. Two named pipe instances (that clients connect to) are created. These are used only for registration (which should take <1ms), so 2 should be sufficient to avoid any waits. When a client registers, we duplicate an event to it, which is used to signal when it wants a dump taken. The server registers threadpool waits on that event, and also on the process handle (which will be signalled when the client process exits). These requests (in particular the taking of the dump) are serviced on the threadpool, which avoids us needing to manage those threads, but still allows parallelism in taking dumps. On process termination, we use an IO Completion Port to post a message back to the main thread to request cleanup. This complexity is necessary so that we can unregister the threadpool waits without being on the threadpool, which we need to do synchronously so that we can be sure that no further callbacks will execute (and expect to have the client data around still). In a followup, I will readd support for DumpWithoutCrashing -- I don't think it will be too difficult now that we have an orderly way to clean up client records in the server. R=cpu@chromium.org, mark@chromium.org, jschuh@chromium.org BUG=crashpad:1, crashpad:45 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/6978bf7646df2a48c8ba770452de043795ed1411

Patch Set 1 #

Patch Set 2 : stub of crash report exception handler #

Patch Set 3 : handler based on thread pool #

Patch Set 4 : reorganize, and CREH to ExceptionHandlerServer #

Patch Set 5 : wip on test #

Patch Set 6 : yarewrite #

Patch Set 7 : fix up shutdown #

Patch Set 8 : shutdown #

Patch Set 9 : improve shutdown #

Patch Set 10 : rewrite with set on main thread #

Patch Set 11 : . #

Patch Set 12 : remove ScopedWaitHANDLE #

Total comments: 42

Patch Set 13 : fixes and move some things around #

Total comments: 42

Patch Set 14 : partial fixes #

Patch Set 15 : check for forged shutdown requests #

Patch Set 16 : . #

Patch Set 17 : muck with connections #

Patch Set 18 : ... #

Total comments: 28

Patch Set 19 : fixes #

Total comments: 6

Patch Set 20 : more fixes #

Patch Set 21 : 80col #

Patch Set 22 : oops #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1024 lines, -1728 lines) Patch
M build/run_tests.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M client/client.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M client/crashpad_client_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +51 lines, -94 lines 0 comments Download
M client/registration_protocol_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -57 lines 0 comments Download
M crashpad.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M handler/handler.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -6 lines 0 comments Download
M handler/handler_test.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -48 lines 0 comments Download
D handler/win/registration_pipe_state.h View 1 2 3 4 5 1 chunk +0 lines, -112 lines 0 comments Download
D handler/win/registration_pipe_state.cc View 1 2 3 4 5 1 chunk +0 lines, -289 lines 0 comments Download
D handler/win/registration_pipe_state_test.cc View 1 2 3 4 5 1 chunk +0 lines, -259 lines 0 comments Download
D handler/win/registration_server.h View 1 2 3 4 5 1 chunk +0 lines, -83 lines 0 comments Download
D handler/win/registration_server.cc View 1 2 3 4 5 1 chunk +0 lines, -136 lines 0 comments Download
D handler/win/registration_server_test.cc View 1 2 3 4 5 1 chunk +0 lines, -271 lines 0 comments Download
D handler/win/registration_test_base.h View 1 2 3 4 5 1 chunk +0 lines, -114 lines 0 comments Download
D handler/win/registration_test_base.cc View 1 2 3 4 5 1 chunk +0 lines, -166 lines 0 comments Download
M snapshot/snapshot_test.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -1 line 0 comments Download
M snapshot/win/exception_snapshot_win_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +67 lines, -86 lines 0 comments Download
M util/util.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -0 lines 0 comments Download
M util/util_test.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
A util/win/exception_handler_server.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +95 lines, -0 lines 0 comments Download
A util/win/exception_handler_server.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +422 lines, -0 lines 0 comments Download
A util/win/exception_handler_server_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +206 lines, -0 lines 0 comments Download
A util/win/registration_protocol_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +106 lines, -0 lines 0 comments Download
A util/win/registration_protocol_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +70 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (5 generated)
scottmg
cpu and jschuh since you both have context, I'd appreciate it if you have the ...
5 years, 3 months ago (2015-08-25 22:10:07 UTC) #6
Mark Mentovai
I haven’t read the whole thing yet but since I won’t be able to finish ...
5 years, 3 months ago (2015-08-26 15:47:51 UTC) #7
scottmg
Thanks for the quick feedback. I also removed the unused entry point to crash_handler for ...
5 years, 3 months ago (2015-08-26 18:08:30 UTC) #8
Mark Mentovai
https://codereview.chromium.org/1301853002/diff/320001/client/crashpad_client_win.cc File client/crashpad_client_win.cc (right): https://codereview.chromium.org/1301853002/diff/320001/client/crashpad_client_win.cc#newcode23 client/crashpad_client_win.cc:23: #include "client/crashpad_info.h" Unused now. https://codereview.chromium.org/1301853002/diff/320001/client/crashpad_client_win.cc#newcode31 client/crashpad_client_win.cc:31: HANDLE g_signal_exception = ...
5 years, 3 months ago (2015-08-26 21:40:28 UTC) #9
scottmg
Thanks Mark. Carlos, Justin: A couple of questions on scary things below (aborting synchronous IO, ...
5 years, 3 months ago (2015-08-27 01:04:38 UTC) #10
scottmg
https://codereview.chromium.org/1301853002/diff/320001/util/win/exception_handler_server.cc File util/win/exception_handler_server.cc (right): https://codereview.chromium.org/1301853002/diff/320001/util/win/exception_handler_server.cc#newcode283 util/win/exception_handler_server.cc:283: if (request.client_process_id == GetCurrentProcessId()) { On 2015/08/26 21:40:28, Mark ...
5 years, 3 months ago (2015-08-27 04:18:01 UTC) #11
cpu_(ooo_6.6-7.5)
as windows goes the code looks good. I will take another look about the use ...
5 years, 3 months ago (2015-08-27 18:47:03 UTC) #12
scottmg
On 2015/08/27 18:47:03, cpu wrote: > as windows goes the code looks good. I will ...
5 years, 3 months ago (2015-08-27 19:08:00 UTC) #13
Mark Mentovai
scottmg wrote: > On 2015/08/27 18:47:03, cpu wrote: > > as windows goes the code ...
5 years, 3 months ago (2015-08-27 19:49:43 UTC) #14
scottmg
On 2015/08/27 19:49:43, Mark Mentovai - August is over wrote: > scottmg wrote: > > ...
5 years, 3 months ago (2015-08-27 23:22:32 UTC) #15
cpu_(ooo_6.6-7.5)
the client can't dup into the crash service because it does not have dup_handle privilege, ...
5 years, 3 months ago (2015-08-28 17:31:31 UTC) #16
cpu_(ooo_6.6-7.5)
ah sorry the readfile question was for me 3 ways: 1-cancelioex would be the nice ...
5 years, 3 months ago (2015-08-28 17:42:28 UTC) #17
Mark Mentovai
I’ll do one last pass tonight (or sooner).
5 years, 3 months ago (2015-09-02 18:46:19 UTC) #18
Mark Mentovai
LGTM. Both the versioning and the request struct typing are optional but recommended, and both ...
5 years, 3 months ago (2015-09-03 03:39:07 UTC) #19
scottmg
Thanks! I typed the messages in this CL (I'm not sure why I was so ...
5 years, 3 months ago (2015-09-03 17:28:25 UTC) #20
Mark Mentovai
LGTM https://codereview.chromium.org/1301853002/diff/440001/util/win/exception_handler_server.cc File util/win/exception_handler_server.cc (right): https://codereview.chromium.org/1301853002/diff/440001/util/win/exception_handler_server.cc#newcode294 util/win/exception_handler_server.cc:294: if (message.type == ClientToServerMessage::kShutdown) { switch/case/case. Don’t let ...
5 years, 3 months ago (2015-09-03 17:42:46 UTC) #21
scottmg
https://codereview.chromium.org/1301853002/diff/440001/util/win/exception_handler_server.cc File util/win/exception_handler_server.cc (right): https://codereview.chromium.org/1301853002/diff/440001/util/win/exception_handler_server.cc#newcode294 util/win/exception_handler_server.cc:294: if (message.type == ClientToServerMessage::kShutdown) { On 2015/09/03 17:42:46, Mark ...
5 years, 3 months ago (2015-09-03 18:02:08 UTC) #22
scottmg
Committed patchset #22 (id:500001) manually as 6978bf7646df2a48c8ba770452de043795ed1411 (presubmit successful).
5 years, 3 months ago (2015-09-03 18:06:24 UTC) #23
Mark Mentovai
5 years, 3 months ago (2015-09-03 18:16:08 UTC) #24
Message was sent while issue was closed.
LGTM. memset()’s not that bad when you’re forced…

Powered by Google App Engine
This is Rietveld 408576698