Thread: Can not debug a crash

  1. #1
    Registered User
    Join Date
    Feb 2005

    Can not debug a crash

    I'm using MSVC++ 6 to create a program using c. I get a crash when I do a specific action (in this case : click on the console window when my openGL window is open).

    Normally I detect crashes by printing to the console to find where the crash occurs. The weird thing is that in this case the program fails to crash when I periodically print something to the console. I also tried the debugger in MSVC, but my debug build fails to crash too.

    Does anyone have an idea how to solve this ? Is there an easy way to get a back-trace of the call stack ?



  2. #2
    Registered User
    Join Date
    Oct 2001
    go to your event handler and manually trace the actions that take place. try adding MessageBox es and stuff places. Put in debug assertions for things you "know" to work.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe

    Also bear in mind that the cause (where the bug really is), and effect (where it shows up) are not necessarily in the same place, especially if memory corruption is at work.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary not built with debug info - why?
    By ulillillia in forum C Programming
    Replies: 15
    Last Post: 12-11-2008, 01:37 AM
  2. makefiles - debug & release?
    By cpjust in forum C Programming
    Replies: 6
    Last Post: 10-26-2007, 04:00 PM
  3. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  4. Ask about Debug Assert Failed
    By ooosawaddee3 in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2002, 11:07 PM
  5. Why does this crash in release version but not debug?
    By Dual-Catfish in forum C++ Programming
    Replies: 1
    Last Post: 04-03-2002, 06:19 PM