IFileList* Access Violation in Debug (Not in Release)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

IFileList* Access Violation in Debug (Not in Release)

Post by Falcon »

Currently, my code works fine in Release mode, but if I run it in debug mode I get Access Violation message.

Here is my relevant code:

Code: Select all

IrrLoader.h
...

//For Scene Graph
IrrlichtDevice * m_device; 
scene::ISceneManager* m_smgr; 
scene::ISceneNode* m_collisionNode;
SoundSystem* m_soundSystem;
scene::ISceneNodeAnimatorCollisionResponse* m_animator;
irr::u32 m_nodeCount;
core::array<scene::ISceneNode*>  m_sceneNodes;

//For File Loading System
io::IFileSystem* m_fileSystem;
io::IFileList* m_fileList;	
core::string<c8> m_folderNameCheck;
core::string<c8> m_folderName;
core::string<c8> m_fileNameCheck;
core::string<c8> m_fileName;
const c8* m_nodeName;
...

Code: Select all

IrrLoader.cpp
...
//Constructor:
...
m_device = Device;
m_smgr = SceneManager;
m_collisionNode = CollisionNode;	
m_soundSystem = SoundSys;

m_fileSystem = m_device->getFileSystem();	
m_metaSelector = m_smgr->createMetaTriangleSelector();
m_fileList = m_fileSystem->createFileList(); //This is where access violation thrown
...
Could anyone help? Am I not handling pointers right?
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

So, m_fileSystem is 0?

Or is the crash actually somewhere else? What's the whole call stack?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

Post by Falcon »

This is the call stack, the IrrSceneLoader class is where the debugger freaks out:

Code: Select all

 Irrlicht.dll!005b798c() 	
 [Frames below may be incorrect and/or missing, no symbols loaded for Irrlicht.dll]	
 Irrlicht.dll!005b79ef() 	
 Irrlicht.dll!0057fb28() 	
>	Source.exe!IrrSceneLoader::IrrSceneLoader(irr::IrrlichtDevice * Device=0x00b631b8, irr::scene::ISceneManager * SceneManager=0x00b6fc98, irr::scene::ISceneNode * CollisionNode=0x00000000, SoundSystem * SoundSys=0x0012fbdc)  Line 23 + 0x17 bytes	C++
 Source.exe!main()  Line 108 + 0x46 bytes	C++
 Source.exe!__tmainCRTStartup()  Line 327 + 0x19 bytes	C
 Source.exe!mainCRTStartup()  Line 196	C
 kernel32.dll!7c816fd7() 	
Visual Studio Debugger says this:
Unhandled exception at 0x005b798c in Source.exe: 0xC0000005: Access violation reading location 0xbce73a7e.

At the breakpoint, I have these values:

Code: Select all

+m_fileList	0xcdcdcdcd	irr::io::IFileList *
+m_fileSystem	0x00b66468	irr::io::IFileSystem *
+m_metaSelector	0x00b678e8	irr::scene::IMetaTriangleSelector *
+m_smgr	0x00b6fc98	irr::scene::ISceneManager *
+this	0x00b73090 {m_device=0x00b631b8 m_smgr=0x00b6fc98 m_collisionNode=0x00000000 ...}	IrrSceneLoader * const
I think it is m_fileList that has the problem? I don't understand why the error is occuring, since my program runs fine in Release mode. I even set up a log file to output text after every line in this constructor, and everything was fine.
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
Post Reply