IMHO this shouldn't be enabled if there's a way of making abort() output a stacktrace under windows. There are some interesting bugs like #657 that would benefit from assertions if they existed and were compiled in.
Comments?
-DNDEBUG
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
_set_abort_behavior
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
signal (it exists! surprise to yours truly)
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
seems that we want a signal handler. I'd do it if I knew how to print the stacktrace :>
also, leaving asserts out of release builds isn't a good idea IMHO; we're still in beta, after all
_set_abort_behavior
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
signal (it exists! surprise to yours truly)
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
seems that we want a signal handler. I'd do it if I knew how to print the stacktrace :>
also, leaving asserts out of release builds isn't a good idea IMHO; we're still in beta, after all

haven't got much time recently... but I've investigated this further and this POC works:
result is:
If no one does it before me, I'll try to do a stack dump in the abort function. Don't know when this will happen.
Code: Select all
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <assert.h>
void sigabort(int u)
{
printf("custom abort function\n");
}
int main(void)
{
signal(SIGABRT, sigabort);
assert(0 && "test");
return 0;
}
Code: Select all
Assertion failed: 0 && "test", file testabort.c, line 15
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
custom abort function
It might help motivate to know that when the gfx driver crashes and is reloaded by Vista spring freezes and if you leave it as is after a minute or 40-50 secs a dialog with that message pops up from the VC++ runtime, and no stacktrace is generated. Any correction of this issue resulting in a stacktrace could be of use to us if not to nvidia OGL driver engineers.