Xuri asked me a question the other day with regards to debug vs release mode, and why sometimes things only happen in release mode that don't happen in debug. Ultimately, he was looking for something similar to a Call Stack for when users use it and crash.
At the time, I didn't think you could do much. But perhaps I've been proven wrong.
http://www.codeproject.com/threads/StackWalker.asp
I got that address today in an email from CodeProject. Amongst other things, it's claim to fame is being able to dump out a CallStack, validly, at *any* stage. It's late here and I don't have time, but a naive implementation could be as simple as wrapping most of the main() func in a try/catch block, and executing the StackWalker in the catch section.
Sure, it's not pretty, and it wouldn't solve anything, really.... but it may at least give us some way of being able to isolate where some of the user's problems are coming from.
Thoughts? Ideas? Suggestions?
Oh, I do realise this is a win32 thing only, I'm certainly not advocating it as a catch all. But it might help when working with those who do run on Windows and don't have a copy of VC.
StackWalking
disclaimer:
Didn't follow the link
Is it windows or VS only? Will it support mingw?
At this point, one could just tear out all the linux code, getting it working on windows vs/mingw well, then analyze the changes needed.
At that point, one could take out such hacks such as this, for hopefully it wont be as needed (thus, not linux not a problem).
Didn't follow the link
Is it windows or VS only? Will it support mingw?
At this point, one could just tear out all the linux code, getting it working on windows vs/mingw well, then analyze the changes needed.
At that point, one could take out such hacks such as this, for hopefully it wont be as needed (thus, not linux not a problem).
-
lingo
- UOX3 Novice
- Posts: 55
- Joined: Thu Jul 07, 2005 12:26 pm
- Location: Taipei, Taiwan
- Has thanked: 0
- Been thanked: 0
It windows debugged API, supply by dbghelp.dll. so should work for mingw.
I google and found something similar for linux
http://www.hpl.hp.com/research/linux/libunwind/
but callstack walking really should be used as last resort. I think test case should be implement first. I nominate cxxtest as our unit test module, any other suggestion?
I google and found something similar for linux
http://www.hpl.hp.com/research/linux/libunwind/
but callstack walking really should be used as last resort. I think test case should be implement first. I nominate cxxtest as our unit test module, any other suggestion?
-
giwo
- Developer
- Posts: 1780
- Joined: Fri Jun 18, 2004 4:17 pm
- Location: California
- Has thanked: 0
- Been thanked: 0
I agree wholeheartedly.
Basically any issue that I can't reproduce (be it in debug or release) doesn't get fixed, as it stands. If we are lucky, these problems get solved unintentionally as work progresses, but even then it can be a long wait (far too long for many of our users).
We need to generate some method of reporting where a crash happened, even if it's not an entire callstack (though a callstack would be more helpful as most of our crashes actually happen deep within STL headers). This would provide the user with some tangible information when the program crashes, and us a place to start looking for wierdness if we can't reproduce it.
Basically any issue that I can't reproduce (be it in debug or release) doesn't get fixed, as it stands. If we are lucky, these problems get solved unintentionally as work progresses, but even then it can be a long wait (far too long for many of our users).
We need to generate some method of reporting where a crash happened, even if it's not an entire callstack (though a callstack would be more helpful as most of our crashes actually happen deep within STL headers). This would provide the user with some tangible information when the program crashes, and us a place to start looking for wierdness if we can't reproduce it.
Scott
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
Unless, I'm the only one not experiencing this one... here's another candidate
viewtopic.php?t=568
-= Ho Eyo He Hum =-