I've been developing an application on my main computer for about a year now and everything is going quite well. Today I decided to test it on my older windows 7 laptop to check the applications performance and it runs great, however, when I exit the application the program crashes. I did some 'print debugging' and found that the crash is happening during a call to 'Device->drop()'
I've tested running the driver on DirectX9.0 and OpenGL mode and it only happens running DirectX. All the drivers and software are up to date on this machine, and in fact this machine has had a fresh copy of windows installed and nothing else has been put on it.
I've also had 5 other people run the application, 1 of which report the crash happens for them as well.
I'm installing visual studio on that machine now so I can run in debug mode to try and get more information here.
device->drop() Throwing Exception
device->drop() Throwing Exception
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: device->drop() Throwing Exception
VS2013 Exception Window:
Then the debugger breaks into my code at line:
Code: Select all
Unhandled exception at 0x60D8FC2C (Irrlicht.dll) in Infinity-Engine.exe: 0xC0000005: Access violation reading location 0XFEEFEEF2.Code: Select all
m_Device->drop()Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: device->drop() Throwing Exception
So m_Device->drop = 0xfeeefeef2? Or haven't you compiled Irrlicht for the debugger? But it is most likely that you are accessing memory that has been freed. (On Linux you could run valgrind.)
Re: device->drop() Throwing Exception
My first conclusion was that I was accessing memory that had been freed, but it working fine on most machines made me think otherwise. Compiling Irrlicht into debug mode and debugging my application still does not allow me to see into Irrlicht.dll to find exactly where the exception occurs. I'm getting
and when I try to point VS2013 to the Irrlicht.pdb it tells me
So I'm sort of at a loss as to what to do now.
Code: Select all
no symbols loaded for Irrlicht.dllCode: Select all
A matching symbol file was not found in this folder.Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: device->drop() Throwing Exception
Aaha! After pulling my hair out and recompiling all sorts of things I was able to get the debugger to break into Irrlicht's source code, here's where the exception is occurring:
IReferenceCounted.h, line 134
So this tells me I'm calling ->drop() on something I shouldn't be? Okay, but why isn't this error consistent across all test machines and why does it only occur when using the DirectX driver?
EDIT: After some digging around in my code I was calling ->drop() on a texture created with driver->getTexture() and that was the issue.
Hopefully someone in the future with a problem like this will find the topic useful!
IReferenceCounted.h, line 134
So this tells me I'm calling ->drop() on something I shouldn't be? Okay, but why isn't this error consistent across all test machines and why does it only occur when using the DirectX driver?
EDIT: After some digging around in my code I was calling ->drop() on a texture created with driver->getTexture() and that was the issue.
Hopefully someone in the future with a problem like this will find the topic useful!
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: device->drop() Throwing Exception
That's should be a bug report/feature request, shouldn't Irrlicht warn in some way that?
Assume Irrlicht code is not bugged
Something created with "getSomething" is owned also by Device/Driver. So You know Driver grabbed it once, and therefore should never happen to see refcount <= 0 before dropping it on destruction
if (recount<=0)
log ("User dropped this objects but was not supposed to do so");
Assume Irrlicht code is not bugged
Something created with "getSomething" is owned also by Device/Driver. So You know Driver grabbed it once, and therefore should never happen to see refcount <= 0 before dropping it on destruction
if (recount<=0)
log ("User dropped this objects but was not supposed to do so");
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: device->drop() Throwing Exception
Yes thank you, I agree it should assert/log some message, it took me a few hours digging around to figure out what the root cause was. It was my mistake when I read the function description of "getTexture" I thought it said you should call drop() :P
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.