We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1694 - SDL_CreateWindowFrom can lead to stack overflow
Summary: SDL_CreateWindowFrom can lead to stack overflow
Status: RESOLVED DUPLICATE of bug 1636
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86 Windows 7
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-12 21:26 UTC by Jordan Milne
Modified: 2015-02-18 04:47 UTC (History)
2 users (show)

See Also:


Attachments
Repro code for the issue (1.39 KB, text/plain)
2013-01-12 21:26 UTC, Jordan Milne
Details
compressed wmmsg.txt with event logs (9.61 KB, application/x-gzip)
2013-01-12 21:28 UTC, Jordan Milne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jordan Milne 2013-01-12 21:26:44 UTC
Created attachment 1021 [details]
Repro code for the issue

Calling SDL_CreateWindowFrom can lead to a stack overflow in the event handler (WIN_WindowProc.) It doesn't matter whether the window is an SDL window or not. This behaviour doesn't occur under Linux, so this is likely an issue with how event hooking is done in the windows-specific code.

Commenting out the line "return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam);" in "video\windows\SDL_windowevents.c" stops the overflow from happening, and a 'printf("%d\n", data->wndproc)' shows that the same wndproc is being called recursively.

Attached is a simple program reproducing the issue.
Comment 1 Jordan Milne 2013-01-12 21:28:20 UTC
Created attachment 1022 [details]
compressed wmmsg.txt with event logs
Comment 2 Ryan C. Gordon 2015-02-18 04:47:12 UTC
This is the same thing as Bug #1636, I think.

--ryan.

*** This bug has been marked as a duplicate of bug 1636 ***