SIGSEGV on start up

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

Post Reply
Message
Author
User avatar
bhelyer
Space Floater
Posts: 41
Joined: Tue Aug 28, 2007 3:51 am

SIGSEGV on start up

#1 Post by bhelyer »

Okay, so I'm sure there's a topic with this problem somewhere, but I can't find it. Berate me as needed.

FreeOrion segfaults on start up. Somewhere in GG::OgreGUI::Enter2DMode:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb67466c0 (LWP 9476)]
0x000010d1 in ?? ()
(gdb) bt
#0  0x000010d1 in ?? ()
#1  0xb7ed864c in GG::OgreGUI::Enter2DMode () from /usr/local/lib/libGiGiOgre.so
#2  0x082df980 in HumanClientApp::Enter2DMode ()
#3  0xb7cddef3 in GG::GUI::Render () from /usr/local/lib/libGiGi.so
#4  0xb7ed732a in GG::OgreGUI::postRenderTargetUpdate () from /usr/local/lib/libGiGiOgre.so
#5  0xb76ea8c4 in Ogre::RenderTarget::firePostUpdate (this=0xb4f74608) at /home/bernard/src/ogre/OgreMain/src/OgreRenderTarget.cpp:339
#6  0xb76eb257 in Ogre::RenderTarget::updateImpl (this=0xb4f74608) at /home/bernard/src/ogre/OgreMain/src/OgreRenderTarget.cpp:121
#7  0xb76eaaac in Ogre::RenderTarget::update (this=0xb4f74608, swap=false) at /home/bernard/src/ogre/OgreMain/src/OgreRenderTarget.cpp:501
#8  0xb76d2a61 in Ogre::RenderSystem::_updateAllRenderTargets (this=0xb4f6ce18, swapBuffers=false) at /home/bernard/src/ogre/OgreMain/src/OgreRenderSystem.cpp:113
#9  0xb770dccd in Ogre::Root::_updateAllRenderTargets (this=0xb4f624b8) at /home/bernard/src/ogre/OgreMain/src/OgreRoot.cpp:1184
#10 0xb770de20 in Ogre::Root::renderOneFrame (this=0xb4f624b8) at /home/bernard/src/ogre/OgreMain/src/OgreRoot.cpp:846
#11 0xb7ed774f in GG::OgreGUI::Run () from /usr/local/lib/libGiGiOgre.so
#12 0xb7cdc201 in GG::GUI::operator() () from /usr/local/lib/libGiGi.so
#13 0x082f0a9d in main ()
Now, I didn't feel like recompiling everything with debugging information on, so I put in some old fashioned print statements between things:

Code: Select all

---------- Enter2DMode -----------
glPushAttrib glPushClientAttrib
getRenderSystem
Matrix shit
glOrtho
initialise render settings
blend stuff.
initialise texture settings
enable alpha blending
glBindBuffer
glUseProgramARB
And that's where the crash happens. So I suspect this is because I have an ATI card, as you've mentioned that on the front page.

Code: Select all

$ lspci | grep ATI
01:00.0 VGA compatible controller: ATI Technologies Inc M10 NQ [Radeon Mobility 9600]
01:00.1 Display controller: ATI Technologies Inc M10 NQ [Radeon Mobility 9600] (Secondary)
Note: It's not actually a mobility, just a plain one.

I'm running fglrx:

Code: Select all

$ fglrxinfo 
display: :0.0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI RADEON 9600 Series   
OpenGL version string: 2.1.8543 Release
More information will be forthcoming as I poke about some more.

----EDIT1-----

Both ogre.log and freeorion.log contain no useful information and indeed no sign of failure at all.


----EDIT2-----

As I suspected this is the call that kills the beast:

Code: Select all

if (glUseProgramARB)
    glUseProgramARB(0);

----EDIT3-----

Because I'm that kind of radical guy, I just commented out that call. It works, though what I've crippled I don't know (I don't even know what the function does).

In news that may or may not be related:

Code: Select all

$ ./freeorion --tech-demo
freeorion: /usr/local/stow/ogre/include/OGRE/OgreSharedPtr.h:158: T* Ogre::SharedPtr<T>::operator->() const [with T = Ogre::Material]: Assertion `pRep' failed.
Aborted

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: SIGSEGV on start up

#2 Post by OndrejR »

I know nothing about OpenGL, but found interesting howto about it:
http://www.lighthouse3d.com/opengl/glsl ... oglprogram
http://blog.vrplumber.com/index.php?/ar ... ed....html
http://www.ogre3d.org/forums/viewtopic. ... 6f4e2718c6
ogre forum wrote:And I've already been (independently) told about this on a local game programing forum here too. People said that glUseProgramARB(0) is not enough, and glBindTexture (, 0) is required to return to the fixed-function pipeline (they called that "disabling the shader" and "disabling the texture units" respectively).
Or maybe one of options glUseProgram and glUseProgramObjectARB or glXGetProcAddressARB will be useful.

Also check if your card support shader model 3 or above(maybe it is required by FreeOrion).

And also check if is your Ogre compiled with nvidia-cg-toolkit.

Or problem is that your ATI(newer ATI HD have it) has no Vertex shader, only Fragment shader(how to choose right?)

Code: Select all

		v = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
		f = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);

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

Re: SIGSEGV on start up

#3 Post by Geoff the Medio »

bhelyer wrote:As I suspected this is the call that kills the beast:

Code: Select all

if (glUseProgramARB)
    glUseProgramARB(0);

----EDIT3-----

Because I'm that kind of radical guy, I just commented out that call. It works, though what I've crippled I don't know (I don't even know what the function does).
That call, as alluded to by OndrejR, disables shader programs. Or partly disables them...?

Anyway, you say you get the program running if you comment out that line. Do you get into a game and see the galaxy map doing this? Do you have system fog of war scanline enabled in the options menu galaxy tab when doing this, and do you see the horizontal lines like in the partly cut off star in this image at the top left? (All unexplored systems should have them if they're enabled.)

The code that renders those lines is turned off after it's done by

Code: Select all

glUseProgram(0);
So you might try removing the ARB instead of commenting out the line, and seeing if it runs then...

User avatar
bhelyer
Space Floater
Posts: 41
Joined: Tue Aug 28, 2007 3:51 am

Re: SIGSEGV on start up

#4 Post by bhelyer »

Geoff the Medio wrote:
bhelyer wrote:As I suspected this is the call that kills the beast:

Code: Select all

if (glUseProgramARB)
    glUseProgramARB(0);

----EDIT3-----

Because I'm that kind of radical guy, I just commented out that call. It works, though what I've crippled I don't know (I don't even know what the function does).
That call, as alluded to by OndrejR, disables shader programs. Or partly disables them...?

Anyway, you say you get the program running if you comment out that line. Do you get into a game and see the galaxy map doing this? Do you have system fog of war scanline enabled in the options menu galaxy tab when doing this, and do you see the horizontal lines like in the partly cut off star in this image at the top left? (All unexplored systems should have them if they're enabled.)
Yes sir.
The code that renders those lines is turned off after it's done by

Code: Select all

glUseProgram(0);
So you might try removing the ARB instead of commenting out the line, and seeing if it runs then...
Trying now.

User avatar
bhelyer
Space Floater
Posts: 41
Joined: Tue Aug 28, 2007 3:51 am

Re: SIGSEGV on start up

#5 Post by bhelyer »

Just glUseProgram works in the exact same manner as commenting glUseProgramARB did.

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: SIGSEGV on start up

#6 Post by OndrejR »

Can you try this to test, if only checking cause crash?

Code: Select all

if (glUseProgramARB)
    //glUseProgramARB(0);

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

Re: SIGSEGV on start up

#7 Post by Geoff the Medio »

OndrejR wrote:Can you try this to test, if only checking cause crash?

Code: Select all

if (glUseProgramARB)
    //glUseProgramARB(0);
He already did...
bhelyer wrote:Because I'm that kind of radical guy, I just commented out that call. It works...
(Although I hope he commented out the if line as well, as otherwise it could cause strange other errors)

Post Reply