Problems with SDL v1.2.9 on Techsol TPC-57 [ARM Linux, fbcon]

Hello,

I am having trouble with running SDL games on Techsol’s TPC-57 computer
using the fbcon video driver on ARM Linux. You can find some
information on this computer in this press release:
http://www.medallionsystem.com/products/News/TechsolProductNews_TPC57.html

The games in question are prBoom (a Doom source port using SDL) and
Abuse-SDL. The behaviour differs depending upon whether or not I
comment out the following ioctl call in SDL_fbevents.c:

ioctl(keyboard_fd, VT_WAITACTIVE, current_vt);

If I comment out this line, prBoom and Abuse-SDL both crash with a
segfault in the SDL_FillRect function. If I uncomment the line,
execution of the two aformentioned games hangs in the ioctl call while
waiting for a certain virtual terminal (VT) to be activated.

Here are some backtraces:

Abuse (without VT_WAITACTIVE ioctl call)========================================

root at tsi-tpc57:/home/user# gdb /usr/bin/abuse.sdl
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “arm-linux”…Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) r -datadir /usr/share/games/abuse
Starting program: /usr/bin/abuse.sdl -datadir /usr/share/games/abuse
Added himem block (3072000 bytes)
Memory available : 3071864
Abuse-SDL 0.7.0
Abuse (Version 2.00)

Program received signal SIG32, Real-time event 32.
0x400b4128 in pthread_create () from /lib/libpthread.so.0
(gdb) c
Continuing.
Sound : Enabled
Specs : main file set to abuse.spe
Protocol Installed : UNIX generic TCPIP
Lisp : 529 symbols defined, 99 system functions, 321 pre-compiled functions
(load “abuse.lsp”) […]
Lisp : tmp space resized to 16384
Engine : Registering base graphics

Program received signal SIGSEGV, Segmentation fault.
SDL_FillRect (dst=0xc6318, dstrect=0xc6338, color=0) at SDL_surface.c:619
619 SDL_surface.c: No such file or directory.
in SDL_surface.c
Current language: auto; currently c
(gdb) bt full
#0 SDL_FillRect (dst=0xc6318, dstrect=0xc6338, color=0) at
SDL_surface.c:619
_n = 16
_p = (Uint32 *) 0x406c3000
_val = 0
n = 163
video = (SDL_VideoDevice *) 0x280
x = 640
y = 158
row = (Uint8 *) 0x406c2e80 <Address 0x406c2e80 out of bounds>
#1 0x40068378 in SDL_SetVideoMode (width=640, height=400, bpp=8,
flags=805306369) at SDL_video.c:502
video = (SDL_VideoDevice *) 0xc5a38
prev_mode = (SDL_Surface *) 0x0
mode = (SDL_Surface *) 0xc6318
video_w = 640
video_h = 400
video_bpp = 8
is_opengl = 0
saved_grab = SDL_GRAB_OFF
#2 0x000768e0 in set_mode (mode=16, argc=163, argv=0x1900280) at
video.cpp:107
vidFlags = 536870913
#3 0x0006d668 in game (this=0x4046f214, argc=3, argv=0xbea1edc4)
at game.cpp:1449
—Type to continue, or q to quit—
i = 3
fastpath = 0x4046f4cc "/home/root/.abuse/fastload.dat"
font_pict = 163
#4 0x00070934 in main (argc=3, argv=0xbea1edc4) at game.cpp:2676
g = (game *) 0x4039e46c
xx = 948
(gdb)

prBoom (without VT_WAITACTIVE ioctl call)

root at tsi-tpc57:~# gdb /usr/games/prboom
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “arm-linux”…Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) r -height 240
Starting program: /usr/games/prboom -height 240

prboom v2.4.0 (http://prboom.sourceforge.net/)
found /usr/games/doom1/doom1.wad
IWAD found: /usr/games/doom1/doom1.wad
PrBoom (built Apr 3 2006), playing: DOOM Shareware
PrBoom is released under the GNU General Public license v2.0.
You are welcome to redistribute it under certain conditions.
It comes with ABSOLUTELY NO WARRANTY. See the file COPYING for details.
M_LoadDefaults: Load system defaults.
default file: /home/root/.prboom/prboom.cfg
I_SetRes: Using resolution 320x240
V_Init: allocate screens.
found /usr/share/games/doom/prboom.wad
D_InitNetGame: Checking for network game.
W_Init: Init WADfiles.
adding /usr/games/doom1/doom1.wad
adding /usr/share/games/doom/prboom.wad
W_InitCache

M_Init: Init miscellaneous info.
R_Init: Init DOOM refresh daemon -
R_LoadTrigTables: Endianness…ok.
R_InitData: Textures Flats Sprites
R_Init: R_InitPlanes R_InitLightTables R_InitSkyMap R_InitTranslationsTables
P_Init: Init Playloop state.
I_Init: Setting up machine state.
I_InitSound:
Program received signal SIG32, Real-time event 32.
0x400ba128 in pthread_create () from /lib/libpthread.so.0
(gdb) c
Continuing.
configured audio device with 1024 samples/slice
I_InitSound: sound module ready
S_Init: Setting up sound.
S_Init: default sfx volume 8
HU_Init: Setting up heads up display.
I_InitGraphics: 320x240
I_UpdateVideoMode: 320x240 (fullscreen)

Program received signal SIGSEGV, Segmentation fault.
SDL_FillRect (dst=0x11e930, dstrect=0x11e950, color=0) at SDL_surface.c:619
619 SDL_surface.c: No such file or directory.
in SDL_surface.c
(gdb) bt full
#0 SDL_FillRect (dst=0x11e930, dstrect=0x11e950, color=0) at
SDL_surface.c:619
_n = 16
_p = (Uint32 *) 0x403da000
_val = 0
n = 83
video = (SDL_VideoDevice *) 0x140
x = 320
y = 237
row = (Uint8 *) 0x403d9fc0 <Address 0x403d9fc0 out of bounds>
#1 0x4006e378 in SDL_SetVideoMode (width=320, height=240, bpp=8,
flags=3758096385) at SDL_video.c:502
video = (SDL_VideoDevice *) 0x11e050
prev_mode = (SDL_Surface *) 0x0
mode = (SDL_Surface *) 0x11e930
video_w = 320
video_h = 240
video_bpp = 8
is_opengl = 0
saved_grab = SDL_GRAB_OFF
#2 0x0008cb24 in I_UpdateVideoMode () at i_video.c:532
w = 320
h = 240
init_flags = -536870912
—Type to continue, or q to quit—
#3 0x0008cd54 in I_InitGraphics () at i_video.c:479
titlebuffer = "s up
display.\n\000.\000\000\000\000\000\000\000.b.\027\000f\000\000\000\034\224…\001\000\000\000\0.
firsttime = 0
#4 0x000407b4 in D_DoomMainSetup () at d_main.c:1578
p = -1
i = 1076637696
slot = 3
cena = 0x98398 "ICWEFDA"
pos = 0x400b8704 “”
#5 0x00040bfc in D_DoomMain () at d_main.c:1668
No locals.
#6 0x0005b688 in main (argc=3, argv=0xbeb9ada4) at i_main.c:415
No locals.
(gdb)

Abuse (with VT_WAITACTIVE ioctl call)

root at tsi-tpc57:~# gdb /usr/bin/abuse.sdl
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “arm-linux”…Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) r -datadir /usr/share/games/abuse
Starting program: /usr/bin/abuse.sdl -datadir /usr/share/games/abuse
Added himem block (3072000 bytes)
Memory available : 3071864
Abuse-SDL 0.7.0
Abuse (Version 2.00)

Program received signal SIG32, Real-time event 32.
0x400b4128 in pthread_create () from /lib/libpthread.so.0
(gdb) c
Continuing.
Sound : Enabled
Specs : main file set to abuse.spe
Protocol Installed : UNIX generic TCPIP
Lisp : 529 symbols defined, 99 system functions, 321 pre-compiled functions
(load “abuse.lsp”) [… ]
Lisp : tmp space resized to 16384
Engine : Registering base graphics

Program received signal SIGINT, Interrupt.
0x4033d6c4 in ioctl () from /lib/libc.so.6
(gdb) bt full
#0 0x4033d6c4 in ioctl () from /lib/libc.so.6
No symbol table info available.
#1 0x4006dd58 in FB_EnterGraphicsMode (this=0xc5a38) at SDL_fbevents.c:175
vtstate = {v_active = 2, v_signal = 48867, v_state = 27}
keyboard_termios = {c_iflag = 1073778120, c_oflag = 0, c_cflag = 1,
c_lflag = 1, c_line = 0 ‘\0’,
c_cc =
"\000\000\000X?\003@\200\002\000\000\001\000\0000\001\000\00008Z\f\000\030c\f\000\b\000\000\000\214",
c_ispeed = 1}
#2 0x4006cd54 in FB_SetVideoMode (this=0xc5a38, current=0xc6318, width=640,
height=400, bpp=8, flags=805306369) at SDL_fbvideo.c:730
finfo = {id = “\000\020\002@\200\002\000\000\200Z…\000@”,
smem_start = 1073778120, smem_len = 0, type = 1, type_aux = 1, visual
= 0,
xpanstep = 62008, ypanstep = 16387, ywrapstep = 28208,
line_length = 1074294320, mmio_start = 805306369, mmio_len = 809528,
accel = 8, reserved = {0, 0, 23180}}
vinfo = {xres = 1073876992, yres = 3202570876,
xres_virtual = 1073778328, yres_virtual = 1073879656, xoffset = 0,
yoffset = 0, bits_per_pixel = 1, grayscale = 0, red = {offset = 1,
length = 0, msb_right = 3202570780}, green = {offset = 387124,
length = 568, msb_right = 0}, blue = {offset = 1073857136,
length = 1074007941, msb_right = 1073857136}, transp = {
offset = 1074008030, length = 1073996008, msb_right = 1074004360},
nonstd = 1074000440, activate = 1073857136, height = 1074003336,
—Type to continue, or q to quit—
width = 1073857136, accel_flags = 1073791400, pixclock = 1073778120,
left_margin = 0, right_margin = 1, upper_margin = 1, lower_margin = 0,
hsync_len = 1073997640, vsync_len = 640, sync = 0, vmode = 400,
rotate = 0,
reserved = {0, 277, 1073996008, 1074004360, 1074289976}}
i = 22023
Rmask = 4
Gmask = 4294967292
Bmask = 1074290336
surfaces_mem = 0x30000001 <Address 0x30000001 out of bounds>
surfaces_len = 805306369
#3 0x400682c0 in SDL_SetVideoMode (width=640, height=400, bpp=8,
flags=805306369) at SDL_video.c:659
video = (SDL_VideoDevice *) 0xc5a38
prev_mode = (SDL_Surface *) 0xc6318
mode = (SDL_Surface *) 0x40086e30
video_w = 640
video_h = 400
video_bpp = 8
is_opengl = 0
saved_grab = SDL_GRAB_OFF
#4 0x000768e0 in set_mode (mode=-4, argc=22023, argv=0x4) at video.cpp:107
vidFlags = 536870913
#5 0x0006d668 in game (this=0x4046f214, argc=3, argv=0xbee35d94)
—Type to continue, or q to quit—
at game.cpp:1449
i = 3
fastpath = 0x4046f4cc "/home/root/.abuse/fastload.dat"
font_pict = 22023
#6 0x00070934 in main (argc=3, argv=0xbee35d94) at game.cpp:2676
g = (game *) 0x4039e46c
xx = 948
(gdb)

prBoom (with VT_WAITACTIVE ioctl call)

root at tsi-tpc57:~# gdb /usr/games/prboom
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “arm-linux”…Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) r -height 240
Starting program: /usr/games/prboom -height 240

prboom v2.4.0 (http://prboom.sourceforge.net/)
found /usr/games/doom1/doom1.wad
IWAD found: /usr/games/doom1/doom1.wad
PrBoom (built Apr 3 2006), playing: DOOM Shareware
PrBoom is released under the GNU General Public license v2.0.
You are welcome to redistribute it under certain conditions.
It comes with ABSOLUTELY NO WARRANTY. See the file COPYING for details.
M_LoadDefaults: Load system defaults.
default file: /home/root/.prboom/prboom.cfg
I_SetRes: Using resolution 320x240
V_Init: allocate screens.
found /usr/share/games/doom/prboom.wad
D_InitNetGame: Checking for network game.
W_Init: Init WADfiles.
adding /usr/games/doom1/doom1.wad
adding /usr/share/games/doom/prboom.wad
W_InitCache

M_Init: Init miscellaneous info.
R_Init: Init DOOM refresh daemon -
R_LoadTrigTables: Endianness…ok.
R_InitData: Textures Flats Sprites
R_Init: R_InitPlanes R_InitLightTables R_InitSkyMap R_InitTranslationsTables
P_Init: Init Playloop state.
I_Init: Setting up machine state.
I_InitSound:
Program received signal SIG32, Real-time event 32.
0x400ba128 in pthread_create () from /lib/libpthread.so.0
(gdb) c
Continuing.
configured audio device with 1024 samples/slice
I_InitSound: sound module ready
S_Init: Setting up sound.
S_Init: default sfx volume 8
HU_Init: Setting up heads up display.
I_InitGraphics: 320x240
I_UpdateVideoMode: 320x240 (fullscreen)

Program received signal SIGINT, Interrupt.
0x402646c4 in ioctl () from /lib/libc.so.6
(gdb) bt full
#0 0x402646c4 in ioctl () from /lib/libc.so.6
No symbol table info available.
#1 0x40073d58 in FB_EnterGraphicsMode (this=0x11e050) at SDL_fbevents.c:175
vtstate = {v_active = 2, v_signal = 48826, v_state = 27}
keyboard_termios = {c_iflag = 1073778120, c_oflag = 0, c_cflag = 1,
c_lflag = 1, c_line = 0 ‘\0’,
c_cc =
"\000\000\000XR\004@@\001\000\000\001\000\000?\001\000\000?P?\021\0000?\021\000\b\000\000\000\214",
c_ispeed = 107}
#2 0x40072d54 in FB_SetVideoMode (this=0x11e050, current=0x11e930,
width=320,
height=240, bpp=8, flags=3758096385) at SDL_fbvideo.c:730
finfo = {id = “\000\020\002@@\001\000\000.\003o…\000@”,
smem_start = 1073778120, smem_len = 0, type = 1, type_aux = 1, visual
= 0,
xpanstep = 21048, ypanstep = 16388, ywrapstep = 52784,
line_length = 1074318896, mmio_start = 3758096385, mmio_len = 1171536,
accel = 8, reserved = {0, 0, 47756}}
vinfo = {xres = 1073876992, yres = 3199861680,
xres_virtual = 1073778328, yres_virtual = 1073879656, xoffset = 0,
yoffset = 0, bits_per_pixel = 1, grayscale = 0, red = {offset = 1,
length = 0, msb_right = 3199861584}, green = {offset = 0, length = 568,
msb_right = 0}, blue = {offset = 1073857792, length = 1074032517,
msb_right = 1073857792}, transp = {offset = 1074032606,
length = 1074020584, msb_right = 1074028936}, nonstd = 1074025016,
activate = 1073857792, height = 1074027912, width = 1073857792,
—Type to continue, or q to quit—
accel_flags = 1073791400, pixclock = 1073778120, left_margin = 0,
right_margin = 1, upper_margin = 1, lower_margin = 0,
hsync_len = 1074022216, vsync_len = 320, sync = 0, vmode = 240,
rotate = 0,
reserved = {0, 277, 1074020584, 1074028936, 1074314552}}
i = 22023
Rmask = 4
Gmask = 4294967292
Bmask = 1074314912
surfaces_mem = 0xe0000001 <Address 0xe0000001 out of bounds>
surfaces_len = -536870911
#3 0x4006e2c0 in SDL_SetVideoMode (width=320, height=240, bpp=8,
flags=3758096385) at SDL_video.c:659
video = (SDL_VideoDevice *) 0x11e050
prev_mode = (SDL_Surface *) 0x11e930
mode = (SDL_Surface *) 0x4008ce30
video_w = 320
video_h = 240
video_bpp = 8
is_opengl = 0
saved_grab = SDL_GRAB_OFF
#4 0x0008cb24 in I_UpdateVideoMode () at i_video.c:532
w = 320
h = 240
—Type to continue, or q to quit—
init_flags = -536870912
#5 0x0008cd54 in I_InitGraphics () at i_video.c:479
titlebuffer = "s up
display.\n\000.\000\000\000\000\000\000\000.b.\027\000f\000\000\000\034\004o.\001\000\000\000\0.
firsttime = 0
#6 0x000407b4 in D_DoomMainSetup () at d_main.c:1578
p = -1
i = 1076637696
slot = 3
cena = 0x98398 "ICWEFDA"
pos = 0x400b8704 “”
#7 0x00040bfc in D_DoomMain () at d_main.c:1668
No locals.
#8 0x0005b688 in main (argc=3, argv=0xbeba1da4) at i_main.c:415
No locals.
(gdb)

As you can see, I am using 320x240 resolution. The TPC-57 uses the
s3c2410fb frame buffer driver and Linux kernel v2.6.12. The colour STN
display’s maximum resolution is 320x240. I know that the frame buffer
works, because both the testsprite program and an SDL Mandelbrot program
(http://www.temnet.org/wendigo/fractals/) work fine. I can also copy
bitmaps to /dev/fb0 and have the image displayed on the framebuffer.
“cat /dev/urandom > /dev/fb0” and “cat /dev/zero > /dev/fb0” both work
too. :slight_smile:

I am cross compiling all applications using Techsol’s OpenEmbedded
toolchain in a chroot environment hosted on my x86 Linux PC. The GCC
version is 3.4.4.

I do not remember exactly which ./configure command line I used the last
time I rebuilt SDL, but it would have been similar to the following:

./configure --prefix=/home/devel/sdl --build=i686-pc-linux-gnu
–host=arm-linux --enable-oss --disable-alsa --disable-esd
–disable-arts --enable-video-fbcon
–x-libraries=/home/devel/projects/oe/01/build/tmp/work/arm-linux/diet-x11-6.2.1+cvs20060206-r6/install/diet-x11/usr/lib
–without-x --x-includes=/usr/X11R6/include --enable-debug
–with-sdl-prefix=/home/devel/sdl --without-opengl --without-nasm
–without-mmx

I am using SDL v1.2.9, by the way.

Please let me know if there is something else that I should have mentioned.

Thanks,
Brolin