Bug 124644 - SDL_Init() hangs when $DISPLAY is remote
Summary: SDL_Init() hangs when $DISPLAY is remote
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: SDL
Version: 1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-28 03:58 UTC by Johann Schoonees
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-06-08 09:04:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Johann Schoonees 2004-05-28 03:58:13 UTC
Description of problem:
SDL_init() never returns when the environment variable DISPLAY is set
to a remote computer.

Version-Release number of selected component (if applicable):
As released with Core 1: kernel 2.4.22, SDL 1.2.5, XFree86 4.3.0,
glibc 2.3.2.  Also got the same problem on RH7.1.

How reproducible:
Consistently.

Steps to Reproduce:
1. rlogin remote_computer
2. export DISPLAY=local_computer:0
3. any_SDL_app
  
Actual results:
SDL_Init() hangs and program has to be interrupted with Control-C.

Expected results:
SDL_Init() should return with either 0 on success or -1 on failure.

Additional info:
This has been reported elsewhere before, with no solution on offer:
http://www.libsdl.org/pipermail/sdl/2000-April/026564.html
http://archives.seul.org/pygame/users/Jan-2002/msg00002.html
http://lists.debian.org/debian-x/2003/08/msg00325.html

Comment 1 Johann Schoonees 2004-05-28 04:05:43 UTC
Here is a trace (slightly edited):

$ rlogin remote_computer
$ export DISPLAY=local_computer:0
$ xclock &
$ gcc -g -O2 -Wall -W -I/usr/include/SDL -L/usr/lib -lSDL -lpthread
SDL-example-1-1.c -o SDL-example-1-1
$ gdb ./SDL-example-1-1
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) run
Starting program: /home/me/SDL-example-1-1
[Thread debugging using libthread_db enabled]
[New Thread 1076908160 (LWP 16505)]
Initializing SDL.

[It hangs here.  I had to interrupt with Control-C.]

Program received signal SIGINT, Interrupt.
[Switching to Thread 1076908160 (LWP 16505)]
0x40000c32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0x40000c32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x4018e2ad in ___newselect_nocancel () from /lib/tls/libc.so.6
#2  0x4024aae2 in _XPollfdCacheDel () from /usr/X11R6/lib/libX11.so.6
#3  0x4024ba51 in _XRead () from /usr/X11R6/lib/libX11.so.6
#4  0x4007022a in SDL_XF86VidModeGetAllModeLines ()
   from /usr/lib/libSDL-1.2.so.0
#5  0x4006a853 in X11_GetVideoModes () from /usr/lib/libSDL-1.2.so.0
#6  0x4006c44e in X11_CheckMouseMode () from /usr/lib/libSDL-1.2.so.0
#7  0x40061121 in SDL_VideoInit () from /usr/lib/libSDL-1.2.so.0
#8  0x4003db56 in SDL_InitSubSystem () from /usr/lib/libSDL-1.2.so.0
#9  0x4003db97 in SDL_Init () from /usr/lib/libSDL-1.2.so.0
#10 0x0804860a in main () at SDL-example-1-1.c:9

Comment 2 Johann Schoonees 2004-06-08 00:19:07 UTC
Resolved:  This behaviour only happens when the local X server is old.
 Red Hat 7.1 (Xfree86 4.0.3) misbehaves, but Fedora Core 1 is OK
(Xfree86 4.3.0).



Note You need to log in before you can comment on or make changes to this bug.