The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_SysWMinfo corrupted after using SDL_GetWindowWMInfo
urosidoki


Joined: 13 Dec 2015
Posts: 7
Hi guys,

I am trying to integrate imgui in my game engine (running with SDL2.0), but I have a crash (actually it is an exception) when imgui uses a code similar to this:

SDL_SysWMinfo info;
SDL_VERSION(&info.version); // initialize info structure with SDL version info
SDL_GetWindowWMInfo(window,&info);

I have this inside of a function and when the function returns I just have a assert or exception saying:
Run-Time Check Failure #2 - Stack around the variable'info' was corrupted.

Did anyone have something similar?

Any idea what it could be? I have been searching for a solution for this during the last 2 days but I couldn't see anything.

Cheers
urosidoki


Joined: 13 Dec 2015
Posts: 7
No one?

I am really surprised I am the only one having this problem Smile

Cheers
Re: SDL_SysWMinfo corrupted after using SDL_GetWindowWMInfo
DLudwig


Joined: 09 Feb 2012
Posts: 179
urosidoki wrote:
Any idea what it could be? I have been searching for a solution for this during the last 2 days but I couldn't see anything.


Can you provide some additional details on this, in particular, but not necessarily limited to the following:

1. which version of SDL are you using? I.e. 2.0.3? A checkout from hg.libsdl.org? Something else?

2. which platform are you running your app on?

3. which compiler are you building with, and what version is it at?


I have familiarity with some, but not all, SDL2 platforms and versions, same as I suspect most people are, around here. :-)

Cheers!
-- David L.
urosidoki


Joined: 13 Dec 2015
Posts: 7
Hi!

1.- I am using 2.0.3 downloaded from the official page (https://www.libsdl.org/download-2.0.php), I am talking about the development libraries.
2.- I am running on Windows 7
3.- I am building it in Visual Studio 2010 and in Visual Studio 2015 (two different computers) in both I have the same problem.

I hope this helps Smile

Thanks
urosidoki


Joined: 13 Dec 2015
Posts: 7
To give some extra information, the SDL code is part of a library called 2dRenderer, I link statically with my Launcher project (exe) to this library.

Cheers
urosidoki


Joined: 13 Dec 2015
Posts: 7
And even more information.

It happens only when I compile in debug, I have the Run-time error but I can continue the execution properly, but in Release I dont have the error at all.
urosidoki


Joined: 13 Dec 2015
Posts: 7
Hi again,

I have made some progress in this,

It seems that the problem disappear if I set the option C/C++ -> Code Generation -> Basic Runtime Checks to Default (as in the SDL samples)
In my case I got it in debug setup to Both (/RTC1, equiv. to /RTCsu) (/RTC1), the weird thing is that I am trying to reproduce it in the SDL samples by setting the same project configuration and I can't so far.

I will let you know if I can reproduce it there, I suspect there is some compiler flag combinations that will cause the same problem in the samples.

Cheers!
urosidoki


Joined: 13 Dec 2015
Posts: 7
Hi again,

I just figure out the problem:
It seems that the problem was that I was using the SDL2 build version downloaded from the website, I dont know what was the VS used to compile those but it seems that it was not compatible with my projects.

I just downloaded the source code and compiled by myself and now everything works properly.

Thanks and I hope this help other people with the same problem Smile
SDL_SysWMinfo corrupted after using SDL_GetWindowWMInfo
Christian Leger
Guest

Thanks for sharing!


You might be surprised by how often it does happen that you are the first to try something specific, and are therefore the first to solve it, or at least to be taking your adventure public!


On Tue, Dec 29, 2015 at 6:57 AM, urosidoki wrote:
Quote:
Hi again,

I just figure out the problem:
It seems that the problem was that I was using the SDL2 build version downloaded from the website, I dont know what was the VS used to compile those but it seems that it was not compatible with my projects.

I just downloaded the source code and compiled by myself and now everything works properly.

Thanks and I hope this help other people with the same problem


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Will you be releasing the SDL2 renderer system for IMgui ?