Old 4th May 2014, 19:35   #1
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,941
Send a message via Skype™ to thinktink
Fault trapping.

I'm trying to get my logger plugin to be a bit more fault tolerant and able to finish the report even in the event that a call to another plugin's method or a reference another plugin's memory (like the description field) causes an exception. I've noticed that the Error Reporting plugin seems to handle exceptions a bit more consistently and I know other programs (outside Winamp) also handle exceptions better.

I've wrapped all calls and references inside try{}catch(){} code blocks but it hardly ever catches anything, especially exceptions generated inside another plugin's code that's being called. I'm currently testing with an older version of the Unicode Taskbar Fixer plugin that would kill Winamp whenever you tried to retrieve the sf for it and I am kind-of making it my ultimate test of the code.

Is there another way I can catch and recover from exceptions generated/caused by other plugins and gracefully handle and report them? How does the Error Reporting plugin does it's thing?

tia
thinktink is offline   Reply With Quote
Old 5th May 2014, 15:58   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
it can depend on the crash as to how well it'll be handled via that method or not and the type of crash (as seen by the Gracenote issues). depending on the crash, sometimes the __try option works better than what you posted (I can't remember the exception handler syntax and is a pain to find it on the phone). that may help but its not guaranteed to do any better than what you're using already.

the crash reporter installs an error handler and doesn't attempt to recover from bad cashes - it just does enough to generate a dump / reporter process and then terminate the crashed process.
DrO is offline   Reply With Quote
Old 6th May 2014, 16:03   #3
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,941
Send a message via Skype™ to thinktink
__try{}__except(func()){} worked for a number of crashes but not for the UTF plugin. I guess the UTF plugin is an extreme case scenario. Would attaching an external exe debugger while I'm querying the plugins help?
thinktink is offline   Reply With Quote
Old 6th May 2014, 18:10   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
__try{}__except(EXCEPTION_EXECUTE_HANDLER){} was what i was thinking off. and i doubt it'll help as the crash you see with UTF is possible with other w5s plug-ins as well, is just due to the nature of the lack of the required handler in UTF that you're seeing what you are. and if something is going to badly crash then it's going to sadly (and it's probably best not to spend so much time on an unsupported version of UTF).
DrO is offline   Reply With Quote
Old 7th May 2014, 14:03   #5
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,941
Send a message via Skype™ to thinktink
Sorry, what I meant was __try{}__except(){} was indeed catching more than try{}catch(){} was (I need to update my DSP plugin GAH!) and I was saying it was better than what I was using. Sorry for the confusion.

Now here's something interesting, the __try{}__except(){} IS catching the UTF exception. However, when it tries to poke at next component in the list, it throws another exception and for some reason it doesn't get caught. I guess the UTF plugin crash just leaves the stack in such an unstable and unusable state that it's impossible recover from.

I need to find some other plugins that crash Winamp while being poked other than UTF. Know of any?
thinktink is offline   Reply With Quote
Old 7th May 2014, 14:04   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
i don't know of any others since UTF was a special case for that type of component.
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump