diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-02 15:30:36 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-04-21 17:18:00 +0200 |
commit | a5a603aa83fbc6604952bd6bf9795ceed61978e9 (patch) | |
tree | cd976de45005396afacff8cdddfcb1253a80b9fc /cli_ure | |
parent | cb43cb415e05933e2a48ed585db12a57340ff9fe (diff) |
Delete google_breakpad::ExceptionHandler before calling _exit()
While debugging tdf#129712 on Windows, I saw this sequence:
1. nullptr was dereferenced (the reason for tdf#129712).
2. ExceptionHandler::HandleException was called (in
workdir/UnpackedTarball/breakpad/src/client/windows/handler/exception_handler.cc).
3. It called ExceptionHandler::WriteMinidumpOnHandlerThread.
4. Minidump was created in ExceptionHandler::ExceptionHandlerThreadMain.
5. Document Recovery dialog was shown in Desktop::Exception (in
desktop/source/app/app.cxx).
6. After closing dialog, _exit() was called in Desktop::Exception.
7. All threads except main were terminated.
8. Another access violation was thrown in the "minimal CRT cleanup".
9. ExceptionHandler::HandleException called again.
10. ExceptionHandler::WriteMinidumpOnHandlerThread hung on WaitForSingleObject
because handler thread that should release the semaphore was terminated
already at step 7.
The process had to be killed manually.
This change destroys the breakpad handler at the start of Desktop::Exception,
which de-registers itself (on Windows it uses SetUnhandledExceptionFilter).
Other than preventing the hang, the rationale also is that keeping the handler
after first minidump creation is wrong: even if the second minidump creation
succeeded, uploading it to crashdump server would give not the actual problem,
but some unrelated stack.
Change-Id: If12d0c7db519693f733b5ab3b8a288cef800a149
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86104
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 12b5892cf9c78dd917f2e50672cd250478e6c7d6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89690
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'cli_ure')
0 files changed, 0 insertions, 0 deletions