New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL 1.2 programs crash with certain libGL implementations #753
Comments
SDL2 handled this by calling XInitThreads() as soon as SDL_X11_LoadSymbols succeeds: |
@icculus, @slouken: I'd like to apply following XInitThreads patch video/x11/SDL_x11video.c: add XInitThreads to X11_CreateDevice.
Fixes: https://bugzilla.libsdl.org/show_bug.cgi?id=2843
https://github.com/libsdl-org/SDL-1.2/issues/753
Also see SDL2 commit:
https://github.com/libsdl-org/SDL/commit/635ebd967b7a8141e1022ed5c6b462df906f5c3a
diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h
index bd83f7f..bc54b96 100644
--- a/src/video/x11/SDL_x11sym.h
+++ b/src/video/x11/SDL_x11sym.h
@@ -76,6 +76,7 @@ SDL_X11_SYM(int,XMoveResizeWindow,(Display* a,Window b,int c,int d,unsigned int
SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
+SDL_X11_SYM(Status,XInitThreads,(void),(),return)
SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
SDL_X11_SYM(int,XPending,(Display* a),(a),return)
SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c
index bbf0d5d..b4f9f1b 100644
--- a/src/video/x11/SDL_x11video.c
+++ b/src/video/x11/SDL_x11video.c
@@ -103,6 +103,7 @@ static SDL_VideoDevice *X11_CreateDevice(int devindex)
SDL_VideoDevice *device = NULL;
if ( SDL_X11_LoadSymbols() ) {
+ XInitThreads();
/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
if ( device ) { |
FWIW, here is the failure, which doesn't happen with the patch applied:
|
Go ahead and do it. |
sezero
added a commit
that referenced
this issue
Apr 13, 2022
|
mikrosk
pushed a commit
to mikrosk/SDL-1.2
that referenced
this issue
Dec 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This bug report was migrated from our old Bugzilla tracker.
Reported in version: 1.2.15
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2015-01-12 12:02:20 +0000, Petr Pisar wrote:
On 2015-02-01 10:29:56 +0000, wrote:
On 2015-08-25 09:38:21 +0000, Ryan C. Gordon wrote:
The text was updated successfully, but these errors were encountered: