Page 3 of 3

Re: Remove AABB Asserts for Min <= Max

Posted: Wed Nov 24, 2010 5:57 pm
by exe_cutable
Hi all,

I understand that this assert is important. But shouldn't this code throw an exception if the OGRE_ASSERT_MODE is set for assert to do so?

I rebuilt Ogre with OGRE_ASSERT_MODE 2 and I still get this assert... Is this assert special or something?

Re: Remove AABB Asserts for Min <= Max

Posted: Thu Nov 25, 2010 12:03 am
by Klaim
I guess it's only because it's old code.

Re: Remove AABB Asserts for Min <= Max

Posted: Fri Dec 06, 2013 12:29 am
by Jinx
I know this is an old discussion, but just in case it helps out anyone else searching for a solution to the AABB problem, like I was, then I'll post details of my experience.

The debug build of my Windows application was running just fine most of the time, except for an occasional, intermittent heap assertion. To try and track the cause of this heap problem down, I decided to try using Microsoft's application verifier tool. As far as I can tell, this app-verifier tool is simply a GUI for adding a registry entry that tells Windows to enable certain debugging and verification options when your executable is started up. So I configured the verification options for my executable using the app-verifier and then debugged my application using VS 2012. The problem was immediately flagged up as being caused by multiple threads manipulating a heap at the same time, which I tracked down to a bit of faulty logic in one of my custom memory allocators that wasn't setting the HEAP_NO_SERIALISE flag correctly. I fixed this with a single one-line change, re-ran under the debugger, and all was fine. Satisfied that I had solved the problem I removed my application from the list in app-verifier. Just to double check, I re-ran my app under the debugger (with no app-verification this time, or so I thought) and suddenly this AABB assertion cropped up. I hadn't changed anything Ogre related, and I'd never seen this assertion before, so I was a bit mystified as to why it was suddenly occurring.

On a hunch I trawled through my Windows registry and found that an empty key with the name of my executable under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options. I deleted this empty key, re-ran my application, and now it worked fine. As a quick test, I tried adding this empty key back again (using regedit, rather than app-verifier), re-ran my application, and the assertion appeared. I've tried adding and removing this key a few times now, getting consistent results each time, so this behaviour is definitely related to this particular key in the registry.

It seems to me that when you remove your application from the list of executable to be verified in the app-verifier tool, then the registry key created when you initially added your executable to the list of those to be verified is not being removed. Only values below this key (which hold the actual verification options you selected) are being deleted. This remaining empty key seems to cause Windows to use some default verification settings for the executable. Presumably these defaults include enabling some weird floating point mode that affects calculations in Ogre, causing the AABB error.

So if you're running on Windows and having problems with that assertion, and you've run app-verifier for your app at any time in the past, it may be worth checking the registry key mentioned above and removing any sub-keys with the same name as your executable.

Re: Remove AABB Asserts for Min <= Max

Posted: Fri Dec 06, 2013 12:47 am
by Klaim
Wow that's important information. :shock: