Page 1 of 2

[HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT ver

Posted: Sat Apr 30, 2016 11:11 am
by vanfanel
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.

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
Sometimes, the Raspberry doesn't event crash: it turns off. That thread creation/exiting overkill is to blame I guess :(

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]
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:

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;
The distributed compilator I am using (this is on the compilation server):
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)
And on the Pi side:
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)

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Mon May 02, 2016 8:27 am
by Csonicgo
Yep I'm getting this too. Chex Quest Episode 2 (CQ3 zdoom version) fails to load at all, getting the same alignment errors. Pi 1, Pi 2 and Pi 3 all complain about the same issues.

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Mon May 02, 2016 8:58 am
by _mental_
There are a few potential unaligned reads in r_segs.cpp. There is openings variable declared as pointer to shorts (16-bit). Some values are added to it and then cast and dereference it as pointer to fixed_t and float (32-bit). If the added value is odd, you will have the same crash on any platform with strict alignment rules.
I don't know how it worked before renderer floatification but those cast were there for a while. I'm not working with Pi but is it possible that 32-bit integers are allowed to be unaligned but floats are not?

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Mon May 02, 2016 10:46 am
by Graf Zahl
_mental_ wrote:is it possible that 32-bit integers are allowed to be unaligned but floats are not?
Easily. An int is relatively easy to read in two parts, but a float would have to be copied around. In any case, data structures like that are generally bad and should be avoided.

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Mon May 02, 2016 10:59 am
by Edward-san
The fast solution would be to use memcpy where a misalignment is possible. For example, that problematic line of code:

Code: Select all

double istart = *((float *)(openings + ds_p->swall)) * yscale;
could be replaced by:

Code: Select all

float fstart;
memcpy((BYTE *)&fstart, (BYTE *)(openings + ds_p->swall), sizeof(float)); 
double istart = (double)fstart * yscale;
Does this help with the crash?

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Tue May 03, 2016 4:28 pm
by vanfanel
Still crashing, it seems to be catching fire on a different place now:

Code: Select all

[New Thread 0x72aff450 (LWP 26967)]
[New Thread 0x754ff450 (LWP 26968)]
[Thread 0x72aff450 (LWP 26967) exited]

Program received signal SIGBUS, Bus error.
0x00196ce8 in R_StoreWallRange (start=163, stop=168) at /home/pi/src/zdoom/src/r_segs.cpp:2526
2526					double iend = *(swal - 1) * yscale;
(gdb) bt
#0  0x00196ce8 in R_StoreWallRange (start=163, stop=168) at /home/pi/src/zdoom/src/r_segs.cpp:2526
#1  0x0016f884 in R_ClipWallSegment (first=160, last=168, solid=false) at /home/pi/src/zdoom/src/r_bsp.cpp:227
#2  0x0017168c in R_AddLine (line=0xe3e1c8) at /home/pi/src/zdoom/src/r_bsp.cpp:753
#3  0x00173e20 in R_Subsector (sub=0xe14988) at /home/pi/src/zdoom/src/r_bsp.cpp:1348
#4  0x00173f9c in R_RenderBSPNode (node=0xe14989) at /home/pi/src/zdoom/src/r_bsp.cpp:1388
#5  0x00173f20 in R_RenderBSPNode (node=0xe3a14c) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#6  0x00173f20 in R_RenderBSPNode (node=0xe3a188) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#7  0x00173f20 in R_RenderBSPNode (node=0xe3a278) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#8  0x00173f20 in R_RenderBSPNode (node=0xe3a3a4) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#9  0x00173f20 in R_RenderBSPNode (node=0xe3b538) at /home/pi/src/zdoom/src/r_bsp.cpp:1379
#10 0x001832a8 in R_RenderActorView (actor=0xdf2d88, dontmaplines=false) at /home/pi/src/zdoom/src/r_main.cpp:933
#11 0x0016ddd4 in FSoftwareRenderer::RenderView (this=0x9f0cb0, player=0x8c2058 <players>)
    at /home/pi/src/zdoom/src/r_swrenderer.cpp:111
#12 0x002ae22c in D_Display () at /home/pi/src/zdoom/src/d_main.cpp:770
#13 0x002aef40 in D_DoomLoop () at /home/pi/src/zdoom/src/d_main.cpp:1013
#14 0x002b37a4 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


Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Tue May 03, 2016 4:46 pm
by Graf Zahl
Different place but same cause. It's still the openings array with some dirty casts.


My 2 cents: I think this needs to be refactored. The way this stuff is used is just an open invitation to trouble on hardware with strict alignment rules.

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Tue May 03, 2016 4:55 pm
by Edward-san
Okay, regarding the new crash, change that line with:

Code: Select all

memcpy((BYTE *)&fstart, (BYTE *)(swal - 1), sizeof(float));
double iend = (double)fstart * yscale;
and try again.

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Tue May 03, 2016 5:37 pm
by vanfanel
Another crash:

Code: Select all

[Thread 0x722ff450 (LWP 8363) exited]
[New Thread 0x712ff450 (LWP 8364)]
[Thread 0x71aff450 (LWP 8357) exited]

Program received signal SIGBUS, Bus error.
0x0018c188 in BlastMaskedColumn (blastfunc=0x19bf5c <R_DrawMaskedColumn(unsigned char const*, FTexture::Span const*)>, 
    tex=0xa88850) at /home/pi/src/zdoom/src/r_segs.cpp:183
183		dc_iscale = xs_Fix<16>::ToFix(MaskedSWall[dc_x] * MaskedScaleY);
(gdb) bt
#0  0x0018c188 in BlastMaskedColumn (
    blastfunc=0x19bf5c <R_DrawMaskedColumn(unsigned char const*, FTexture::Span const*)>, tex=0xa88850)
    at /home/pi/src/zdoom/src/r_segs.cpp:183
#1  0x0018d2c4 in R_RenderMaskedSegRange (ds=0xf58140, x1=98, x2=102) at /home/pi/src/zdoom/src/r_segs.cpp:457
#2  0x001a2f7c in R_DrawMaskedSingle (renew=false) at /home/pi/src/zdoom/src/r_things.cpp:2352
#3  0x001a3034 in R_DrawMasked () at /home/pi/src/zdoom/src/r_things.cpp:2366
#4  0x00183388 in R_RenderActorView (actor=0xdf36a8, dontmaplines=false) at /home/pi/src/zdoom/src/r_main.cpp:961
#5  0x0016ddd4 in FSoftwareRenderer::RenderView (this=0x9f0cb0, player=0x8c2068 <players>)
    at /home/pi/src/zdoom/src/r_swrenderer.cpp:111
#6  0x002ae244 in D_Display () at /home/pi/src/zdoom/src/d_main.cpp:770
#7  0x002aef58 in D_DoomLoop () at /home/pi/src/zdoom/src/d_main.cpp:1013
#8  0x002b37bc in D_DoomMain () at /home/pi/src/zdoom/src/d_main.cpp:2642
#9  0x001691c4 in main (argc=4, argv=0x7efff7e4) at /home/pi/src/zdoom/src/posix/sdl/i_main.cpp:317


Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Tue May 03, 2016 6:28 pm
by Edward-san
hmmm, try to replace that code with this:

Code: Select all

	float temp;
	memcpy((BYTE *)&temp, (BYTE *)(MaskedSWall+dc_x), sizeof(float));
	dc_iscale = xs_Fix<16>::ToFix(temp * MaskedScaleY);

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Tue May 03, 2016 9:47 pm
by randi
How about you just change R_NewOpening() so that it always returns 4-byte aligned addresses? Just stick this at the beginning of the function:

Code: Select all

len = (len + 1) & ~1;

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Wed May 04, 2016 3:22 am
by Edward-san
Maybe you meant:

Code: Select all

len = (len + 3) & ~3;
? Your code would keep only the 2-byte alignment..

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Wed May 04, 2016 6:42 am
by randi
No, it counts in shorts, not bytes.

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Wed May 04, 2016 3:24 pm
by vanfanel
@randi & Edward-san: adding "len = (len + 1) & ~1;" to R_NewOpening() does, indeed, prevent the crashes.

Now I get another crash but it happens with Chris patch only...

I will report to the other thread, because it's a different crash not appearing in the main git repo head, only in Chris fork with OpenAL threaded code.

Re: [HEAD, ARM/LINUX] Crash on Raspberry Pi with recent GIT

Posted: Wed May 04, 2016 3:32 pm
by Edward-san
vanfanel: you should show the new crash in the other thread.