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

[SOLVED] Compiling from source gives an instant crash without information in the log-file #7757

Closed
frenchiveruti opened this issue Oct 1, 2019 · 7 comments

Comments

@frenchiveruti
Copy link

frenchiveruti commented Oct 1, 2019

Version of OpenTTD

1.9.3 - Compiled from source using GCC 8.3.0 on a non-conventional UNIX.

Expected result

Actual Game Loading

Actual result

Crashes instantly without a description

Steps to reproduce

Hello, I'm using a very non-conventional OS called "EasyOS" developed by Barry Kauler from Puppy Linux, you can literally make it run in less than 20 minutes if you want to test my issue here.
I was able to run the compilation process for OTTD, I have all the required libraries and when it comes to execute openttd in a terminal, the game crashes instantly without a warning nor a reason.
Using a "./openttd -d 3" command I was able to output the console into this file:

crashlog.txt

Also, here's the output crash that the game creates in ~/.openttd/
crash.log

As you can see, there's something related to this line on the crashlog.txt:
GLib:ERROR:../../../glib/ghash.c:377:g_hash_table_lookup_node: assertion failed: (!g_atomic_ref_count_compare (&hash_table->ref_count, 0))

Is it because I'm missing something? I sure don't have any idea, but it would be nice to make it run as the game is not very demanding and it would be a great addition for the OS.
Thanks.

@LordAro
Copy link
Member

LordAro commented Oct 1, 2019

The stack trace indicates that the crash happened somewhere outside of OTTD, specifically in the sound driver (libpulse). I suspect there's nothing we can do about that, I'm afraid - it'll want reporting somewhere else.

However, as a workaround, what happens if you run without sounds? (./openttd -s null -m null)

@frenchiveruti
Copy link
Author

The stack trace indicates that the crash happened somewhere outside of OTTD, specifically in the sound driver (libpulse). I suspect there's nothing we can do about that, I'm afraid - it'll want reporting somewhere else.

However, as a workaround, what happens if you run without sounds? (./openttd -s null -m null)

I'll try that, thank you very much.

@frenchiveruti
Copy link
Author

frenchiveruti commented Oct 1, 2019

Ok, it was that.
Fine, I guess now it comes to fight against pulseaudio vs Alsa haha.

@frenchiveruti
Copy link
Author

May I ask you where did the stacktrace shows a "sound driver issue"? I'm fairly novice in debugging and I would like to know. Thanks

@frenchiveruti
Copy link
Author

Ok I found this: https://wiki.libsdl.org/FAQUsingSDL
It seems that the compilation makes pulseaudio the default one, which in the case of EasyOS and Puppy linux in general, has always given problems, is there a way to make ALSA the default audio driver?

@LordAro
Copy link
Member

LordAro commented Oct 1, 2019

From crash.log:

Stacktrace:
 [00] ./openttd(_ZNK12CrashLogUnix13LogStacktraceEPcPKc+0x62) [0x55a001592e2e]
 [01] ./openttd(_ZNK8CrashLog12FillCrashLogEPcPKc+0x16a) [0x55a0013ca96a]
 [02] ./openttd(_ZNK8CrashLog12MakeCrashLogEv+0x65) [0x55a0013caca5]
 [03] ./openttd(+0x5dcbba) [0x55a001592bba]
 [04] /lib/libc.so.6(+0x37840) [0x7f662baec840]
 [05] /lib/libc.so.6(gsignal+0x10b) [0x7f662baec7bb]
 [06] /lib/libc.so.6(abort+0x121) [0x7f662bad7535]
 [07] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x1bdc3) [0x7f662b00ddc3]
 [08] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_assertion_message_expr+0x4a) [0x7f662b06767a]
 [09] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x3bcd6) [0x7f662b02dcd6]
 [10] /usr/lib/libpulse.so.0(pa_stream_unref+0x24) [0x7f662b584244]
 [11] /usr/lib/libpulse.so.0(pa_mainloop_dispatch+0x1d3) [0x7f662b581b93]
 [12] /usr/lib/libpulse.so.0(pa_mainloop_run+0x2a) [0x7f662b5820aa]
 [13] /usr/lib/libpulse.so.0(+0xee23) [0x7f662b584e23]
 [14] /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f662e72bfa3]
 [15] /lib/libc.so.6(clone+0x3f) [0x7f662bbae4cf]

The fact that there's no OTTD code in this stacktrace (but has been caught by OTTD's crashlog code) tells me it's one of the non-main threads that's dying. libpulse.so.0 tells me that this must be occurring in the audio thread.

Since the error is happening so quickly (immediately after what's likely the pthread spawn call), this means that this isn't likely to be an OTTD issue

@LordAro LordAro closed this as completed Oct 1, 2019
@frenchiveruti
Copy link
Author

frenchiveruti commented Oct 1, 2019

Ok, so on the IRC user @nnyby and @LordAro gave me the solution.
On the command line, inside the source code folder (where ./configure is), one has to run:

export SDL_AUDIODRIVER=alsa
./configure
make

And the game will be able to run without issues on EasyOS, and probably other puppy linux based OS variants.
Thanks for the help both of you.

@frenchiveruti frenchiveruti changed the title Compiling from source gives an instant crash without information in the log-file [SOLVED] Compiling from source gives an instant crash without information in the log-file Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants