[HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT ver
Posted: Sat Apr 30, 2016 11:11 am
Recent git versions of ZDOOM from the main repository (https://github.com/rheit/zdoom.git)crash very badly on the Raspberry Pi 2.
They are creating an INSANE number of threads and destroying them each frame. Finally, they crash.
Sometimes, the Raspberry doesn't event crash: it turns off. That thread creation/exiting overkill is to blame I guess 
With GDB:
NOTE: there are infinite thread creation/destruction before the point where it crashes, I have only copied the relevant part.
And another GDB session for comparission:
The distributed compilator I am using (this is on the compilation server):
They are creating an INSANE number of threads and destroying them each frame. Finally, they crash.
Code: Select all
pi@raspberrypi:~/doom $ ./doom
ZDoom <unknown version> - - SDL version
Compiled on Mar 25 2016
M_LoadDefaults: Load system defaults.
W_Init: Init WADfiles.
adding /home/pi/doom/zdoom.pk3, 585 lumps
adding doomu.wad, 2306 lumps
I_Init: Setting up machine state.
I_InitSound: Initializing OpenAL
Opened device ALSA Default
EFX enabled
V_Init: allocate screen.
S_Init: Setting up sound.
ST_Init: Init startup screen.
Checking cmd-line parameters...
S_InitData: Load sound definitions.
G_ParseMapInfo: Load map definitions.
Texman.Init: Init texture manager.
ParseTeamInfo: Load team definitions.
LoadActors: Load actor definitions.
DECORATE parsing took 409.11 ms
R_Init: Init Doom refresh subsystem.
DecalLibrary: Load decals.
M_Init: Init menus.
P_Init: Init Playloop state.
ParseSBarInfo: Loading default status bar definition.
ParseSBarInfo: Loading custom status bar definition.
D_CheckNetGame: Checking network game status.
player 1 of 1 (1 nodes)
Using video driver RPI
Resolution: 320 x 200
e1m1 - Hangar
Picked up an armor bonus.
Picked up an armor bonus.
Picked up the armor.
*** Fatal Error ***
Invalid address alignment (signal 7)
Address: 0x1bf576a
Generating zdoom-crash.log and killing process 260, please wait... 40 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
/build/gdb-nrlhe3/gdb-7.7.1+dfsg/gdb/frame.c:472: internal-error: get_frame_id: Assertion `fi->this_id.p' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Unable to dump core, use `ulimit -c unlimited' before executing GDB next time.
sh: 1: xmessage: not found
./doom: line 1: 260 Killed ./zdoom -iwad doomu.wad -nomusic

With GDB:
Code: Select all
[New Thread 0x754ff450 (LWP 7767)]
[Thread 0x754ff450 (LWP 7767) exited]
[New Thread 0x71aff450 (LWP 7768)]
[Thread 0x71aff450 (LWP 7768) exited]
[New Thread 0x754ff450 (LWP 7769)]
Program received signal SIGBUS, Bus error.
0x00196cb8 in R_StoreWallRange (start=28, stop=34) at /home/pi/src/zdoom/src/r_segs.cpp:2522
2522 double istart = *((float *)(openings + ds_p->swall)) * yscale;
(gdb) bt
#0 0x00196cb8 in R_StoreWallRange (start=28, stop=34) at /home/pi/src/zdoom/src/r_segs.cpp:2522
#1 0x0016f884 in R_ClipWallSegment (first=21, last=34, solid=false) at /home/pi/src/zdoom/src/r_bsp.cpp:227
#2 0x0017168c in R_AddLine (line=0xe3cf40) at /home/pi/src/zdoom/src/r_bsp.cpp:753
#3 0x00173e20 in R_Subsector (sub=0xe143b8) at /home/pi/src/zdoom/src/r_bsp.cpp:1348
#4 0x00173f9c in R_RenderBSPNode (node=0xe143b9) at /home/pi/src/zdoom/src/r_bsp.cpp:1388
#5 0x00173f20 in R_RenderBSPNode (node=0xe38ec4) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#6 0x00173f20 in R_RenderBSPNode (node=0xe38f00) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#7 0x00173f20 in R_RenderBSPNode (node=0xe38ff0) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#8 0x00173f20 in R_RenderBSPNode (node=0xe3911c) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#9 0x00173f20 in R_RenderBSPNode (node=0xe3a2b0) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#10 0x001832a8 in R_RenderActorView (actor=0xdecc98, dontmaplines=false) at /home/pi/src/zdoom/src/r_main.cpp:933
#11 0x0016ddd4 in FSoftwareRenderer::RenderView (this=0x9f1aa8, player=0x8c2048 <players>)
at /home/pi/src/zdoom/src/r_swrenderer.cpp:111
#12 0x002ae21c in D_Display () at /home/pi/src/zdoom/src/d_main.cpp:770
#13 0x002aef30 in D_DoomLoop () at /home/pi/src/zdoom/src/d_main.cpp:1013
#14 0x002b3794 in D_DoomMain () at /home/pi/src/zdoom/src/d_main.cpp:2642
#15 0x001691c4 in main (argc=4, argv=0x7efff7e4) at /home/pi/src/zdoom/src/posix/sdl/i_main.cpp:317
(gdb) list
2517 {
2518 *lwal++ = lwall[i] + xoffset;
2519 *swal++ = swall[i];
2520 }
2521
2522 double istart = *((float *)(openings + ds_p->swall)) * yscale;
2523 double iend = *(swal - 1) * yscale;
2524 #if 0
2525 ///This was for avoiding overflow when using fixed point. It might not be needed anymore.
2526 const double mini = 3 / 65536.0;
(gdb) c
Continuing.
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: Broken pipe
*** Fatal Error ***
[Thread 0x754ff450 (LWP 7769) exited]
[New Thread 0x71aff450 (LWP 7770)]
[Thread 0x72aff450 (LWP 7765) exited]
[Thread 0x71aff450 (LWP 7770) exited]
[New Thread 0x71aff450 (LWP 7775)]
[Thread 0x71aff450 (LWP 7775) exited]
[New Thread 0x72aff450 (LWP 7776)]
[Thread 0x72aff450 (LWP 7776) exited]
[New Thread 0x71aff450 (LWP 7777)]
[Thread 0x71aff450 (LWP 7777) exited]
[New Thread 0x72aff450 (LWP 7778)]
Invalid address alignment (signal 7)
Address: 0xf6c806
Generating zdoom-crash.log and killing process 4784, please wait... [Thread 0x72aff450 (LWP 7778) exited]
[New Thread 0x71aff450 (LWP 7782)]
[New Thread 0x72aff450 (LWP 7785)]
[Thread 0x71aff450 (LWP 7782) exited]
[New Thread 0x754ff450 (LWP 7786)]
[Thread 0x72aff450 (LWP 7785) exited]
[Thread 0x754ff450 (LWP 7786) exited]
[New Thread 0x72aff450 (LWP 7787)]
[New Thread 0x754ff450 (LWP 7788)]
[Thread 0x754ff450 (LWP 7788) exited]
[New Thread 0x71aff450 (LWP 7789)]
[New Thread 0x754ff450 (LWP 7790)]
[Thread 0x71aff450 (LWP 7789) exited]
[Thread 0x72aff450 (LWP 7787) exited]
[Thread 0x754ff450 (LWP 7790) exited]
[New Thread 0x72aff450 (LWP 7791)]
[New Thread 0x754ff450 (LWP 7792)]
gdb-respfile-hp0Adb:1: Error in sourced command file:
warning: process 4784 is already traced by process 4782
ptrace: Operation not permitted.
[Thread 0x754ff450 (LWP 7792) exited]
[New Thread 0x71aff450 (LWP 7793)]
[Switching to Thread 0x76ad8b40 (LWP 4789)]
warning: Unable to fetch general register.sh: 1: xmessage: not found
Register 13 is not available
create_thread (stackaddr=<optimized out>, warning: Unable to fetch general register.
attr=<unavailable>, warning: Unable to fetch general register.
pd=<unavailable>)
at ../nptl/sysdeps/pthread/createthread.c:223
223 ../nptl/sysdeps/pthread/createthread.c: No such file or directory.
ptrace: No such process.
(gdb) q
A debugging session is active.
Inferior 1 [process 4784] will be killed.
Quit anyway? (y or n) y
[Thread 0x76ad8b40 (LWP 4789) exited]
And another GDB session for comparission:
Code: Select all
[Thread 0x712ff450 (LWP 10993) exited]
[New Thread 0x754ff450 (LWP 10994)]
[Thread 0x754ff450 (LWP 10994) exited]
[New Thread 0x712ff450 (LWP 10995)]
[New Thread 0x754ff450 (LWP 10996)]
[Thread 0x712ff450 (LWP 10995) exited]
Program received signal SIGBUS, Bus error.
0x00196cb8 in R_StoreWallRange (start=241, stop=245) at /home/pi/src/zdoom/src/r_segs.cpp:2522
2522 double istart = *((float *)(openings + ds_p->swall)) * yscale;
(gdb) bt
#0 0x00196cb8 in R_StoreWallRange (start=241, stop=245) at /home/pi/src/zdoom/src/r_segs.cpp:2522
#1 0x0016f884 in R_ClipWallSegment (first=237, last=245, solid=false) at /home/pi/src/zdoom/src/r_bsp.cpp:227
#2 0x0017168c in R_AddLine (line=0xe3cf40) at /home/pi/src/zdoom/src/r_bsp.cpp:753
#3 0x00173e20 in R_Subsector (sub=0xe143b8) at /home/pi/src/zdoom/src/r_bsp.cpp:1348
#4 0x00173f9c in R_RenderBSPNode (node=0xe143b9) at /home/pi/src/zdoom/src/r_bsp.cpp:1388
#5 0x00173f20 in R_RenderBSPNode (node=0xe38ec4) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#6 0x00173f20 in R_RenderBSPNode (node=0xe38f00) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#7 0x00173f20 in R_RenderBSPNode (node=0xe38ff0) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#8 0x00173f20 in R_RenderBSPNode (node=0xe3911c) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#9 0x00173f20 in R_RenderBSPNode (node=0xe3a2b0) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#10 0x001832a8 in R_RenderActorView (actor=0xdecc98, dontmaplines=false) at /home/pi/src/zdoom/src/r_main.cpp:933
#11 0x0016ddd4 in FSoftwareRenderer::RenderView (this=0x9f1aa8, player=0x8c2048 <players>)
at /home/pi/src/zdoom/src/r_swrenderer.cpp:111
#12 0x002ae21c in D_Display () at /home/pi/src/zdoom/src/d_main.cpp:770
#13 0x002aef30 in D_DoomLoop () at /home/pi/src/zdoom/src/d_main.cpp:1013
#14 0x002b3794 in D_DoomMain () at /home/pi/src/zdoom/src/d_main.cpp:2642
#15 0x001691c4 in main (argc=4, argv=0x7efff7e4) at /home/pi/src/zdoom/src/posix/sdl/i_main.cpp:317
(gdb) list
2517 {
2518 *lwal++ = lwall[i] + xoffset;
2519 *swal++ = swall[i];
2520 }
2521
2522 double istart = *((float *)(openings + ds_p->swall)) * yscale;
2523 double iend = *(swal - 1) * yscale;
2524 #if 0
2525 ///This was for avoiding overflow when using fixed point. It might not be needed anymore.
2526 const double mini = 3 / 65536.0;
And on the Pi side:manuel@vader:~$ x-tools/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=x-tools/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/home/manuel/x-tools/arm-rpi-linux-gnueabihf/libexec/gcc/arm-rpi-linux-gnueabihf/4.9.4/lto-wrapper
Target: arm-rpi-linux-gnueabihf
Configured with: /home/manuel/cross/.build/src/gcc-linaro-4.9-2015.06/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=arm-rpi-linux-gnueabihf --prefix=/home/manuel/x-tools/arm-rpi-linux-gnueabihf --with-sysroot=/home/manuel/x-tools/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot --enable-languages=c,c++ --with-cpu=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-pkgversion='crosstool-NG 7b69ac2' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --with-gmp=/home/manuel/cross/.build/arm-rpi-linux-gnueabihf/buildtools --with-mpfr=/home/manuel/cross/.build/arm-rpi-linux-gnueabihf/buildtools --with-mpc=/home/manuel/cross/.build/arm-rpi-linux-gnueabihf/buildtools --with-isl=/home/manuel/cross/.build/arm-rpi-linux-gnueabihf/buildtools --with-cloog=/home/manuel/cross/.build/arm-rpi-linux-gnueabihf/buildtools --with-libelf=/home/manuel/cross/.build/arm-rpi-linux-gnueabihf/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --disable-nls --disable-multilib --with-local-prefix=/home/manuel/x-tools/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot --enable-long-long
Thread model: posix
gcc version 4.9.4 20150629 (prerelease) (crosstool-NG 7b69ac2)
pi@raspberrypi:~/doom $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)