[LINUX] Segmentation Fault

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Message
Author
freereign
Space Squid
Posts: 53
Joined: Wed Mar 19, 2008 4:40 pm

[LINUX] Segmentation Fault

#1 Post by freereign »

Hello, I finally got freeorion to compile on Ubuntu, but now I have segfaults. Here is the output of (gdb) bt:

Code: Select all

#0  0xb740f8ac in memcpy () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7cb1438 in ?? () from /usr/lib/libGL.so.1
#2  0xb66154d4 in ?? ()
#3  0x00000000 in ?? ()
and here is the output from ldd freeorion:

Code: Select all

	linux-gate.so.1 =>  (0xffffe000)
	libpython2.5.so.1.0 => /usr/lib/libpython2.5.so.1.0 (0xb7dc6000)
	libboost_serialization-gcc42-1_34_1.so.1.34.1 => /usr/lib/libboost_serialization-gcc42-1_34_1.so.1.34.1 (0xb7d69000)
	libboost_iostreams-gcc42-1_34_1.so.1.34.1 => /usr/lib/libboost_iostreams-gcc42-1_34_1.so.1.34.1 (0xb7d5e000)
	libboost_python-gcc42-1_34_1.so.1.34.1 => /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1 (0xb7d1c000)
	libboost_signals-gcc42-1_34_1.so.1.34.1 => /usr/lib/libboost_signals-gcc42-1_34_1.so.1.34.1 (0xb7d0a000)
	libboost_filesystem-gcc42-1_34_1.so.1.34.1 => /usr/lib/libboost_filesystem-gcc42-1_34_1.so.1.34.1 (0xb7cfe000)
	libboost_thread-gcc42-mt-1_34_1.so.1.34.1 => /usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1 (0xb7cf1000)
	libGL.so.1 => /usr/lib/libGL.so.1 (0xb7c8e000)
	libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb7c0b000)
	libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0xb7b7c000)
	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7b64000)
	libz.so.1 => /usr/lib/libz.so.1 (0xb7b4f000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7adf000)
	libIL.so.1 => /usr/lib/libIL.so.1 (0xb79c5000)
	libILU.so.1 => /usr/lib/libILU.so.1 (0xb79ab000)
	libILUT.so.1 => /usr/lib/libILUT.so.1 (0xb79a6000)
	libalut.so.0 => /usr/lib/libalut.so.0 (0xb799f000)
	libopenal.so.0 => /usr/lib/libopenal.so.0 (0xb7964000)
	libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0xb795c000)
	libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb7933000)
	libogg.so.0 => /usr/lib/libogg.so.0 (0xb792e000)
	libgvc.so.4 => /usr/lib/libgvc.so.4 (0xb78c8000)
	libgraph.so.4 => /usr/lib/libgraph.so.4 (0xb78bd000)
	libcdt.so.4 => /usr/lib/libcdt.so.4 (0xb78b8000)
	liblog4cpp.so.5 => /usr/lib/liblog4cpp.so.5 (0xb7878000)
	libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb785f000)
	libGiGi.so => /usr/local/lib/libGiGi.so (0xb7626000)
	libGiGiSDL.so => /usr/local/lib/libGiGiSDL.so (0xb761e000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb752b000)
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7506000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb74fb000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb73ab000)
	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb73a7000)
	libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb73a3000)
	libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb7393000)
	librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb738a000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0xb72a2000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0xb7294000)
	libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb728f000)
	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb728c000)
	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb7287000)
	libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb727d000)
	libasound.so.2 => /usr/lib/libasound.so.2 (0xb71b9000)
	libdirectfb-1.0.so.0 => /usr/lib/libdirectfb-1.0.so.0 (0xb7156000)
	libfusion-1.0.so.0 => /usr/lib/libfusion-1.0.so.0 (0xb714e000)
	libdirect-1.0.so.0 => /usr/lib/libdirect-1.0.so.0 (0xb713b000)
	/lib/ld-linux.so.2 (0xb7f11000)
	libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7118000)
	libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb70f7000)
	libtiff.so.4 => /usr/lib/libtiff.so.4 (0xb70a3000)
	libmng.so.1 => /usr/lib/libmng.so.1 (0xb7035000)
	libpathplan.so.4 => /usr/lib/libpathplan.so.4 (0xb702d000)
	libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb700c000)
	libltdl.so.3 => /usr/lib/libltdl.so.3 (0xb7004000)
	libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb7002000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6fea000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0xb6fe7000)
	liblcms.so.1 => /usr/lib/liblcms.so.1 (0xb6fb5000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6fb0000)
Does anyone know how I can fix this?
MoO: Darloks Rule!
MoO2: Custom Darloks Rule!
MoO3: Dunno cuz I'm a cheapskate

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: convincing GiGi to build with other gcc

#2 Post by kroddn »

I think this has nothing to do with the topic you postet into? Maybe this can be move to a better position.

If this error is reproducable, would you build FO with debugging-symbols? And maybe you could try this

Code: Select all

strace -o /tmp/freeorion.strace ./freeorion
If possible, upload the file /tmp/freeorion.strace somewhere.


Do you have any special graphics-driver installed, as the error comes from /usr/lib/libGL.so.1 (dpkg -S /usr/lib/libGL.so.1)?

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: convincing GiGi to build with other gcc

#3 Post by kroddn »

I have to revoke my previous statements. Since the latest svn-commits I encounter the same problem, which i cannot traceback.

Code: Select all

#0  0xb723883f in memcpy () from /lib/libc.so.6
#1  0xb78171d7 in ?? () from /usr/lib/libGL.so.1
#2  0xb624fcec in ?? ()
#3  0x00000000 in ?? ()
If reproduceably occurs if you start a new game at the point after the AI has done its moves, when the UI should apper.

Revision 2400 did work.

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Segmentation Fault

#4 Post by kroddn »


freereign
Space Squid
Posts: 53
Joined: Wed Mar 19, 2008 4:40 pm

Re: Segmentation Fault

#5 Post by freereign »

What do you mean it has nothing to do with the topic posted under? I get a segmentation fault. Or did you mean it has nothing to do with Programming? Yeah, i ment to put it in the Compile section, but somewhere I got that messed up.

I looked at the bug report. It matches what happens to me perfectly. When the AI finishes it's turn, then I get a segfault.

I have no special graphics drivers. I have an ATI Radeon 340M (about 5 yrs old) that I have modified in the BIOS to have 128MB of memory.

WAIT! When I ran the command you gave, freeorion gave me no segfault! Now it runs fine! I compiled log4cpp from source yesterday, if that may have helped, which I doubt. This is wierd....
MoO: Darloks Rule!
MoO2: Custom Darloks Rule!
MoO3: Dunno cuz I'm a cheapskate

freereign
Space Squid
Posts: 53
Joined: Wed Mar 19, 2008 4:40 pm

Re: Segmentation Fault

#6 Post by freereign »

Dang it!!! I ran svn update because my code was two weeks old, and then recompiled. Now it segfaults on start! It is a problem with liblog4cpp according to this:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6fbe6c0 (LWP 17894)]
0xb78ab6c2 in log4cpp::TimeStampComponent::append ()
   from /usr/local/lib/liblog4cpp.so.4
(gdb) bt
#0  0xb78ab6c2 in log4cpp::TimeStampComponent::append ()
   from /usr/local/lib/liblog4cpp.so.4
#1  0xb78aa182 in log4cpp::PatternLayout::format ()
   from /usr/local/lib/liblog4cpp.so.4
#2  0xb78a2c7d in log4cpp::FileAppender::_append ()
   from /usr/local/lib/liblog4cpp.so.4
#3  0xb789bc35 in log4cpp::AppenderSkeleton::doAppend ()
   from /usr/local/lib/liblog4cpp.so.4
#4  0xb78ac872 in log4cpp::Category::callAppenders ()
   from /usr/local/lib/liblog4cpp.so.4
#5  0x0826a14d in HumanClientApp::HumanClientApp ()
#6  0x08276037 in HumanClientAppSoundOpenAL::HumanClientAppSoundOpenAL ()
#7  0x08279adb in main ()
I compiled log4cpp on my computer with the same compiler I used for freeorion. I have attached the strace output. Meanwhile I may have copies of the old ones I can play around with.

BTW, this segfault occurs in both the libs I compiled and the ones from the repos.
Attachments
freeorion.strace.zip
strace output after latest svn recompile
(4.07 KiB) Downloaded 153 times
MoO: Darloks Rule!
MoO2: Custom Darloks Rule!
MoO3: Dunno cuz I'm a cheapskate

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Segmentation Fault

#7 Post by kroddn »

Sorry if my postings weren't clear.

Try doing a "scons --clean" in freeorion-source and GG subdir before you change libs.

I could reproduce the segfault you mentioned and opened a bugreport about it. The problem is related to an openGL call, which may be not supportet by some graphiccards.

I have log4cpp from debian etch, had no need for compiling/installing it manually.

Code: Select all

dpkg -l *log4cpp*
liblog4cpp4-de 0.3.5-rc3-1 

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Segmentation Fault

#8 Post by loonycyborg »

freereign wrote:ATI Radeon 340M
Of course ATI drivers are known to suck, but someone with an ATI card was able to run Silvertree (which uses glDrawElements) without crashes...
In Soviet Russia, forum posts YOU!!

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Segmentation Fault

#9 Post by tzlaine »

The OpenGL requirements for running FreeOrion are now version >= 1.5. Previously, they were version >= 1.1. This is only going to go up. Soon(tm), the requirement will be version >= 2.0.

P.S. glDrawElements() is not the problem, it's glGenBuffers(), glBufferData(), etc.

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Segmentation Fault

#10 Post by loonycyborg »

Silvertree uses vertex buffer objects if it detects GL version >= 1.5 with GLEW. Otherwise it uses vertex arrays only.
In Soviet Russia, forum posts YOU!!

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Segmentation Fault

#11 Post by kroddn »

tzlaine wrote:The OpenGL requirements for running FreeOrion are now version >= 1.5. Previously, they were version >= 1.1. This is only going to go up. Soon(tm), the requirement will be version >= 2.0.

P.S. glDrawElements() is not the problem, it's glGenBuffers(), glBufferData(), etc.
I am not glad about that. That means 3 of 4 linux-system at my home won't be able to run FO any longer. Are you sure it is necessary to use GL > 2.0? What for?

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Segmentation Fault

#12 Post by loonycyborg »

kroddn wrote:Are you sure it is necessary to use GL > 2.0? What for?
GL 2.0 is required for shaders.
In Soviet Russia, forum posts YOU!!

freereign
Space Squid
Posts: 53
Joined: Wed Mar 19, 2008 4:40 pm

Re: Segmentation Fault

#13 Post by freereign »

Dang it!!!! This means that once the shaders are implemented I will have to wait 4-5 months before I can run it again! (still working on my gaming rig)

Would it be possible to add a command line option (--no-shaders) to disable shader support? If not I will attempt to continue resource management AI development using an older version.
MoO: Darloks Rule!
MoO2: Custom Darloks Rule!
MoO3: Dunno cuz I'm a cheapskate

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Segmentation Fault

#14 Post by Geoff the Medio »

freereign wrote:Dang it!!!! This means that once the shaders are implemented I will have to wait 4-5 months before I can run it again! (still working on my gaming rig)

Would it be possible to add a command line option (--no-shaders) to disable shader support? If not I will attempt to continue resource management AI development using an older version.
You might have your new rig by the time "Soon(tm)" arrives; development proceeds at the speed we can go with limited volunteer contributions. If it gets here faster than you get upgraded, my guess / inkling / impression is that shaders will be used primarily in the combat system, so it may be relatively easy to avoid / work around the steeper requirements, particularly if you're interested in development and not just playing the game.

Long term, GL 2.0 will be required. Fall-back implementations can be created that don't use earlier features, but this is significant extra work that we don't really have or want to expend the coder time on.

Additionally,
tzlaine wrote:By the time people are actually able to play FreeOrion in any real sense, they will have had lots of time to [upgrade].

freereign
Space Squid
Posts: 53
Joined: Wed Mar 19, 2008 4:40 pm

Re: Segmentation Fault

#15 Post by freereign »

Alright. If it would take to much effort, forget it. Maybe I will eventually (after v1.0) work on a modification of it that lightens the OpenGL requirements. Maybe

Right now though, I should be able to test AI out using an older version, correct?
MoO: Darloks Rule!
MoO2: Custom Darloks Rule!
MoO3: Dunno cuz I'm a cheapskate

Post Reply