aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/handler/exception_handler.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-3/+3
| | | | | | | | | | We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Extract intruction pointer correctly for Windows ARM64Tom Tan2019-01-031-1/+3
| | | | | | | Bug: 893460 Change-Id: Ibbdf734e72c29c4779b6a701dceec1626056a9ba Reviewed-on: https://chromium-review.googlesource.com/c/1393763 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* win: fix formatting after 21c98747Joshua Peraza2018-08-271-1/+1
| | | | | | Change-Id: If50c3563fec7a8a9edf05c22f7d157201184df38 Reviewed-on: https://chromium-review.googlesource.com/1191671 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* win: replace a while loop with a for loopJoshua Peraza2018-08-271-1/+1
| | | | | | | | | This is the recommended resolution to warning C4127. https://msdn.microsoft.com/en-us/library/6t66728h.aspx Change-Id: Ifcffe68e21d9a6383bb9aef07503cbb034caca19 Reviewed-on: https://chromium-review.googlesource.com/1191661 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* windows: fix build on pre-Win10 systemsMike Frysinger2017-02-111-0/+5
| | | | | | | | | | The use of DBG_PRINTEXCEPTION_WIDE_C was added for Win10 support, but that define doesn't exist in older versions which means we fail to build. Put it behind an ifdef check to work everywhere. Change-Id: Ibab8bddd5c19b4b50e356f59edeb3873c3104569 Reviewed-on: https://chromium-review.googlesource.com/441525 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Also treat DBG_PRINTEXCEPTION* as debug exceptionsTim Angus2016-10-181-1/+3
| | | | | | | | | | | | | Windows 10 now raises an exception when OutputDebugString* are called: (https://ntquery.wordpress.com/2015/09/07/windows-10-new-anti-debug-outputdebugstringw/) This change ignores these exception types such that they're not falsely identified as a crash. BUG= Change-Id: I1326212662d46e16407681d5ea6377f63ee188ce Reviewed-on: https://chromium-review.googlesource.com/398998 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix breakpad compilation issue with clang on WindowsRafal Chlodnicki2016-08-251-6/+4
| | | | | | | | | | | | | | Fix unused variable error. Code that uses the kWaitForHandlerThreadMs constant is inside and ifdef so in some compile configurations constant was unused. Move it where it's used. And do the same with other constants as requested during review. BUG= Change-Id: I4f4c8f36c982092d53438ed6d2a0a97772402d69 Reviewed-on: https://chromium-review.googlesource.com/374378 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add a new argument to specify the minidump type to write on Windows.Ting-Yu Chou2016-06-291-4/+6
| | | | | | | R=ted.mielczarek@gmail.com BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1267329 Review URL: https://codereview.chromium.org/2107083002/ .
* Add option to Breakpad to consume INVALID_HANDLE_VALUE exceptions.wfh@chromium.org2015-02-221-0/+6
| | | | | | | | | BUG=chromium:452613 R=mark@chromium.org Review URL: https://breakpad.appspot.com/7794002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1427 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix Windows client compilation on mingw.ted.mielczarek@gmail.com2014-11-031-1/+1
| | | | | | A=Jacek Caban <jacek@codeweavers.com>, R=ted at http://breakpad.appspot.com/548002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1399 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Treat warnings as error and fix most level 4 warnings in the breakpad ↵ivan.penkov@gmail.com2013-06-041-9/+9
| | | | | | | | | | | windows client projects. Some of the lint errors in the files touched by this change were also fixed. BUG=533 Review URL: https://breakpad.appspot.com/601002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1189 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow option for efficient and safe opt out of in-proc dump generation for ↵ivan.penkov@gmail.com2013-04-231-30/+53
| | | | | | | | | | Windows breakpad clients. https://breakpad.appspot.com/549002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1157 4c0a9323-5329-0410-9bdc-e9ce6186880e
* SuspendThread returns a DWORD value, so checking the return value with ">= 0"ivan.penkov@gmail.com2012-11-011-3/+6
| | | | | | | | | | | doesn't work. On failure, the return value is (DWORD) -1 (which is 0xFFFFFFFF). http://breakpad.appspot.com/491002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1075 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix a really stupid bug in WriteMinidumpForChildProcessted.mielczarek@gmail.com2012-09-241-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1047 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow generating minidumps from live processes on Windows.ted.mielczarek@gmail.com2012-09-181-108/+187
| | | | | | R=mark at https://breakpad.appspot.com/115002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1042 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow adding extra memory regions to minidump on linux/windowsted.mielczarek@gmail.com2012-09-181-18/+53
| | | | | | | A=Bill McCloskey <wmccloskey@mozilla.com>, ted, original patch from https://bugzilla.mozilla.org/show_bug.cgi?id=662646 R=mark at https://breakpad.appspot.com/450002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1041 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Speculatively back out r989 per http://codereview.chromium.org/10805065/ :mark@chromium.org2012-07-241-42/+18
| | | | | | | | | | | | | | | | | | | | Ted Mielczarek: > You could try backing out r989, although Mozilla has been running with that > patch for months without issue. Me: > src/client/windows/handler/exception_handler.cc in r989 appears to have > formatting problems, an unwanted property change, and no real Breakpad review > history, so maybe we should back it out anyway until the proper process is > followed. NACL Tests nacl_integration failures: http://build.chromium.org/p/chromium/builders/NACL%20Tests/builds/30138 chrome src/native_client/tests/inbrowser_crash_test/crash_dump_tester.py says that the observed failures are a symptom of crash_service.exe itself crashing. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@998 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Back out r996, reinstating r985. That wasn't it.mark@chromium.org2012-07-241-3/+35
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@997 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Speculatively back out r985 because it may be causing crash_service problemsmark@chromium.org2012-07-241-35/+3
| | | | | | | | for Chrome. See http://codereview.chromium.org/10805065/ . I'll recommit this if it wasn't the problem. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@996 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow adding extra memory regions to minidump on linux/windowsted.mielczarek2012-07-191-18/+42
| | | | | | A=Bill McCloskey <wmccloskey@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=662646 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@989 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow the crash generation server to be initialized with a handle instead ↵ted.mielczarek2012-07-161-3/+35
| | | | | | | | of a pipe name A=bsmedberg R=ted at http://breakpad.appspot.com/406002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@985 4c0a9323-5329-0410-9bdc-e9ce6186880e
* wires up the crash client side so that the deferred upload callback can be used.cdn@chromium.org2012-05-031-0/+4
| | | | | | | TEST=N/A Review URL: https://breakpad.appspot.com/384001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@961 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Eliminate another source of UnspecifiedStackSignature crash dumps.mark@chromium.org2011-12-211-45/+38
| | | | | | | | | | | | | | | | | Manufacturing an exception record improves the crash reporting, since then the crashes get bucketed by the call stack leading to the dump, instead of all falling into a misc bucket that nobody ever looks at. Currently these are occuring through e.g. dumps from the base watchdog. Link against RtlCaptureContext, as the function has been documented as available from Windows XP [http://msdn.microsoft.com/en-us/library/windows/desktop/ms680591(v=vs.85).aspx]. Patch by Siggi Asgeirsson <siggi@chromium.org> git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@897 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Speculative back-out of r883, which may have broken Windows crash reporting.mark@chromium.org2011-11-281-6/+0
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@891 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow CrashGenerationClient to request that a dump of the parent process be ↵ted.mielczarek2011-11-111-0/+6
| | | | | | | | written. A=Jim Mathies <jmathies@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=679238 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@883 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Protect "std::max", "std::min" against MACROs defined in WinDef.h.SiyangXie@gmail.com2011-03-111-3/+3
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@780 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use a MinidumpCallback to force minidumps on Windows to include memory ↵ted.mielczarek2011-01-251-1/+93
| | | | | | | | around the faulting instruction pointer. Older versions of DbgHelp don't seem to do this correctly (on Windows XP, for example) R=mark at http://breakpad.appspot.com/259001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@763 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Round-trip client/processor unittests for Windowsted.mielczarek2011-01-241-1/+1
| | | | | | R=mark at http://breakpad.appspot.com/258001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@762 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix HandleInvalidParameter/HandlePureVirtualCall to dynamically lookup the ↵ted.mielczarek2010-08-021-28/+50
| | | | | | RtlCaptureContext symbol so the Windows exception handler will continue to work on Windows 2000. Patch by Jim Mathies <jmathies@mozilla.com> and Timothy Nikkel <tnikkel@gmail.com>. r=ted git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@637 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Patch from Vitaly to remove synchronization and make exception handling code ↵nealsid2010-05-181-3/+1
| | | | | | single-threaded git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@602 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Added a death test for the pure virtual function call.hansl@google.com2010-05-131-2/+25
| | | | | | | | | Added a test for the minidump generated by a pure virtual function call. Changed the pure virtual function call handler so that it creates a minidump with Exception info and a stack. Review URL: http://codereview.chromium.org/2050013 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@597 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Moved exception_handler_test to the more aptly named ↵hansl@google.com2010-05-121-17/+12
| | | | | | | | | | | | | | | | exception_handler_death_test. It doesn't test anything else than death and exit. Created the exception_handler_test that test the generation of dump and the dumps themselves. Moved all dump analysis code from minidump to its right class DumpAnalysis. The class is used by both minidump_test and exception_handler_test. The tests are way simpler that way (ie. no handling of HANDLE). minidump_test now uses the minidump_generator class instead of using Win32. It works well and pass all tests. exception_handler now passes both the exception and assertion infos to the client to generate the dump. If one is NULL it's going to be handled correctly. crash_generation_client can now RequestDump with both exception and assertion info. minidump_generator returns both the mini and full dump string pointers, and output both (or either) depending on which was generated. All original interfaces and method signature are still there, but call the new functions if possible. Review URL: http://codereview.chromium.org/1994015 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@596 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix dependency on Visual C++ 9 introduced by revision 557.nealsid2010-04-291-1/+1
| | | | | | | | | | | A=nealsid r=mmentovai http://breakpad.appspot.com/105001/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@580 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix HandleInvalidParameter to provide a locally created exception record for ↵siggi@chromium.org2010-03-261-3/+23
| | | | | | | | | | | the minidump. Having an exception of interest makes the resultant minidumps look just like crash dumps, in that the processor can identify the "crashing" tread. This means such minidumps can be classified by the stack signature, in contrast to the current state of things, in which all such dumps get lumped on a single pile. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@557 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix an INVALIDATE_ITERATOR defect reported by Coverity.nealsid2009-07-301-5/+5
| | | | | | | | | | | | std::vector::erase() invalidates the iterator, so we need to advance the iterator by using the return value of erase(). R=nealsid A=wtc git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@370 4c0a9323-5329-0410-9bdc-e9ce6186880e
* AppVerifier leak test fix for Windows 7.doshimun2009-04-081-0/+2
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@327 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Reinstnate the call to TerminateThread inside ExceptionHandler destructor ↵doshimun2009-01-201-1/+10
| | | | | | | | | | | | | | | | | | | | | | and put the graceful code inside a #ifdef. The problem is: If ExceptionHandler is created and destroyed in DllMain, then the previous change to remove the call to TerminateThread will lead to a deadlock. This is because inside DllMain the loader lock is acquired, and the previous change waits for the handler thread to exit in the destructor, that is with the loader lock acquired. But the handler thread cannot finish until it gets the loader lock to call DllMain for THREAD_DETACH. With this change, we add conditional compilation so that clients that want to avoid the call to terminate thread can do it by defining the appropriate preprocessor variable. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@309 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some typos in comments.doshimun2009-01-141-4/+4
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@307 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Minor fixes to windows exception handler.doshimun2009-01-141-12/+45
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@306 4c0a9323-5329-0410-9bdc-e9ce6186880e
* ExceptionHandler class is not handling initialization errors, such as themmentovai2008-12-031-8/+28
| | | | | | | | | | | | | handler thread not being created. Protect the exception handler against failure to create semaphores and a thread handle. Patch by Marc-André (MAD) Decoste, r=me http://code.google.com/p/google-breakpad/issues/detail?id=285 http://codereview.chromium.org/13065 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@300 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Some style guide compliance changes and changed the prototype of the method ↵doshimun2008-05-071-3/+3
| | | | | | to get custom client info in ClientInfo class. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@270 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add a way for the client apps to specify custom information in case of ↵doshimun2008-05-051-4/+11
| | | | | | | | | | | | | | out-of-process scenarios that the OOP server can use in whatever way it wants to. Fix a bug in CrashGenerationserver where CreateNamedPipe failure was not checked correctly. TODO in near future: Add a custom stream to minidump files for the custom information. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@267 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Overview:doshimun@gmail.com2008-03-081-150/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement out-of-process dump generation for Windows platform. Details: - Created a lib, crash_generation.lib, that implements the out-of-process dump generation protocol. - The lib code is under client/windows/crash_generation folder and is organized in the following way: - CrashGenerationServer class (crash_generation_server.h/.cc) implements the server side of the protocol. - CrashGenerationClient class (crash_generation_client.h/.cc) implements the client side of the protocol. - MinidumpGenerator class (minidump_generator.h/.cc) serves as an abstractino for generating dump files using Windows APIs, coming up with new file names by creating GUIDs, etc. - ProtocolMessage class (ipc_protocol.h) represents the message format between the client and server for pipe IPC. - Server allows one client at a time on the pipe in the current implementation. - ReadMe.txt explains the state machine the server uses to serve clients. - ExceptionHandler is modified and a new constructor is added that allows specifying the pipe name. If the pipe name is NULL, the behavior is backward compatible - in-process dump generation is done as before. If the pipe name is specified, out-of-process dump generation registration is attempted. If that fails, the behavior is again backward compatible. - If out-of-process registration succeeds, all write dump requests, direct or indirect, are directed to crash server process that served the registration request. NOTE that the explicit dump requests made by calling the static method of ExceptionHandler are not directed to theserver. - client/windows/tests/crash_generation_app implements a simple Win32 GUI application to help test the out-of-process dump generation client and server. Typical use of the app is to start one instance, click Server --> Start and then start the other instance. The other instance will register with the first instance automatically at start-up. Then the second instance can be used to request various typoes of dump requests by using options under the Client menu. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@244 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove dependency on ole32 on Windows (#132). Patch by Sorin Jianu ↵mmentovai2008-01-281-6/+24
| | | | | | <sorinj>, r=me. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@237 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Make Breakpad's debug-exception-ignoring configurable. r=Nicolas Sylvainmmentovai2007-10-181-3/+7
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@224 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 175 - fix permissions on dump file in MinidumpFileWriter. r=mentoted.mielczarek2007-07-051-2/+2
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@197 4c0a9323-5329-0410-9bdc-e9ce6186880e
* These should be int to allow them to be ORed together. Ted, please review.mmentovai2007-07-021-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@194 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow finer control over installed handler types (#193). r=ted.mielczarekmmentovai2007-07-021-16/+23
| | | | | | | http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/992a1bb09dc58a32 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@193 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add an API to pass exception information into the handler (#192).mmentovai2007-07-021-1/+5
| | | | | | | | | r=ted.mielczarek http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/42e9ee1a636bca8b git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@191 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 162 - handle pure virtual function calls in VC++. r=mentoted.mielczarek2007-05-101-0/+34
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@166 4c0a9323-5329-0410-9bdc-e9ce6186880e