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

Started by
14 comments, last by ApochPiQ 12 years, 9 months ago
Don't ask for help if you refuse to listen to the answers.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Advertisement

[color=#1C2837][size=2] Just a guess, but maybe you could try printing the 'this' pointer in myMethod. Seeing the above says it can't write to 0x000000010, its possible the this pointer is null.

Unfortunately, if this were true, then "(1)" would have crashed; this is what lead me to believe stack corruption -- something in the "myClass" constructor is causing the problem. But even then, the debugger would have at least alerted him if the stack corrupted.


The reason for insisting that the error is in myMethod is because the error is happening right at the return point. [...] I could check for a millionth time the rest code and post any suspicious part but I will insist in the myMethod theory.

Comment everything but "return true;", test it. Then uncomment a single line and test, and repeat until the bug appears.

If this doesn't work, maybe you could give us a little background information as to what's going on. What's "myClass"? What's "myMethod"? What relations does "myAnotherClass" share with "myClass" and "myStruct"? Can you reproduce the problem with just a minimal program? What compiler are you using?

The reason for insisting that the error is in myMethod is because the error is happening right at the return point.

That is exactly the difference between symptom and cause I explained. You are observing the symptom, but you have to fix the cause. The return statement is very likely not the cause, only the symptom.


I could check for a millionth time the rest code and post any suspicious part but I will insist in the myMethod theory.

When looking for errors, your mind is set to one thing and you will often miss the obvious points. Check the same thing a million times with the same mindset, and you will always see the same thing. You need another pair of eyes (that would be us, or someone else) with a clean mindset on your particular problem to see it.

As ApochPiQ said; don't ask for help if you don't want to listen. After all, you came to us asking for help, and you did that because you can't solve the problem yourself, so you should listen to what we have to say. You are asking us to be the other pair of eyes to look at your code, but you refuse to give us the code to look at. You are not in the best position here to say what is irrelevant and what is not.
That function you posted the disassembly of is "_RtlpWaitForCriticalSection@4".

You (or a library you called) has probably either:

- Passed an invalid pointer to EnterCriticalSection().
- Passed a pointer to an uninitialized or corrupted CRITICAL_SECTION object to EnterCriticalSection(). This seems more likely to me.

Without seeing the call stack I have no idea how or where you've done that.
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?
I told you already - if all you're going to do is insult and ignore the people trying to help you, then don't waste our time.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

This topic is closed to new replies.

Advertisement