Start my game (TVTower) with sfx and music enabled.
Start a single player game, hit escape and exit to main menu
Start a single...
on third start of the single player game it will segfault.
Thread 18 "SDLAudioP2" received signal SIGSEGV, Segmentation fault.
[Wechseln zu Thread 0x7fffd7767700 (LWP 22844)]
__memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:309
309 ../sysdeps/x86_64/multiarch/memcpy-ssse3.S: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:309
#1 0x0000000000ee5053 in memcpy (__len=512, __src=<optimized out>, __dest=<optimized out>)
at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
#2 SoLoud::getOggData (aChannels=<optimized out>, aFrameOffset=0, aFrameSize=<optimized out>, aPitch=<optimized out>, aSamples=512,
aBuffer=0x0, aOggOutputs=<optimized out>)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/audio.mod/soloud.mod/soloud/src/audiosource/wav/soloud_wavstream.cpp:232
#3 SoLoud::WavStreamInstance::getAudio (this=0x41bf9a0, aBuffer=0x0, aSamplesToRead=512, aBufferSize=<optimized out>)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/audio.mod/soloud.mod/soloud/src/audiosource/wav/soloud_wavstream.cpp:304
#4 0x0000000000ed0c3d in SoLoud::Soloud::mixBus_internal (this=this@entry=0x20b80c0, aBuffer=<optimized out>,
aSamplesToRead=aSamplesToRead@entry=1024, aBufferSize=aBufferSize@entry=1024, aScratch=<optimized out>, aBus=aBus@entry=0,
aSamplerate=<optimized out>, aChannels=<optimized out>, aResampler=<optimized out>)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/audio.mod/soloud.mod/soloud/src/core/soloud.cpp:1643
#5 0x0000000000ed23ed in SoLoud::Soloud::mix_internal (aStride=1024, aSamples=1024, this=0x20b80c0)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/audio.mod/soloud.mod/soloud/src/core/soloud.cpp:2162
#6 SoLoud::Soloud::mix (this=0x20b80c0, aBuffer=0x1efe980, aSamples=1024)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/audio.mod/soloud.mod/soloud/src/core/soloud.cpp:2223
#7 0x0000000000ff8385 in SDL_RunAudio (devicep=devicep@entry=0x1d71ab0)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/sdl.mod/sdl.mod/SDL/src/audio/SDL_audio.c:735
#8 0x0000000000f9fc36 in SDL_RunThread (thread=0x1efcd40)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/sdl.mod/sdl.mod/SDL/src/thread/SDL_thread.c:280
#9 0x0000000000ff0899 in RunThread (data=<optimized out>)
at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/sdl.mod/sdl.mod/SDL/src/thread/pthread/SDL_systhread.c:79
#10 0x00007ffff6b286db in start_thread (arg=0x7fffd7767700) at pthread_create.c:463
#11 0x00007ffff685171f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
I assume it segfaults as the SFX object gets garbage collected and so data for Soloud/SDL is no longer available.
What I do not understand here is why it happens on 3rd start - not already on second, or on 4th.
It does not happen for music (streamed) but for TSound-objects
edit: Seems to happen because I create channels ... play looped sounds in it, and reinitialize them in my game objects by just assigning new channels. So the channels might go out of scope (get deleted) but the underlaying sound stuff is still played/tried to get played by SDL/soloud. Am not sure but I think this was NOT the case with FreeAudio - so maybe a Soloud.mod-issue
edit2: fixed my code to stop channels when no longer needed ... so use code some days older than today if you want to replicate it.
Start my game (TVTower) with sfx and music enabled. Start a single player game, hit escape and exit to main menu Start a single... on third start of the single player game it will segfault.
I assume it segfaults as the SFX object gets garbage collected and so data for Soloud/SDL is no longer available.
What I do not understand here is why it happens on 3rd start - not already on second, or on 4th.
It does not happen for music (streamed) but for TSound-objects
edit: Seems to happen because I create channels ... play looped sounds in it, and reinitialize them in my game objects by just assigning new channels. So the channels might go out of scope (get deleted) but the underlaying sound stuff is still played/tried to get played by SDL/soloud. Am not sure but I think this was NOT the case with FreeAudio - so maybe a Soloud.mod-issue
edit2: fixed my code to stop channels when no longer needed ... so use code some days older than today if you want to replicate it.