Linux crashing

chunky

12-12-2007 01:59:00

I hope you don't mind me spamming the forums with all these questions, I'm just still a little overwhelmed.

I tried getting all my code to build on linux, but ran into a problem in the skinmanager code:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1241262368 (LWP 2677)]
0xb619d660 in FreeImage_SetTagValue () from /usr/lib/libfreeimage.so.3
(gdb) bt
#0 0xb619d660 in FreeImage_SetTagValue () from /usr/lib/libfreeimage.so.3
#1 0xb6177f8e in ?? () from /usr/lib/libfreeimage.so.3
#2 0xb6164741 in FreeImage_LoadFromHandle () from /usr/lib/libfreeimage.so.3
#3 0xb616355b in FreeImage_LoadFromMemory () from /usr/lib/libfreeimage.so.3
#4 0xb79a0529 in Ogre::FreeImageCodec::decode (this=0x82663e0, input=@0xbf9fa800) at OgreFreeImageCodec.cpp:338
#5 0xb779b364 in Ogre::Image::load (this=0xbf9fa8ec, strFileName=@0x828ed6c, group=@0x823840c) at OgreImage.cpp:329
#6 0x0815b91b in QuickGUI::SkinSet::buildTexture (this=0x828dc60) at /home/chunky/src/tuxwars3/src/libs/QuickGUI/src/QuickGUISkinSet.cpp:367
#7 0x0815c663 in SkinSet (this=0x828dc60, skinName=@0xbf9faa64, t=QuickGUI::SkinSet::IMAGE_TYPE_PNG, resourceGroup=@0x82382c0) at /home/chunky/src/tuxwars3/src/libs/QuickGUI/src/QuickGUISkinSet.cpp:28
#8 0x081609b5 in QuickGUI::SkinSetManager::loadSkin (this=0x8279c60, skinName=@0xbf9faa64, t=QuickGUI::SkinSet::IMAGE_TYPE_PNG, resourceGroup=@0x82382c0)
at /home/chunky/src/tuxwars3/src/libs/QuickGUI/src/QuickGUISkinSetManager.cpp:73
#9 0x0805b776 in TWGUI (this=0x827a530, scnmgr=0x8297300, vp=0x82a46c0) at /home/chunky/src/tuxwars3/src/gui/maingui.cpp:10
#10 0x080559db in TWMain (this=0x825fe58, argc=1, argv=0xbf9fabe4) at /home/chunky/src/tuxwars3/src/game/maingame.cpp:111
#11 0x08054d61 in main (argc=1, argv=0xbf9fabe4) at /home/chunky/src/tuxwars3/src/game/main.cpp:5
(gdb)


The line of my code that causes this is:
QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui",QuickGUI::SkinSet::IMAGE_TYPE_PNG);

I tried appending a resource group parameter ("General", in this case), but it didn't change anything. This is the exact code that works on OSX just fine. I don't have a windows build box right now to compare with, sadly.

Any suggestions as to what I should look for?

Thank-you very much (again!)
Gary (-;

kungfoomasta

12-12-2007 02:35:25

The only use of Ogre::Image::load I see in the buildTexture function is in the following lines of code:


Ogre::Image tempImg;
Ogre::LogManager::getSingletonPtr()->logMessage("Quickgui : Adding " + (*texNameItr) + "to skin" + mSkinName);

tempImg.load((*texNameItr),Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);


The log should print out the image name it tried to load before it loads it. What image is it trying to load?

chunky

12-12-2007 19:43:52

This is the last line of the log:

11:43:37: Quickgui : Adding qgui.checkbox.checked.down.pngto skinqgui

But that file is there, and loads fine in any other image editor.

Gary (-;

kungfoomasta

12-12-2007 19:57:10

Maybe its somehow not listed in a defined Ogre resource path? I have seen a few instances where Ogre hasn't thrown an error like it usually does. (for example, if it really couldn't find it, you'd expect some exception from ogre saying the image was not found)

Reviewing the call stack, it doesn't look like its a QuickGUI issue. (but I could easily be wrong :wink: )

One thing to try is making your own material which uses the "qgui.checkbox.checked.down.png" image, and trying to apply that material to some 3d object in your scene, a ninja for example. Otherwise we'd need to see the code surrounding the problem, in the function FreeImage_SetTagValue..

sig9

15-01-2008 20:45:04

I just built my program for linux (was running on win), and I ran into the same problem. I was getting strange segfaults, so I ran the program under gdb, which tells me that its crashing in the exact same place as mentioned: FreeImage_SetTagValue() . I assume this is a QuickGUI problem, because the only code I changed from previous build (which still runs fine on linux) is adding QuickGUI . Any ideas how to fix? (I'm gonna try to rebuild ogre with Devil on linux, too to see if that changes anything)

sig9

15-01-2008 20:59:44

Under further investigation, theres a known conflict with FreeImage and libpng ; if you compile ogre with freeimage and have libpng on your system it could possibly crash in random places. The fix for this seems to be to just disable freeimage when you build ogre, or get rid of libpng

kungfoomasta

15-01-2008 21:05:24

Thanks for posting, hopefully it helps other linux users! :)

chunky

18-01-2008 23:07:36

Huh, that's interesting...

How do you load images, then? According to the configure script:
--disable-freeimage Don't use FreeImage for image loading. This is not
recommended unless you provide your own image
loading codecs.


Thank-you very much,
Gary (-;

sig9

19-01-2008 08:56:24

Huh, that's interesting...

How do you load images, then? According to the configure script:
--disable-freeimage Don't use FreeImage for image loading. This is not
recommended unless you provide your own image
loading codecs.


Thank-you very much,
Gary (-;


You have to enable devil when you disable free image.

When you compile ogre, do:

./configure --disable-freeimage --enable-devil

Btw, I did get the problem fixed by doing this. If you still have problems after this, make sure you compile devil with support for pngs and jpegs.

chunky

23-01-2008 00:30:16

Aye, I found that shortly after posting.

Thank-you so much, my problems have been fixed now!

Gary (-;