Exception Data Collected

Catch-all for all development not having a specific forum.
Post Reply
AdmiralKirk
Posts: 14
Joined: Mon Feb 12, 2007 10:52 pm

Post by AdmiralKirk »

I just finished downlaoding the SVN and I had a thought. Allegiance crashed on me last night, and after having a look at the "crash log" it didnt realy seam to contain anything more usefull than an exit code. Awhile back I had finished up a library that would allow a project compiled with SEH (note this is differnt than C++ EH, and is win32 only) to collect a complete stack trace along with local and global variable names and values after a crash (Utilizing the StackWalk family of functions along with the PDB files belonging to that particular compile). In a pure win32 app, this would be used by using the SetUnhandledExceptionFilter function to replace the default exception hanlder with one that will collect and then pass the EXCEPTION_POINTERS struct onto the library for further processing into a log file. I must admit that I dont know MFC very well as I usualy operate in pure win32 api. From what little reading ive done about the subject, I believe MFC makes life just as easy by not requiring SEH and providing an OnException callback of some sort. Converting the class it passes you into an acceptable EXCEPTION_POINTERS struct shouldnt be too hard (said struct is just two pointers, one to an ExceptionRecord struct and another to a ContextRecord struct). I wrote the library in MSVC2005 so it should be compatable with what your using since I saw an SLNv8 file in the SVN id assume your also using MSVC2005. Anyway, im not sure if this is even something youd be interested in, but if youd like a copy of the source and/or an example of the output it produces, let me know. My email is kirk56k(at)gmail.com
Mordechaj
Posts: 1809
Joined: Fri Mar 03, 2006 8:00 am
Location: Zagreb/Croatia/Europe

Post by Mordechaj »

i'm sory i just can't read this much txt without some paragraphs. i'm 100% sure that i couldn't help you even if i could read it, but that's not the point. my eyes water from this. or is it just lack of sleep?

anyhow, i'd like to know what's the problem, because that way the answers that come later will have more sense, and since i know i don't know the answer, i'd pretty much like to learn it.

does this makes any sense?
Image "South of the Alps and East of the Adriatic, paranoia is considered mental equilibrium..."
Image
Image
Anguirel
Posts: 407
Joined: Tue Mar 09, 2004 8:00 am
Location: El Pueblo de Nuestra Señora la Reina de los Ángeles del Río de Porciúncula

Post by Anguirel »

To interpret the original post...

Problem: Current exit codes on crashes are kinda useless, and the game doesn't catch a stack trace.
Solution: Some alternative exception handler Kirk has can be (potentially, possibly) dropped into the Alleg source code so when the game crashes more useful information regarding the cause can be captured and reported.

...and my response is -- make it happen. Show it works without causing additional problems. Submit it to the SVN. If it helps to track problems, I don't see the other devs objecting.
Image
"I disapprove of what you say, but I will defend to the death your right to say it" - Beatrice Hall, The Friends of Voltaire
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

will it tell us the file it tried to read if it crashed trying to read a file / display/play / do something with?
Last edited by madpeople on Thu Feb 15, 2007 1:04 am, edited 1 time in total.
AdmiralKirk
Posts: 14
Joined: Mon Feb 12, 2007 10:52 pm

Post by AdmiralKirk »

Assuming said name of file is somewhere in one of the local variables within the stack, then yes. Why the heck half of Allegiance's application functions are stuffed inside the ZLib project instead of the Allegiance project, doesnt make any freakin sense, but w/e ^^. The entire source tree is a massive mess, im impressed that the current developers have managed to do anything constructive with it at all /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Im kinda guessing at this point, that the WinMain I found in the Win32App wrapper that EngineApp uses is the primary entry point for the programm.... but thats just a wild guess... And unfortunatly I dont have the time to muddle with it ^^. Just incase one of the devs does infact have an interest in it.

Sample Output: http://kirk.sscentral.com/Exception/ExcepReport.log
Library Source: http://kirk.sscentral.com/Exception/ExcepReport.rar
Usage Example: http://kirk.sscentral.com/Exception/Main.cpp
Library Release: http://kirk.sscentral.com/Exception/PkgRelease.rar

I havnt bothered to redist this with a license since its such a small library, if I happen to come across a substantial amount of free time (lol!!) ill see about submitting a diff patch for integrating it, but for now the source is way too much of a mess for me to tangle with /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Anyway, use it or not, just thought it might help. Ill be glad to answer any questions about it at kirk56k(at)gmail.com if you have any. Good luck with the next version!!
Post Reply