Bug 5252 - Segmentation fault on startup (32-bit Linux)
Status: ASSIGNED
Alias: None
Product: Frozen Synapse
Classification: Unclassified
Component: everything
Version: unspecified
Hardware: PC Linux
: P1 critical
Assignee: Ryan C. Gordon
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2011-09-28 22:23 EDT by Dan
Modified: 2011-10-11 07:52:02 EDT
10 users (show)

See Also:



Description Dan 2011-09-28 22:23:27 EDT
I get a segmentation fault with no other output when I attempt to run Frozen Synapse on 32-bit linux (Ubuntu 10.04) and the -console argument doesn't produce any additional output:

enki@abzu:~/frozensynapse$ ./FrozenSynapse -console
Segmentation fault


Re-naming the stdlibc++ library (to get it out of the way) doesn't help. Here is the tail end of the contents of console2.log which seem interesting:

Turn start time: 0.000000
deselectPendReselect called before reselect called
Encounter successfully saved to psychoff/aiturn.enc
Made myself low priority. Sob.
AI Process online: PING
AI Process Disconnected!
Set::getObject index out of range.
Exporting Particle Editor preferences.
Exporting Level Editor preferences.
tools/editorClasses/scripts/RSSNews/RSSFeedScript.ed.cs (0): Unable to find object: 'RSSFeedObject' attempting to call function 'delete'
destroyprojectWizard: Unknown command.
Exporting Animation Builder preferences.
Exporting Image Editor preferences.
Exporting Gui preferences.
MusicManager::stop
Exporting IRC prefs
Psychoff/main.cs (517): Unable to find function stopDB
MusicManager::stop
Psychoff/gameScripts/music.cs (77): Unable to find object: '' attempting to call function 'delete'
Psychoff/gameScripts/music.cs (78): Unable to find object: '' attempting to call function 'delete'
Error, cannot unlink namespace parent linkage for ChannelListStack for GuiStackControl.
Error, cannot unlink namespace parent linkage for TimeSlider for GuiSliderCtrl.
Comment 1 D Mogle 2011-09-28 23:22:22 EDT
I can confirm - I'm also getting a segmentation fault and those two errors at the end of console2.log.  I'm also running 32-bit Ubuntu 10.04.
Comment 2 Col R 2011-09-29 16:35:56 EDT
Ditto. 32-bit CrunchBang Linux (basically Debian Lenny). Same results.
Comment 3 marukan_falco 2011-09-30 11:49:21 EDT
The same here. (Debian squeeze)
I find errors duing LD_DEBUG=libs, maybe this can help.     


      6715:	calling init: /usr/lib/libXext.so.6
      6715:	
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XMissingExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XMissingExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XextAddDisplay (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XextAddDisplay (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XextCreateExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XextCreateExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XextDestroyExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XextDestroyExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XextFindDisplay (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XextFindDisplay (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XextRemoveDisplay (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XextRemoveDisplay (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XSetExtensionErrorHandler (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XSetExtensionErrorHandler (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XShmAttach (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XShmAttach (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XShmDetach (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XShmDetach (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XShmPutImage (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XShmPutImage (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XShmCreateImage (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XShmCreateImage (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: XShmQueryExtension (fatal)
      6715:	/usr/lib/libX11.so.6: error: symbol lookup error: undefined symbol: _XShmQueryExtension (fatal)
Comment 4 Dan 2011-09-30 15:12:31 EDT
(In reply to comment #3)
> The same here. (Debian squeeze)
> I find errors duing LD_DEBUG=libs, maybe this can help.     
> 
> 
>       6715:    calling init: /usr/lib/libXext.so.6
>       6715:    
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XMissingExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XMissingExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XextAddDisplay (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XextAddDisplay (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XextCreateExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XextCreateExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XextDestroyExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XextDestroyExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XextFindDisplay (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XextFindDisplay (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XextRemoveDisplay (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XextRemoveDisplay (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XSetExtensionErrorHandler (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XSetExtensionErrorHandler (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XShmAttach (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XShmAttach (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XShmDetach (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XShmDetach (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XShmPutImage (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XShmPutImage (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XShmCreateImage (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XShmCreateImage (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: XShmQueryExtension (fatal)
>       6715:    /usr/lib/libX11.so.6: error: symbol lookup error: undefined
> symbol: _XShmQueryExtension (fatal)


Ah, I wasn't aware of this utility. LD_DEBUG=libs ./FrozenSynapse gives me the same errors as you got. This seems like some sort of linking problem. These symbols exist in libXext but they are being looked for in libX11 (grepping /usr/lib/libX11.so.6 for them gives nothing). For example:

enki@abzu:~/frozensynapse$ objdump -T /usr/lib/libXext.so.6 | grep "XShm"
00007f20 g    DF .text	00000021  Base        XShmQueryExtension
00007b40 g    DF .text	00000116  Base        XShmCreatePixmap
00007ef0 g    DF .text	0000002c  Base        XShmGetEventBase
00008260 g    DF .text	0000013c  Base        XShmQueryVersion
00008570 g    DF .text	00000186  Base        XShmPutImage
00007d10 g    DF .text	000000d6  Base        XShmDetach
000083a0 g    DF .text	000001ca  Base        XShmGetImage
00007df0 g    DF .text	000000f4  Base        XShmAttach
00008700 g    DF .text	0000011c  Base        XShmCreateImage
00008120 g    DF .text	0000013c  Base        XShmPixmapFormat
Comment 5 Dan 2011-09-30 19:04:34 EDT
OK, I'm changing the status on this one to "works for me". I upgraded my OS to the next release (10.10) and the game runs (everyone in this thread seems to use a Debian flavor; update?). libX11 and libXext still have their same version numbers as before (libX116.3.0 and libXext6.4.0), so it is unclear to me what the ultimate issue was. However, it appears to be a user-end problem. Perhaps someone has more of a clue.
Comment 6 Col R 2011-09-30 19:30:25 EDT
Glad to hear someone has a solution: any ideas what, exactly, the problem was?
Comment 7 Col R 2011-09-30 19:31:40 EDT
(In reply to comment #6)
> Glad to hear someone has a solution: any ideas what, exactly, the problem was?

Also, do you mind if we leave this open until a solution applicable to all distros is found?
Comment 8 Col R 2011-10-01 12:22:58 EDT
Welp, updated repo from Squeeze to Wheezy and it works fine now.
Comment 9 wererogue 2011-10-02 17:49:34 EDT
I have the same error - I don't think it's fair to resolve this until it's working on the LTS versions, at least, especially since it's a complete showstopper.

I'm on Mint 9 Isodora, and I have the same dynamic linking issue.
Comment 10 sucotronic 2011-10-04 11:43:47 EDT
Just bought the Frozen Synapse Bundle and it doesn't work in ubuntu 10.04. Running with gdb gives following output:

gdb FrozenSynapse 
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/USB_500GB_EXT3/frozensynapse/FrozenSynapse...(no debugging symbols found)...done.
(gdb) run
Starting program: /media/USB_500GB_EXT3/frozensynapse/FrozenSynapse 
[Thread debugging using libthread_db enabled]
[New Thread 0x145ab70 (LWP 4918)]
[New Thread 0x2025b70 (LWP 4919)]

Program received signal SIGSEGV, Segmentation fault.
0x01820256 in glGenLists () from /usr/lib/mesa/libGL.so.1
Comment 11 Ryan C. Gordon 2011-10-04 14:52:30 EDT
> 0x01820256 in glGenLists () from /usr/lib/mesa/libGL.so.1

Can you confirm this is the right libGL?

My current belief is that most of these problems aren't distro or distro version problems, but rather just the wrong OpenGL drivers installed.

Way too many 64-bit Linux installs have correct 64-bit GL drivers, and have the completely wrong 32-bit libGL.so.1 ... the obvious and correct solution is to get a 64-bit build of Frozen Synapse, but this is proving to be difficult so far.

In the meantime, this would be the best investigative work you can do on your own system: make sure you have the correct 32-bit libGL.

"glxinfo reports the correct info" isn't a valid test if you're on a 64-bit system, as it'll use a totally different libGL, and "this other game works" might not be either on any machine.

A newer distro working when your current one doesn't is almost certainly an accidental solution. That's great if that works for you, but I think we should be able to get this working on any reasonable installation.

--ryan.
Comment 12 Col R 2011-10-04 15:19:31 EDT
(In reply to comment #11)
> A newer distro working when your current one doesn't is almost certainly an
> accidental solution. That's great if that works for you, but I think we should
> be able to get this working on any reasonable installation.

Agreed. I just thought that knowing that in a 32-bit Debian derivative, updating the repositories from Squeeze to Wheezy made the problem go away.
Comment 13 wererogue 2011-10-04 17:42:16 EDT
(In reply to comment #11)
> > 0x01820256 in glGenLists () from /usr/lib/mesa/libGL.so.1

I'm not sure how to check if I have the right libgl.so.1 (iirc I'm still using the same libgl from my distro's package manager), but I am running a 32-bit os on a 32-bit system (intel atom, i686)
Comment 14 Kit Scuzz 2011-10-05 01:27:16 EDT
Ryan: I actually have a straight 32-bit system and I'm suffering from this bug.  I don't know how to check if I have the "right" libGL.so but I have trouble imagining it's incorrect because I have no problem running all other manner of openGL software (my own code included).

You can get a dump of a lot of pertinent information about my computer from the forum thread I opened up (I am kickmyassman): http://forums.mode7games.com/viewtopic.php?f=21&t=3651

I'm definitely willing to help debug as best I can, but I need a bit more help in what information you need.

I appear to have libGL 1.2
------------------------------------------------------------------------------
kickmyassman@kacertop:~/frozensynapse$ ls -l /usr/lib/libGL.so 
lrwxrwxrwx 1 root root 13 2010-05-23 14:17 /usr/lib/libGL.so -> mesa/libGL.so
kickmyassman@kacertop:~/frozensynapse$ ls -l /usr/lib/mesa/libGL.so
lrwxrwxrwx 1 root root 10 2010-05-23 14:17 /usr/lib/mesa/libGL.so -> libGL.so.1
kickmyassman@kacertop:~/frozensynapse$ ls -l /usr/lib/mesa/libGL.so.1
lrwxrwxrwx 1 root root 12 2010-05-23 14:17 /usr/lib/mesa/libGL.so.1 -> libGL.so.1.2
kickmyassman@kacertop:~/frozensynapse$ ls -l /usr/lib/mesa/libGL.so.1.2 
-rw-r--r-- 1 root root 403812 2010-04-29 01:43 /usr/lib/mesa/libGL.so.1.2
------------------------------------------------------------------------------
And from apt, version 7.7.1-1ubuntu3 (same for libgl1-mesa-dri)
------------------------------------------------------------------------------
kickmyassman@kacertop:~/frozensynapse$ dpkg -s libgl1-mesa-glx
Package: libgl1-mesa-glx
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 512
Maintainer: Ubuntu X-SWAT <ubuntu-x@lists.ubuntu.com>
Architecture: i386
Source: mesa
Version: 7.7.1-1ubuntu3
[...cut off for brevity...]
Comment 15 zidagar 2011-10-06 15:50:25 EDT
On Debian Sid amd64 I've installed libgl1-nvidia-glx-ia32 and now the game start
Comment 16 alexey.veselovsky 2011-10-07 16:38:47 EDT
Debian squeeze 32 bit. Crash on starup.

Program received signal SIGSEGV, Segmentation fault.
0xb69d5936 in glGenLists () from /usr/lib/libGL.so.1
(gdb) bt
#0  0xb69d5936 in glGenLists () from /usr/lib/libGL.so.1
#1  0x08290166 in Terrain::Terrain() ()
#2  0x081ebea9 in Encounter::Encounter() ()
#3  0x08281fc3 in PsychoffManager::PsychoffManager() ()
#4  0x0828683d in ConcreteClassRep<PsychoffManager>::create() const ()
#5  0x0819ab00 in SimChunk::initChunkMappings() ()
#6  0x082190ab in initGame(int, char const**) ()
#7  0x082192f0 in DemoGame::main(int, char const**) ()
#8  0x083558e7 in main ()
Comment 17 Kit Scuzz 2011-10-11 01:13:47 EDT
So there appears to be a solution posted in the forums of using a backported version of libgl1-mesa-glx (version 7.10 instead of the current version 7.7 in the 10.04 and Squeeze repositories)

It seems like this must be some issue which can't be resolved by Frozen Synapse if it's a library bug.  At least, not without a hack to fix the problem before the library is loaded.

Unfortunately I can't do a ppa upgrade on my main machine (it breaks too much stuff for my graphics development work), but I can confirm that on a 32-bit Debian machine going from 7.7 to 7.10 (using Debian backports) fixed my issue.

Solution from: http://forums.mode7games.com/viewtopic.php?f=21&t=3706
Comment 18 sucotronic 2011-10-11 03:25:43 EDT
Tested the workaround in Ubuntu 10.04 and it works. Here is the steps:

wget http://backports.debian.org/debian-backports/pool/main/m/mesa/libgl1-mesa-glx_7.10.3-4~bpo60+1_i386.deb
sudo dpkg -i sudo dpkg -i libgl1-mesa-glx_7.10.3-4~bpo60+1_i386.deb

Now I can play Frozen Synapse :D
Comment 19 Pascal 2011-10-11 07:21:44 EDT
On Ubuntu 10.10 beta2 x86_64 with an Intel graphics chip, I could get it running by installing "libgl1-mesa-glx:i386". The libGL.so.1 installed by the ia32-libs package seemed not to work.
Comment 20 wererogue 2011-10-11 07:52:02 EDT
The workaround works for me, although there's a couple of typos in there - it should read:

wget http://backports.debian.org/debian-backports/pool/main/m/mesa/libgl1-mesa-glx_7.10.3-4~bpo60+1_i386.deb
sudo dpkg -i libgl1-mesa-glx_7.10.3-4~bpo60+1_i386.deb

It's probably worth checking whether the game can link against whatever the main 10.04 mesa version is, but this is a simple user fix for now.