Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio driver crash on quit - fluidsynth/SDL #7337

Open
nikolas opened this issue Mar 7, 2019 · 4 comments
Open

Audio driver crash on quit - fluidsynth/SDL #7337

nikolas opened this issue Mar 7, 2019 · 4 comments
Assignees

Comments

@nikolas
Copy link
Member

@nikolas nikolas commented Mar 7, 2019

Version of OpenTTD

master (3d4736c)

Expected result

No crash on quit

Actual result

fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
^CCrash encountered, generating crash log...
*** OpenTTD Crash Report ***

Crash at: Thu Mar 7 01:52:15 2019
In game date: 1960-01-04 (49) 

Crash reason:
Signal: Segmentation fault (11)
Message: <none>

OpenTTD version:
Version: 20190306-master-g3d4736cedd (0)
NewGRF ver: 1a006d64
Bits: 64
Endian: little
Dedicated: no
Build date: Mar 6 2019 19:48:56

Stacktrace:
[00] ./bin/openttd-sdl1.2(_ZNK12CrashLogUnix13LogStacktraceEPcPKc+0x40) [0x5586e36a5bb0]
[01] ./bin/openttd-sdl1.2(_ZNK8CrashLog12FillCrashLogEPcPKc+0xf0) [0x5586e3574390]
[02] ./bin/openttd-sdl1.2(_ZNK8CrashLog12MakeCrashLogEv+0x63) [0x5586e3574613]
[03] ./bin/openttd-sdl1.2(+0x389ad5) [0x5586e36a5ad5]
[04] /lib/x86_64-linux-gnu/libc.so.6(+0x37940) [0x7f04120e4940]
[05] /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1(fluid_revmodel_processmix+0x30) [0x7f04125a35f0]
[06] /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1(fluid_rvoice_mixer_render+0x847) [0x7f04125a2db7]
[07] /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1(fluid_synth_write_s16+0x245) [0x7f04125a9245]
[08] ./bin/openttd-sdl1.2(+0x2fbed1) [0x5586e3617ed1]
[09] ./bin/openttd-sdl1.2(_Z12MxMixSamplesPvj+0x8a) [0x5586e3615a2a]
[10] /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0(+0xc8ba) [0x7f0412df18ba]
[11] /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0(+0x15f28) [0x7f0412dfaf28]
[12] /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0(+0x550d9) [0x7f0412e3a0d9]
[13] /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f0412e87fa3]
[14] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f04121a680f]

Operating system: 
Name: Linux
Release: 4.19.0-2-amd64 
Version: #1 SMP Debian 4.19.16-1 (2019-01-17) 
Machine: x86_64
Compiler: GCC 8.2.0 "8.2.0"

Configuration:
Blitter: 32bpp-sse2-anim
Graphics set: original_windows (0) 
Language: /home/nik/src/OpenTTD/bin/lang/english_US.lng
Music driver: fluidsynth
Music set: OpenMSX (96) 
Network: no 
Sound driver: sdl 
Sound set: original_windows (0)
Video driver: sdl

Fonts:
Small: sprite
Medium: sprite
Large: sprite
Mono: sprite

AI Configuration (local: 0):
0: Human

Libraries:
FontConfig: 2.13.1
FreeType: 2.9.1
LZMA: 5.2.4
LZO: 2.10
PNG: 1.6.36
SDL: 1.2.15
Zlib: 1.2.11

---- gamelog start ----
Tick 0: new game started
Revision text changed to g3d4736cedda5f, savegame version 208, not modified, _openttd_newgrf_version = 0x1a006d64 
New game mode: 1 landscape: 0
---- gamelog end ----

Recent news messages:

*** End of OpenTTD Crash Report ***

Crash log generated.

Writing crash log to disk...
Crash log written to /home/nik/.openttd/crash.log. Please add this file to any bug reports. 

Writing crash savegame...
Crash savegame written to /home/nik/.openttd/crash.sav. Please add this file and the last (auto)save to any bug reports. 

Writing crash screenshot...
Crash screenshot written to /home/nik/.openttd/crash.png. Please add this file to any bug reports. 

Segmentation fault

Steps to reproduce

It's kind of tricky to reproduce, but I can reproduce this crash with following these steps, done quickly, using OpenMSX:

  • Start OpenTTD, start new game with default options
  • Open sound/music window
  • Lower music volume to half
  • Open "quit game" dialog
  • Raise music volume to full
  • Confirm the quit game dialog

crash.log
crash
crash.sav.gz

@nielsmh

This comment has been minimized.

Copy link
Contributor

@nielsmh nielsmh commented Mar 7, 2019

Maybe _midi.synth needs to be NULLed after delete here? And possibly a mutex needs to be added around some of all the global objects.

void MusicDriver_FluidSynth::Stop()
{
MxSetMusicSource(NULL);
this->StopSong();
delete_fluid_synth(_midi.synth);
delete_fluid_settings(_midi.settings);
}

@nielsmh nielsmh self-assigned this Mar 7, 2019
@nielsmh

This comment has been minimized.

Copy link
Contributor

@nielsmh nielsmh commented Mar 30, 2019

I had the same crash happen to me just now. Haven't tested yet how often it occurs.

@LordAro

This comment has been minimized.

Copy link
Member

@LordAro LordAro commented Feb 16, 2020

@nielsmh Did you make any further progress with this? Seems like it could be an easy fix...

@nielsmh

This comment has been minimized.

Copy link
Contributor

@nielsmh nielsmh commented Feb 17, 2020

Might even be fixed by the changed made in #7983, since this is most likely caused by a race condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.