Comments (11)
I'm afraid ExcHnd only supports one thread at this moment.
This is due to how SetUnhandledExceptionFilter()
works, and I'm not sure if there's a good way to call SetUnhandledExceptionFilter
on every thread. It might be possible to somehow get SetUnhandledExceptionFilter()
called on every thread, but I don't have the time (or personal need) to pursuing that.
If you do
LoadLibrary("exchndl.dll");
pfnExcHndlInit = GetProcAddress("ExcHndlInit");
pfnExcHndlInit()
then only the thread where ExcHndlInit() is called will report uncaught exceptions.
It should report any uncaught exception. Not just segfaults.
But you're right, multi-threading is an important question. I'll update the README file to explain this.
from drmingw.
DllMain
is called with DLL_THREAD_ATTACH
on every new threads after the DLL has been loaded, perhaps it can be used? Obviously this doesn't handle threads created before loading the DLL and you'll have to keep a record of thread IDs for cleaning up on DLL_THREAD_DETACH
(a simple linked list should be fine though) but it would be an improvement.
from drmingw.
Yes, hooking DLL_THREAD_ATTACH
would be better than nothing.
from drmingw.
Yes, hooking
DLL_THREAD_ATTACH
would be better than nothing.
Is there a solution to this requirement now?
from drmingw.
Hi @jrfonseca, I'd like to ask for informations
This is due to how
SetUnhandledExceptionFilter()
works, and I'm not sure if there's a good way to callSetUnhandledExceptionFilter
on every thread. It might be possible to somehow getSetUnhandledExceptionFilter()
called on every thread, but I don't have the time (or personal need) to pursuing that.
the documentation for SetUnhandledExceptionFilter says that it works globally for all threads. Can you give more insights as to what can be done to make dr. mingw work for all threads? Thank you very much!
from drmingw.
the documentation for SetUnhandledExceptionFilter says that it works globally for all threads
Indeed SetUnhandledExceptionFilter reference does say that Issuing SetUnhandledExceptionFilter replaces the existing top-level exception filter for all existing and all future threads in the calling process.
But my memory is that it doesn't work like that. SetUnhandledExceptionFilter
is what exchndl
uses, so if it did replace the unhandled exception filter across all threads, then the symptoms @acidtonic reported at the beginning of this issue could not arise.
That said, it's possible my memory is wrong, and there's some external factor interfering with SetUnhandledExceptionFilter
behavior in @acidtonic's case.
I googled, but couldn't find conclusive evidence either way.
Best way to know for sure would be to write a test.
One way or the other, SetUnhandledExceptionFilter
is the only tool available I know. AddVectoredExceptionHandler
is sure to be called on every exception, but there's no telling if it will be handled subsequently or not.
from drmingw.
Yes, hooking
DLL_THREAD_ATTACH
would be better than nothing.
If I remember correctly, debuggers such as GDB handles every DLL_THREAD_ATTACH
event. So, I'm not sure how complex and difficulty does ExcHndl.dll need to do to support this? Just call the necessary SetUnhandledExceptionFilter()
function call on each thread?
from drmingw.
I don't know why I made the comment re DLL_THREAD_ATTACH
before, because now that I think about it, I recall seeing plenty of bug reports with crash backtraces that happened inside worker threads. This can only mean that exchndl does already handle multiple threads.
from drmingw.
I don't know why I made the comment re
DLL_THREAD_ATTACH
before, because now that I think about it, I recall seeing plenty of bug reports with crash backtraces that happened inside worker threads. This can only mean that exchndl does already handle multiple threads.
For my experiment here: #71 (comment)
it can catch the crash in a worker thread.
But in other cases, it can't catch the crash in the worker thread, see the first post in issue #71.
from drmingw.
is there any function that I could call manually to write the report file when catching a type of '...' exception, I need more stack information, because it was no use, i still don't know where the exception uccurred.
from drmingw.
is there any function that I could call manually to write the report file when catching a type of '...' exception, I need more stack information, because it was no use, i still don't know where the exception uccurred.
Yes, @UniCd , you could call DebugBreak. It should trigger the report generation.
from drmingw.
Related Issues (20)
- Faulting location incorrect if executable uses ASLR. HOT 3
- Have it handle stack corruption HOT 3
- No source code is showing for projects built with MSYS2 HOT 4
- Reason for erroring out with posix threads? HOT 2
- Can exchndl be made to catch RaiseFailFastException? HOT 4
- catchsegv not resolving gnu_debuglink correctly HOT 8
- catchsegv clobbers Unicode arguments
- Feature request: Support ARM64 HOT 23
- Feature request: Allow opt-in to use system provided zlib HOT 1
- ExcHndl.dll can't print the crash call stack under Windows 7 HOT 20
- Dumping register values on x86_64 HOT 1
- Write minidump from exchndl.dll
- Support minidump locations/filenames containing unicode (wide char) characters HOT 4
- Release 0.9.8: Naming of link libraries different between 32 and 64 bit HOT 3
- What is the minimal OS to run the official drmingw release? HOT 2
- libwinpthread-1.dll missing from release HOT 9
- Save the result automatically HOT 3
- Is it possible to update drmingw to the latest version in the msys2 package? HOT 2
- better sample code in the home page HOT 1
- exchndl problem HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drmingw.