// ============================================================================ // This is a Servlet sample for the G-WAN Web Server (http://www.trustleap.com) // ---------------------------------------------------------------------------- // crash.c: making it easy to find a crash location in the code helps immensely // to fix them. They are displayed on the server console and can also // be found in the /logs/error.log file (enable log files by creating // the G-WAN /logs sub-folder). // // When a crash happens, clients will be sent a 404:'Not found' error // and the server will continue to serve them as usual. // // This example just creates a crash, which will be handled gracefully // by G-WAN, producing something like an useful crash report with the // line numbers in the 'csp/crash.c' file where the bug happened. // // ============================================================================ void crash(void) { *((int*)(0))=0xBADC0DE; // write access violation } // ---------------------------------------------------------------------------- int main(int argc, char *argv[]) { crash (); // choose your poison... return(200); // return an HTTP code (200:'OK') } // ============================================================================ // End of Source Code // ============================================================================