ClassiCube
ClassiCube copied to clipboard
Music_PlayOgg causes SIGSEGV
Apparently the size of OggState + VorbisState allocated on the stack is just too big. The total amount allocated for this function is apparently about 156 kB.
I am running Gentoo Linux with musl libc on an x64 system.
I fixed it by reducing VORBIS_MAX_BLOCK_SIZE in Vorbis.h from 8192 to 4096.
Probably just a quirk having to do with musl. Thoughts?
musl defaults to a stack size of 128kb for new threads it would seem (Threading section in https://wiki.musl-libc.org/functional-differences-from-glibc.html)
It does however appear it's possible to compile the ClassiCube executable with an additional linker flag to specify larger default stack size
Probably need to look at either dynamically allocating ogg state, or explicitly setting stack size of new thread if default would be too small in Thread_Create for pthreads
450b4c921e6af994068d278bb565710d4455feea should resolve this