Thread: Debugger crashes with "In RaiseException()"

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    120

    Debugger crashes with "In RaiseException()"

    I'm not sure if this is the right place to ask this question, but I've been trying to debug an SDL program I'm working on, but for some reason the debugger quits right at the first call with the message "In RaiseException () (C:\WINDOWS\SysWOW64\KernelBase.dll)"

    Any idea of what I might be doing wrong?

    I've checked and rechecked if I'm using the right libraries for my setup (I have mingw 32 bits on windows 10), and everything there seems to be in order.

    Debugger is gdb, and I'm using gcc to compile.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Can you debug a simple console "hello world" program?

    Can you debug a simple SDL "hello world" program?

    Have you successfully used the debugger before?
    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.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    120
    Quote Originally Posted by Salem View Post
    Can you debug a simple console "hello world" program?

    Can you debug a simple SDL "hello world" program?

    Have you successfully used the debugger before?
    I can debug a simple console program no problem.

    I tried to use SDL_Init() to initialize SDL components one at a time, and then I used breakpoints to try to figure out if there was a particular component that might've been causing this. The behavior is weird: it seems like I can only initialize the video and audio components, and any other components will cause this "exception" to stop program flow. This is really weird as I don't feel like I've encountered this problem before, and I've been working with SDL for quite a few years now.

    I have the latest SDL version, and I've also tried this out on multiple versions of MinGW and no luck.

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Do you have the necessary additional parts for the library? If you don't, it can't initialize them. Is your installed library compatible with your OS and/or your debugger/compiler?
    Devoted my life to programming...

  5. #5
    Registered User
    Join Date
    Sep 2014
    Posts
    364
    Quote Originally Posted by shiroaisu View Post
    I tried to use SDL_Init() to initialize SDL components one at a time, and then I used breakpoints to try to figure out if there was a particular component that might've been causing this. The behavior is weird: it seems like I can only initialize the video and audio components, and any other components will cause this "exception" to stop program flow. This is really weird as I don't feel like I've encountered this problem before, and I've been working with SDL for quite a few years now.

    I have the latest SDL version, and I've also tried this out on multiple versions of MinGW and no luck.
    You don't show us your code.
    I use SDL2 (2.0.5) on Linux and have no problem with the following function.
    Code:
    // This function returns 1 if any problem occur, otherwise it returns 0
    
    int init_sdl(void) {
    
    // Initialize SDL video
        if(SDL_Init(SDL_INIT_VIDEO) < 0) {
            fprintf(stderr, "SDL could not initialize video! SDL_Error: %s\n", SDL_GetError());
            return 1;
        }
    
    // Initialize SDL audio
        if(SDL_Init(SDL_INIT_AUDIO) < 0) {
            fprintf(stderr, "SDL could not initialize audio! SDL_Error: %s\n", SDL_GetError());
            return 1;
        }
    
    // Initialize SDL joystick
        if (SDL_Init(SDL_INIT_JOYSTICK) < 0) {
            fprintf(stderr, "SDL could not initialize joysticks! SDL_Error: %s\n", SDL_GetError());
            return 1;
        }
    
        return 0;
    }
    Work this funtion for you?
    Other have classes, we are class

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    120
    Quote Originally Posted by WoodSTokk View Post
    You don't show us your code.
    There's no code to show, it's literally just a call to SDL_Init().

    I've redownloaded SDL and tried again with a 64 bit mingw this time and the same error occurs, except now its "In RaiseException () (C:\WINDOWS\System32\KernelBase.dll)"
    What does this message mean?

  7. #7
    Registered User
    Join Date
    Sep 2014
    Posts
    364
    Normaly I would say "don't know", because I work only on Linux.
    My last Windows was Win2K and have stopped using Windows in 2005.
    But your problem sounds very interesting, so I have searched the web a little bit.

    If you have SDL2 (2.0.5) or greater, insert the following line right before any other SDL-function (also before Init):
    Code:
    // This line is only needed, if you want debug the program
    SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1");
    This line stops raising the exception.
    Other have classes, we are class

  8. #8
    Registered User
    Join Date
    May 2010
    Posts
    120
    Quote Originally Posted by WoodSTokk View Post
    Code:
    // This line is only needed, if you want debug the program
    SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1");
    Oh wow that actually worked! Thanks a bunch.

    For future reference: where did you find that?

  9. #9
    Registered User
    Join Date
    Sep 2014
    Posts
    364
    Quote Originally Posted by shiroaisu View Post
    Oh wow that actually worked! Thanks a bunch.

    For future reference: where did you find that?
    Searched for 'windows sdl_init RaiseException' with DuckDuckGo brings up
    SDL :: View topic - Mix_OpenAudio makes crash Windows Kernel
    Other have classes, we are class

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 12-08-2014, 08:12 PM
  2. Replies: 2
    Last Post: 08-19-2012, 06:15 AM
  3. What is "Debugger"?
    By Petike in forum C++ Programming
    Replies: 3
    Last Post: 09-26-2008, 03:45 PM
  4. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 08:25 AM
  5. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 07:59 AM

Tags for this Thread