Results 1 to 5 of 5

Thread: Debugging an SDL2 application raise floting point error

  1. #1

    Debugging a SDL2 application raise floating point error


    i have a strange effect debugging a SDL2, Version 2.05, application on Windows (8.1)/Linux (Ubuntu 16) with Delphi (7 and 2009) or Lazarus (1.6).

    Calling SDL_Init(SDL_INIT_VIDEO) inside both IDE's raise a floating point exception. Running program from console all works, but running inside IDE it raise the error.

    I have searched but found nothing. Has anyone a hint for me?

    Last edited by KidPaddle; 06-12-2016 at 07:57 AM. Reason: typo correction

  2. #2
    I would guess that this is one of the examples where your debugger catches and reports the Exception that is probably properly handled in the next line or next few lines. I assume this since you only know that exception is being raised during the debugging session.

    So I wouldn't worry to much about it unless it causes your application to fail (can't debug further after clicking on continue instead of break). If it does it would be good if you could post us more information as to where and when is such exception raised so someone can check to see if SDL2 code might be bugged.

  3. #3
    Thanks for help.

    I#m using SDL 2 Headers from

    Windows 8.1 with Delphi 2009 or Lazarus 1.6:
    program SDL2Test;

    uses SDL2;

    if (SDL_Init(
    ) = 0) then begin


    Very simple, nothing special, this program stopps after fpe exception is raised inside both ide's. Comment "or SDL_INIT_TIMER" out, i can debug the program. Using any option of SDL_INIT_TIMER / SDL_INIT_JOYSTICK / SDL_INIT_HAPTIC / SDL_INIT_GAMECONTROLLER raise the exception. This is on Windows 8.1.

    Same program on Ubuntu 16.04 raise fpe exception if SDL_INIT_VIDEO used, any other option can be used with out problems.

    Very strange.

    Last edited by KidPaddle; 07-12-2016 at 05:57 AM.

  4. #4
    SDL2 2.0.5 raises a debugger exception to name threads at start, this seems to conflict with debugging through gdb. Add a call to SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING , '1'); to prevent SDL from doing this.

  5. #5
    Fyi - this is no longer needed since 2.0.6: it sets the SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING hint by default.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts