apportable / openal-soft

GNU Lesser General Public License v3.0
50 stars 32 forks source link

Crash in alSourcePlay for arm64-v8a build. #5

Open stolk opened 7 years ago

stolk commented 7 years ago

I have working code that uses openal-soft. Everything is just fine on armeabi-v7a builds.

But when I build for arm64_v8a, I see SIGSEGV in alSourcePlay.

F/libc    ( 4570): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xf6db8b3d0bd82f in tid 4585 (Thread-1410)
F/DEBUG   (  497): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F/DEBUG   (  497): Build fingerprint: 'Huawei/JDN/hwjdn:6.0.1/HuaweiMediaPad/JDN-W09C233B007:user/release-keys'
F/DEBUG   (  497): Revision: '0'
F/DEBUG   (  497): ABI: 'arm64'
F/DEBUG   (  497): pid: 4570, tid: 4585, name: Thread-1410  >>> org.stolk.coo <<<
F/DEBUG   (  497): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xf6db8b3d0bd82f
F/DEBUG   (  497):     x0   00000055be87c650  x1   00000000be87c650  x2   0000000000000000  x3   0000007f99ef0450
F/DEBUG   (  497):     x4   0000000000000000  x5   0000000000004005  x6   0000000000000000  x7   0000007f82fee304
F/DEBUG   (  497):     x8   bdf6db8b3d0bd82f  x9   bdf6db8b3d0bd82f  x10  0000000000000000  x11  0000000000000004
F/DEBUG   (  497):     x12  00000000be87c650  x13  0000000000000000  x14  0000000000000001  x15  0000007f9f39eaf8
F/DEBUG   (  497):     x16  0000007f821ed5d0  x17  0000007f82083a24  x18  0000000000004005  x19  00000055beebd910
F/DEBUG   (  497):     x20  0000007f99eef5c4  x21  0000000000000001  x22  0000007f82144148  x23  0000007f8214415a
F/DEBUG   (  497):     x24  00000000be87c650  x25  0000000000000000  x26  0000007f821f1790  x27  0000000000001014
F/DEBUG   (  497):     x28  0000000000001013  x29  0000007f99eef5b0  x30  0000007f820817c4
F/DEBUG   (  497):     sp   0000007f99eef560  pc   0000007f82081934  pstate 0000000080000000
F/DEBUG   (  497):
F/DEBUG   (  497): backtrace:
F/DEBUG   (  497):     #00 pc 000000000019c934  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (alSourcePlayv+536)
F/DEBUG   (  497):     #01 pc 000000000019c6f8  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (alSourcePlay+44)
F/DEBUG   (  497):     #02 pc 00000000000a5f6c  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (_ZN5MoVis9MusicPlayEPKc+508)
F/DEBUG   (  497):     #03 pc 00000000000a0d24  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (_ZN5MoVis13ParseSimEventEPKcPK3Wld+1276)
F/DEBUG   (  497):     #04 pc 000000000009f7f0  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (_ZN5MoVis10RecvEventsEPK3Wld+148)
F/DEBUG   (  497):     #05 pc 000000000009f1a0  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (_ZN5MoVis6UpdateEfifPK3Wld+672)
F/DEBUG   (  497):     #06 pc 000000000009c3bc  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so (android_main+1708)
F/DEBUG   (  497):     #07 pc 0000000000091958  /data/app/org.stolk.coo-2/lib/arm64/libcoo.so
F/DEBUG   (  497):     #08 pc 0000000000067614  /system/lib64/libc.so (_ZL15__pthread_startPv+52)
F/DEBUG   (  497):     #09 pc 000000000001c684  /system/lib64/libc.so (__start_thread+16)
F/DEBUG   (  497):
F/DEBUG   (  497): Tombstone written to: /data/tombstones/tombstone_04
stolk commented 7 years ago

It turned out I was using a source tree configured for 32 bit use. In config,h:

/* Define to the size of a void pointer type */
#define SIZEOF_VOIDP 4

...which is not valid for 64 bit.

Seeing that jni/OpenAL/include/config.h is checked into the repo, it could probably use an

#if defined(__aarch64__)
#else
#endif
marcsalem commented 6 years ago

This version of openal-soft is optimized for ARMv5. For v8 you're better off using an updated version that uses clang intrinsics to improve performance and can better use the NEON hardware in v8.

Shchvova commented 5 years ago

@marcsalem which version is that? Could you share a link please?