Jump to content

  • Log In with Google      Sign In   
  • Create Account

kalkas

Member Since 03 Sep 2008
Offline Last Active May 11 2013 08:46 PM

#4832965 C++ :: access violation error :: no source code :: show disassembly

Posted by kalkas on 08 July 2011 - 06:01 PM

Ok
nice lecture for how you suppose to speak. Now to the real problem..if you finished checking how I speak to people whose mouth going faster from their mind. And this is not only for smasherprog. And this is not an insult, is merely the truth. If someone can't bear I can't do anything. I always speak the truth.
Now, I know it's very hard to believe,nowadays, someone who says that he's know what he's saying but believe me, I know what I'm saying. If anyone read my first post I wrote that I made some changes before the error. Those changes was adding the myStruct and start using the template class string.h which I was suspected. I don't know if anyone took me serious there. Anyway.
I heard fastcall22 and comment everything but return true... The same thing. But there was something else. I commented and the only argument of the myMethod. Worked. Not till the end but until the next method with type string as one of the arguments. Now there is a very small chance to happening something wrong when I use operator= between two type string variable, didn't had time to check, but my main conclusion is that something happening in the deconstructor of the basic_string (member of the std I think). And this only when I use string as an argument of the current method. If the string is used inside the method then all good.
In the first situation right at the return point and somewhere inside the deconstructor of the basic_string something wrong is happening.
Another problem is that I don't have internet in my house and I need to go to another house to connect. And because of that I can't make tests in the same time you answer.
That's all.
Thoughts?


#4832577 C++ :: access violation error :: no source code :: show disassembly

Posted by kalkas on 07 July 2011 - 05:19 PM

The reason for insisting that the error is in myMethod is because the error is happening right at the return point. I don't know much of assembly but I know that in the call/return state of a function, a trade-off between memories (I don't know which memories) is taking place. I could check for a millionth time the rest code and post any suspicious part but I will insist in the myMethod theory.


#4832513 C++ :: access violation error :: no source code :: show disassembly

Posted by kalkas on 07 July 2011 - 03:31 PM

Sorry, I've made a change in the code.

Yes Rattrap, the pointer is valid and the myAnotherClass is properly initialized. It have tested it before i make the changes. It's working.

smasherprog and for all the ignorants out there, please if you don't understand something, don't post.
Read the message. It's says "There is no source code" which means the source that exists it's syntacticly correct. It's compiling and running. The error happens in the run-time.
Something in the return of the myMethod produces the error.

ApochPiQ, I have made the that trip in the debugger use said and the error pops up in the return of myMethod.


#4832487 C++ :: access violation error :: no source code :: show disassembly

Posted by kalkas on 07 July 2011 - 02:46 PM

Hi

I'm writing a library in C++ for OpenGL and in the same time a program to test this library. Recently I made some changes which produced an error.

Unhandled exception at 0x7c91ac4a in testOpenGL.exe : 0xC0000005:
Access violation writing location 0x00000010.

Pressing Break appears this message:

There is no source code available for the current location.

I can press Ok and Show Disassembly. I press Show Disassembly and the assembly code of my program (I guess) shows up. Here it is:

7C91ABEA  nop          	
7C91ABEB  nop          	
7C91ABEC  nop          	
7C91ABED  nop          	
7C91ABEE  nop          	
7C91ABEF  mov 		edi,edi 
7C91ABF1  push    	ebp  
7C91ABF2  mov 		ebp,esp 
7C91ABF4  sub 		esp,68h 
7C91ABF7  push    	ebx  
7C91ABF8  push    	esi  
7C91ABF9  mov 		esi,dword ptr [ebp+8] 
7C91ABFC  xor 		ebx,ebx 
7C91ABFE  cmp 		esi,7C97E178h 
7C91AC04  mov 		dword ptr [ebp-8],ebx 
7C91AC07  sete    	byte ptr [ebp+0Bh] 
7C91AC0B  mov 		eax,dword ptr fs:[00000018h] 
7C91AC11  movzx   	ecx,byte ptr [ebp+0Bh] 
7C91AC15  mov 		dword ptr [eax+0F84h],ecx 
7C91AC1B  cmp 		byte ptr ds:[7C97E0C4h],bl 
7C91AC21  jne 		7C91A4DB 
7C91AC27  mov 		al,byte ptr ds:[7C97E1E8h] 
7C91AC2C  neg 		al   
7C91AC2E  push    	edi  
7C91AC2F  sbb 		eax,eax 
7C91AC31  not 		eax  
7C91AC33  and 		eax,7C97E1E0h 
7C91AC38  mov 		edi,eax 
7C91AC3A  mov 		eax,dword ptr [esi+10h] 
7C91AC3D  cmp 		eax,ebx 
7C91AC3F  mov 		dword ptr [ebp-4],eax 
7C91AC42  je      	7C91ACE6 
7C91AC48  mov 		eax,dword ptr [esi] 
7C91AC4A  inc 		dword ptr [eax+10h]                       			<<----------------------------------------------------------------<<
7C91AC4D  mov 		eax,dword ptr [ebp-4] 
7C91AC50  and 		eax,1 
7C91AC53  mov 		dword ptr [ebp-18h],eax 
7C91AC56  mov 		eax,dword ptr [esi] 
7C91AC58  inc 		dword ptr [eax+14h] 
7C91AC5B  test    	byte ptr ds:[7FFE02F0h],1 
7C91AC62  jne 		7C9439C6 
7C91AC68  cmp 		dword ptr [ebp-18h],ebx 
7C91AC6B  push    	edi  
7C91AC6C  push    	ebx  
7C91AC6D  jne 		7C92BE6D 
7C91AC73  push    	dword ptr [ebp-4] 
7C91AC76  call    	7C90DF4E 
7C91AC7B  cmp 		eax,102h 
7C91AC80  je      	7C943A51 
7C91AC86  cmp 		eax,ebx 
7C91AC88  jl      	7C943B0E 
7C91AC8E  cmp 		byte ptr [ebp+0Bh],bl 
7C91AC91  pop 		edi  
7C91AC92  je      	7C91ACAC 
7C91AC94  mov 		eax,dword ptr fs:[00000018h] 
7C91AC9A  mov 		eax,dword ptr [eax+24h] 
7C91AC9D  mov 		dword ptr [esi+0Ch],eax 
7C91ACA0  mov 		eax,dword ptr fs:[00000018h] 
7C91ACA6  mov 		dword ptr [eax+0F84h],ebx 
7C91ACAC  pop 		esi  
7C91ACAD  pop 		ebx  
7C91ACAE  leave        	
7C91ACAF  ret 		4	
7C91ACB2  nop          	
7C91ACB3  nop          	
7C91ACB4  nop          	
7C91ACB5  nop          	
7C91ACB6  nop 

And here is the part of the source code of my library that has the problem:

bool myAnotherClass::myMethod(string name) {
	if(pointerTo_myStruct == NULL){
		pointerTo_myStruct = new myStruct();  // <<--------------------<< Source code of the myStruct (1)
		pointerTo_myStruct->Name = name;
		pointerTo_myStruct->pointerTo_myClass = new myClass(this);
	}else{
   	
    	//Does not enter here for the moment

		}
	};

	return true;                        	//          	<<-----------------------------<< Here is were the error pops up.
}

/*(1)*/ struct myStruct{

	myStruct(){ Name = "No Name"; pointerTo_myClass = NULL; Next = NULL; }
	//~myStruct(){ delete Next; };

	string Name;
	myClass* pointerTo_myClass;
	myStruct* Next;
};

I'm not pasting the source code of myClass because it's not new and it has no changes. All tested and working and irrelevant.
Now the changes I've made was: adding this struct and start using the string template class (#include string.h) which, I think, there is the problem. Something
that I'm not using right.

if anyone can think anything I'll appreciate it.
Ask anything you want.

Thanks


PARTNERS