I found that the following patch fixes sdl2 for me.
Not really sure why this caused stack corruption though...
Index: devel/sdl2/patches/patch-src_video_x11_SDL_x11window_c
===================================================================
RCS file: devel/sdl2/patches/patch-src_video_x11_SDL_x11window_c
diff -N devel/sdl2/patches/patch-src_video_x11_SDL_x11window_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/sdl2/patches/patch-src_video_x11_SDL_x11window_c 19 May 2014
15:18:51 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- src/video/x11/SDL_x11window.c.orig Mon May 19 16:38:12 2014
++++ src/video/x11/SDL_x11window.c Mon May 19 16:38:58 2014
+@@ -356,7 +356,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
+ XSizeHints *sizehints;
+ XWMHints *wmhints;
+ XClassHint *classhints;
+- const long _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;
++ unsigned char _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;
+ Atom _NET_WM_BYPASS_COMPOSITOR;
+ Atom _NET_WM_WINDOW_TYPE;
+ Atom _NET_WM_WINDOW_TYPE_NORMAL;
+@@ -540,7 +540,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
+ _NET_WM_BYPASS_COMPOSITOR = X11_XInternAtom(display,
"_NET_WM_BYPASS_COMPOSITOR", False);
+ X11_XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL,
32,
+ PropModeReplace,
+- (unsigned char *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1);
++ &_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1);
+
+ {
+ Atom protocols[] = {