Crash on game startup

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Crash on game startup

Post by GeekToo »

Hi, can someone a hint what is causing this:

Code: Select all

./openttd 
Crash encountered, generating crash log...
*** OpenTTD Crash Report ***

Crash at: Sun Aug 19 21:04:42 2012
In game date: 0-01-01 (0)

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

OpenTTD version:
 Version:    r24484 (0)
 NewGRF ver: 13005fa4
 Bits:       32
 Endian:     little
 Dedicated:  no
 Build date: Aug 19 2012 23:01:55

Stacktrace:
 [00] ./openttd(_ZNK12CrashLogUnix13LogStacktraceEPcPKc+0x43) [0x8313633]
 [01] ./openttd(_ZNK8CrashLog12FillCrashLogEPcPKc+0x102) [0x81d3332]
 [02] ./openttd(_ZNK8CrashLog12MakeCrashLogEv+0xa0) [0x81d3600]
 [03] ./openttd() [0x831356c]
 [04] linux-gate.so.1(__kernel_sigreturn+0) [0xffffe400]
 [05] ./openttd(_Z21GetCustomSignalSpritePK12RailtypeInfoj10SignalType13SignalVariant11SignalStateb+0xc8) [0x82e88e8]
 [06] ./openttd(_Z25ResolveRailTypeGUISpritesP12RailtypeInfo+0x134) [0x834b214]
 [07] ./openttd(_Z13InitRailTypesv+0x1e) [0x834b29e]
 [08] ./openttd(_Z10LoadNewGRFjj+0x1226) [0x82cc146]
 [09] ./openttd(_Z14GfxLoadSpritesv+0x274) [0x822e174]
 [10] ./openttd(_Z13GenerateWorld12GenWorldModejjb+0xab) [0x82200ab]
 [11] ./openttd(_Z8ttd_mainiPPc+0x149c) [0x82ff09c]
 [12] ./openttd(main+0x48) [0x8313a68]
 [13] /lib/libc.so.6(__libc_start_main+0xe6) [0xb5f905e6]
 [14] ./openttd() [0x81193d1]

Operating system:
 Name:     Linux
 Release:  2.6.38-gentoo-r6
 Version:  #3 Sun Oct 30 13:19:24 CET 2011
 Machine:  i686
 Compiler: GCC 4.5.3 "4.5.3"

Configuration:
 Blitter:      8bpp-optimized

I svn upped, and rebuild and got this. On every blitter. Rebuild the extra grf. Updated grfcodec and nfo renum. Svnned down like 80 revisions. Removed openttd.cfg completely. Renamed ~/.openttd

Nothing seemed to help. I see the game starting up, the window is shown, and then it crashes immediately.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Crash on game startup

Post by planetmaker »

Somewhat random guess into the dark: Do you have any fancy NewGRF configuration? If so, try without.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Crash on game startup

Post by frosch »

This is an optimiser bug in gcc version 4.5 ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680 ), which I boldly assume you use. (edit: well, the crashlog even says so :) )

To fix it, either disable optmisations, or extent the SignalVariant enum in signal_type.h with a dummy value at the end.

Edit: Though I can actually not recommend you to work around that GCC bug. Esp. don't run a server with it. It might cause all kinds of critical problems, like arbitrary code injection.
Last edited by frosch on 20 Aug 2012 16:10, edited 1 time in total.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Crash on game startup

Post by GeekToo »

Frosch, you're the best:

Code: Select all

enum SignalVariant {
	SIG_ELECTRIC  = 0, ///< Light signal
	SIG_SEMAPHORE = 1, ///< Old-fashioned semaphore signal
	SIG_DUM       = 2, ///< workaround gcc 4.5.3 bug  
};
works like a charm! Back in business again, never would have guessed this one.

---
Edit: I saw your edit later.

I don't use this install as server. I also don't like switching off the optimize flags. And Gentoo does not consider newer versions of gcc stable: http://packages.gentoo.org/package/sys-devel/gcc
And since on Gentoo *everything* on the system is compiled by gcc, as you may know, I like to stick to a stable version of at least gcc.
So I leave it this way for now, thanks again.
Devkekl6321
Engineer
Engineer
Posts: 1
Joined: 14 Mar 2019 20:21

Re: Crash on game startup

Post by Devkekl6321 »

GeekToo wrote:Frosch, you're the best:

Code: Select all

enum SignalVariant {
	SIG_ELECTRIC  = 0, ///< Light signal
	SIG_SEMAPHORE = 1, ///< Old-fashioned semaphore signal
	SIG_DUM       = 2, ///< workaround gcc 4.5.3 bug  
};
works like a charm! Back in business again, never would have guessed this one.

---
Edit: I saw your edit later.

I don't use this install as server. I also don't like switching off the optimize flags. And Gentoo does not consider newer versions of gcc stable: http://packages.gentoo.org/package/sys-devel/gcc
And since on Gentoo *everything* on the system is compiled by gcc, as you may know, I like to stick to a stable version of at least gcc.
So I leave it this way for now, thanks again.
where do you put this code i think i have the same problem
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Crash on game startup

Post by Eddi »

unless you're using 7 year outdated compilers, i doubt this.

what problem do you have and what makes you think you have "the same problem"?
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 5 guests