Visual Studio Developer Center > Visual Studio Forums > Visual Studio Debugger > program in IDE works; exe doesn't work, crashing at ntdll.dll
Ask a questionAsk a question
 

Answerprogram in IDE works; exe doesn't work, crashing at ntdll.dll

  • Friday, November 06, 2009 8:50 AMJojo2312 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi at all!
    Actuallay i am working at a student project programming a game (C++ and DirectX 9, Windows Vista SP2 and Visual Studio 2008 SP1).
    Our problem is very confusing! When we start our application out of the Visual Studio IDE (release or debug) it works fine. But when starting the created exe, it crashes after a few seconds with the following message details:
    Problem Event Name: APPCRASH
    Application Name: xyz (my Programm)
    Application Version: 0.0.0.0
    Fault Module Name: ntdll.dll
    Exception Code: c0000005
    Exception Offset: 00064ffb
    Additional Information 1: fd00
    Additional Information 2: ea6f5fe8924aaa756324d57f87834160
    Additional Information 3: fd00
    Additional Information 4: ea6f5fe8924aaa756324d57f87834160

    What does this error mean and why does it work out of the IDE? I cat attach the debugger but I'm not able to bring it to front, because the game is fullscreen.
    I can't find any tips or people with the same issue. I hope you can help me. Thanks!

Answers

  • Wednesday, November 11, 2009 3:40 AMRoahn LuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello,

    According to the SDK of the function D3DXLoadMeshFromX, the fist parameter of the function will be resolved according to the charactor set.  Another cause that I could think of is the charactor set. I noticed that the issue appears only with a third x-file, could we contact the provider for more information?

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!

All Replies

  • Friday, November 06, 2009 9:50 AMLei Shi Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    there's access violation in your app.
    can you try remote debugging to attach the debugger to the program?
  • Friday, November 06, 2009 10:32 AMJojo2312 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks for reply. I never did that before. Can you tell me how I can do that?
    I already switched the program to windowed mode and then started debugging the program, but I don't further steps...

    Maybe you can tell me the difference between starting the program via the Visual Studio IDE (using "Start debugging" with F5) and starting the program out of the explorer. Does Visual Studio do some checks or something else when debugging the program?

    - Edit: -
    I am searching the hole day for a solution, and I figured out that running with F5 (Start debugging) works but Strg+F5 (start without debugging) crashes the application. Any suggestions?
  • Monday, November 09, 2009 4:53 AMRoahn LuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Jojo,

    "then started debugging the program, but I don't further steps..."
    Do you mean we could not step into/over the program?

    As far as I know, one of the differences is the variable initialization. By default, if we start debugging our program, all variables uninitialized are set to null (0). For example, int count; will set the value 0 to count when start debugging.

    Could we generate a small application (with C++ and DirectX) which could reproduce the issue? or could we post a code snippet here?

    Thanks a lot!
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • Monday, November 09, 2009 7:30 AMJojo2312 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi,
    sorry, I think I forgot a word in my sentence => I don't know further steps. Here's a snippet of my code where it crashes:
    void Obj3DModel::load3DModel() {
    	LPD3DXBUFFER pTempD3DMBuffer = NULL;		// temporary Buffer
    	D3DXMATERIAL* d3dxMaterial = NULL;			// Materials of the Object
    	string stXFileFull = m_stFolderName + m_stXFile;
    	string stTextureFileFull = "";
    
    
    	HRESULT hr = D3DXLoadMeshFromX(stXFileFull.c_str(),
    		              D3DXMESH_SYSTEMMEM,
    					  GraphicEngine::getInstance()->getD3DDevice(),
    					  NULL,
    					  &pTempD3DMBuffer,
    					  NULL,
    					  &m_dwNumMaterials,
    					  &m_lpMesh);
    	d3dxMaterial = (D3DXMATERIAL*)pTempD3DMBuffer->GetBufferPointer(); 
    
    	m_pMeshMaterials = new D3DMATERIAL9[m_dwNumMaterials];		// materials
    	m_pMeshTextures = new LPDIRECT3DTEXTURE9[m_dwNumMaterials];	// textures
    	for(DWORD i = 0; i < m_dwNumMaterials; i++) {
    		m_pMeshMaterials[i] = d3dxMaterial[i].MatD3D;							
    		m_pMeshMaterials[i].Ambient = m_pMeshMaterials[i].Diffuse;	
    		m_pMeshTextures[i] = NULL;
    		if((d3dxMaterial[i].pTextureFilename != NULL) && 
    		   (lstrlenA(d3dxMaterial[i].pTextureFilename) > 0)) {
    			stTextureFileFull = m_stFolderName + d3dxMaterial[i].pTextureFilename;
    			if(FAILED(hr = D3DXCreateTextureFromFileA(GraphicEngine::getInstance()->getD3DDevice(),
    				                                    stTextureFileFull.c_str(),
    									   &(m_pMeshTextures[i])))) {
    			}
    		}
    	}
    	pTempD3DMBuffer->Release();	
    
    }
    
    
    All the pointers used here are set to NULL before using them. I could figure out, that it crashes in the following line:
    HRESULT hr = D3DXLoadMeshFromX(...)
    
     I call the function 2 times and it runs all fine. But just as I load a third x-file with this function it crashes. I know that I can "catch" the error with the FAILED macro. But it should be possible to load the x-File. Maybe I have enough time and write a small app which reproduces this error. Thanks for help.
  • Wednesday, November 11, 2009 3:40 AMRoahn LuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello,

    According to the SDK of the function D3DXLoadMeshFromX, the fist parameter of the function will be resolved according to the charactor set.  Another cause that I could think of is the charactor set. I noticed that the issue appears only with a third x-file, could we contact the provider for more information?

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!