Mogre.Root.RenderOneFrame() error


22-03-2012 09:59:25

i run my application about 3 hours and then i reload some scene objects,my applicatin is beto crash

my application loop in main thread like:
private static void Application_Idle(object sender, EventArgs e) {
// ...
while (AppStillIdle) {

2012-03-22 17:24:21.546+08:00 System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted
at Ogre.Root.renderOneFrame(Root* )
at Mogre.Root.RenderOneFrame()
at IRobotQHostEdit.IRQ_App.Application_Idle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at IRobotQHostEdit.IRQ_App.InitAppSystem()
at IRobotQHostEdit.Program.Main(String[] args)NULL

somebody has idea? How to avoid this problem´╝čAccessViolationException


22-03-2012 11:00:31

This could come from a lot of things. Check your Ogre.log file.

You can also catch Ogre exceptions with a special catch block like this:
catch (SEHException ex)
if (OgreException.IsThrown)
throw new Exception(OgreException.LastException.FullDescription, ex);



17-04-2012 13:28:39

Yes, first look to the Ogre log file.

You could try this:
Create a copy of your project and replace the Mogre binaries by the "Cygon builds".
They seems to be release builds of Ogre/Mogre, but all PDB files are available and you can debug the Ogre source code. (e.g. set breakpoint and look to values)
Then remove your CATCH blocks, which catches AccessViolationExceptions, SEHExceptions and "Exception" (unspecific/all) .
Then perhaps the VS debugger will show you the line of crash.

Perhaps you need some changes for your applications to use the Cygon builds.
Most important is to set the target to .NET 4.0.

If debbugging with the Cygon builds should fail, perhaps the "official generated" debug binaries world work. I suppose there are all debugging options enabled and optimisations disabled.
Such builds you can create with the MogreBuilder. (Very easy usage.)
Look to the first lines of the config file and set the build configuration to "Debug".
Also you need to update your plugins.cfg file if you use the debug binaries.
Add "_d" to the plugin-names (equal to the file names of the debug binaries).

i reload some scene objects
If the problem still exists, please describe more detailed.