Adjusting CrashRpt message based upon type of crash (out of memory)

15 views
Skip to first unread message

pwb

unread,
Jun 9, 2011, 6:45:28 AM6/9/11
to Crashrpt
I have a c++ application that can end up using a lot of memory.
Whilst I ought to be able to reduce memory requirements and try to
avoid such crashes, I'd like to be able to display a different message
in the CrashRpt process if my application failed to allocate memory.
Maybe also display a different icon too to make it more obvious to
users who don't read dialog boxes.

I was wondering how I might be able to do this? Could I do something
with crashrpt_lang.ini - perhaps setting this from a crash callback
function? As far as I can tell, the ini file can only be specified in
the crInstall function.
I don't really want to show a dialog box from the callback function if
possible - especially if the app failed to allocate memory - I'd
rather delegate this to crashrpt.exe if possible?

It might also be nice to be able to differentiate between stupid
memory requests that are actual bugs (e.g. requesting 4GB) and genuine
looking ones. I'm not sure if this is possible though -
std::bad_alloc does not appear to contain details on the size
requested (unless parse-able from what(), which is not a very clean
way of doing it).


p.s. thank you for crashrpt!

zexspectrum

unread,
Oct 18, 2011, 10:50:57 AM10/18/11
to cras...@googlegroups.com
Hello, thanks for your question. 

CrashRpt currently can't customize its behavior based on crash type. I'm not sure this feature would be widely used. Typical users do not have technical knowledge about memory. So, I'm not very encouraged to implement this.

When analysing error reports, you can distinguish between invalid memory requests and other bugs using ExceptionType element of crashrpt.xml.
Reply all
Reply to author
Forward
0 new messages