Segfault within ATI fglrx driver

Bug #299811 reported by Kai Blin
4
Affects Status Importance Assigned to Milestone
Ember
Fix Released
High
Erik Ogenvik

Bug Description

When joining a game, ember starts to load the map, it's possible to see some trees, stones and the sky, the terrain is still a gray plane. Then, ember closes with below message:

kai@blackjack:~/wf/git/ember$ ember
According to my calculations Ember should be installed in /usr/local/bin/..
Starting Ember....
Starting Ember version 0.5.5
Initializing Ember services
Setting home directory to /home/kai/.ember
(0) : fatal error C9999: *** exception during compilation ***
Cg compiler terminated due to fatal error

Revision history for this message
Kai Blin (kai.blin) wrote :
Revision history for this message
Kai Blin (kai.blin) wrote : Re: Ember crashes when joining game

It seems like the Cg error is unrelated. It's always displayed when exiting ember, even if I leave before joining a game.

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Yes, the Cg error is completely unrelated. It's because Cg 2.0 will for some idiotic reason reroute the signal handlers. Cg 2.1 fixes that.

I can't see any cause in the log file, so I need a bt.

Revision history for this message
Kai Blin (kai.blin) wrote :

Ok, seems to be the bug we saw on the mentor summit again, attaching backtrace.

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Ok, this is either a bug in the ATI drivers, or it's getting fed incorrect data from Ogre (which in turn might get incorrect data from Ember).
In the bt, could you inspect frame 7 and make sure that the "rend" variable isn't bogus?
Could you also inspect frame 6 and check that any of the variables being sent in the call to glDrawElements aren't bogus either (or the "op")?
Also, could you see what kind of object rend is (i.e. the actual subclass of Renderable)?

Revision history for this message
Alexey Torkhov (atorkhov) wrote :

This backtrace is almost the same as in bug on Intel cards: https://bugs.launchpad.net/ember/+bug/298504
May be, disabling CgPluginManager that was suggested there is worth trying too?

Revision history for this message
Kai Blin (kai.blin) wrote :

How do I disable that thing?

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

In your ember.conf file, add these two lines (unless you already have an "ogre" section, then add just the second line to that):
[ogre]
plugins="RenderSystem_GL,Plugin_ParticleFX"

I'm however more interested in getting some better data on the crash bt since it looks like this is something Ember causes (as it's appearing on both ati and intel cards).

Revision history for this message
Kai Blin (kai.blin) wrote :

Adding that line to my ember.conf doesn't seem to help.

Frame #6 of the backtrace of the current crash:
#6 0xb5abfc27 in Ogre::GLRenderSystem::_render (this=0x86f99d8, op=@0xb73b5724) at OgreGLRenderSystem.cpp:2724
2724 glDrawElements(primType, op.indexData->indexCount, indexType, pBufferData);
(gdb) print primType
$1 = 4
(gdb) print op.indexData->indexCount
$2 = 96
(gdb) print indexType
$3 = 206878976
(gdb) print pBufferData
$4 = (void *) 0x0

Not sure if the indexType is valid, or if pBufferData is supposed to be NULL.

Frame #7 looks like this:
#7 0xb71aaab3 in Ogre::SceneManager::renderSingleObject (this=0x9beb630, rend=0xce916b8, pass=0xc654370, lightScissoringClipping=true, doLightIteration=true, manualLightList=0x0) at OgreSceneManager.cpp:3206
3206 mDestRenderSystem->_render(ro);
(gdb) print rend
$5 = (class Ogre::Renderable *) 0xce916b8

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

I'm thinking that pBufferData being a null pointer is the culprint. It should be the indices data buffer according to the docs: http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawelements.html

My guess is that the nvidia code does an extra check for a null buffer pointer, and aborts, while the mesa code doesn't, resulting in a segfault later on. I'll see if I can catch it on my own rig. Unfortunately it has a NVIDIA card.

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Have you tried building Ember from source against a later version of Ogre (i.e. 1.6.1)?

Revision history for this message
Marek (maaack) wrote :

Similar crash to the one described, except running on nvidia-glx. Also on 64-bit computer, but Ember stopped complaining when I installed the 32-bit libmng.so.1. I get to loading the textures and it crashes; the sky and character will load but ground never seems to make it and will remain black.

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

I've attained an ATI card and can confirm that this crash happens.

Changed in ember:
assignee: nobody → Erik Hjortsberg (erik-hjortsberg)
importance: Undecided → High
status: New → Confirmed
summary: - Ember crashes when joining game
+ Segfault within ATI fglrx driver
Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Marek:

The issue you describe is different. I'm pretty sure that it's something which is fixed in Ember trunk. There were some issues with the glsl shaders on ATI cards.

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

The issue was an OpenGL extension for hardware mipmapping which managed to perform random memory corruption within the OpenGL stack. It's now disabled for all ATI cards.

Changed in ember:
status: Confirmed → Fix Committed
Revision history for this message
Marek (maaack) wrote :

Alright, I'll wait until the next version is released and post a new bug if I still encounter the error. Thanks.

Changed in ember:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.