This issue tracker is now in read-only mode. We migrated all our old bug reports to our bitbucket issue tracker
Please use our new issue tracker to report bugs. You can easily find all mantis tickets on our new issue tracker by selecting the appropriate bitbucket repo (CEGUI/CEED/Silly) and searching for the mantis ticket ID number.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000745CEGUIRenderer modulespublic2012-02-25 08:432012-06-04 13:45
Assigned ToCrazyEddie 
PrioritynormalSeveritycrashReproducibilityhave not tried
PlatformOSOS Version
Product Version0.7.6 
Target Version0.7.7Fixed in Version0.7.7 
Summary0000745: Crash in function OgreRenderer::beginRendering()
Descriptioncegui 0.7.6
ogre v1.7.2

d_pimpl->d_previousVP = d_pimpl->d_renderSystem->_getViewport();

This line will return a deleted viewport* pointer when destroy cegui window befor OgreRenderer::beginRendering().
Steps To ReproduceThe order is:
1. destory a cegui window

2. Window::onChildRemoved()

3. RenderingWindow::invalidate()

4. OgreTextureTarget::clear()

5. OgreRenderTarget::~OgreRenderTarget()
delete d_viewport;

6. OgreRenderer::beginRendering()
d_pimpl->d_previousVP = d_pimpl->d_renderSystem->_getViewport(); <-----return a deleted viewport in order 5.
d_pimpl->d_previousVP->getCamera()->getProjectionMatrixRS(); <------------crash
Additional InformationSee original forum thread: http://www.cegui.org.uk/phpBB2/viewtopic.php?f=3&t=6003 [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
CrazyEddie (administrator)
2012-06-04 12:25

The right solution here is to save/restore the existing view port in the CEGUI::OgreTextureTarget::clear function - which we probably should be doing regardless of whether it causes this issue.

The problem with the save/restore fix is that the existing view port may be 0, which will crash Ogre versions prior to 1.8 when we try to set that value back. Leaving us with either no real solution or really horrible hacky solutions.
CrazyEddie (administrator)
2012-06-04 12:51

changeset: 3303:2ecbb602cd9e
branch: v0-7
parent: 3257:60613aabcce9
user: Paul Turner <paul@cegui.org.uk>
date: Mon Jun 04 13:44:55 2012 +0100
summary: FIX: CEGUI::OgreTextureTarget::clear sets the Ogre system view port. This call can occur outside the regular rendering sequence and if the OgreTextureTarget is then deleted, Ogre and other parts of the CEGUI::OgreRenderer may try to access the deleted viewport. IMPORTANT: This fix only works when compiled against Ogre 1.8 and above.

As mentioned in the previous note, Ogre can return a 0 view port pointer, but versions prior to 1.8 will not allow you to subsequently reset that same 0 pointer back to the render system without causing a segfault. So this fix is committed for Ogre versions 1.8 and above only and is considered unfixable when used with previous versions of Ogre.
CrazyEddie (administrator)
2012-06-04 13:45

I have extended the reach of this dave/restore fix to also apply in Ogre versions prior to 1.8 when it is safe to do so (i.e when the old view port pointer is not 0). When it is not safe, the CEGUI::OgreTextureTarget's view port is left set.

- Issue History
Date Modified Username Field Change
2012-02-25 08:43 CrazyEddie New Issue
2012-06-03 11:31 CrazyEddie Assigned To => CrazyEddie
2012-06-03 11:31 CrazyEddie Status new => assigned
2012-06-04 12:25 CrazyEddie Note Added: 0001035
2012-06-04 12:51 CrazyEddie Note Added: 0001036
2012-06-04 12:51 CrazyEddie Status assigned => resolved
2012-06-04 12:51 CrazyEddie Fixed in Version 0.8.3 => 0.7.7
2012-06-04 12:51 CrazyEddie Resolution open => fixed
2012-06-04 13:45 CrazyEddie Note Added: 0001037
Get Crazy Eddies GUI System at SourceForge.net. Fast, secure and Free Open Source software downloads

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker