Link to home
Start Free TrialLog in
Avatar of mohet01
mohet01Flag for India

asked on

buffer overrun error

Hello
We are running C++ binary which is giving the error as shown in the attached screenshot on machine windows 2008 R2.

Please let me know, How do i resolve this problem?

Sham
 User generated image
Avatar of Todd Gerbert
Todd Gerbert
Flag of United States of America image

Are you able to modify the source code for this program and re-compile it?
Avatar of mohet01

ASKER

Ya am able to modify the source code and re-compile

after this error, If i generate the process dump in that state using procdump.exe utility and analyse,  I see that process is getting stuck at close brace(}) of a particular C++ function as per windbg analysis(pop esi).

Strangely we are going to the same function 3 time successfully and coming back but fourth time application is stucking at the close brace of that same function.
Sham
Can you post the code for the problem function?
>> I see that process is getting stuck at close brace(}) of a particular C++ function as per windbg analysis(pop esi).

That suggests you have some clean-up happening in a destructor of a class that is going out of scope at that point. It is almost certainly going to be related to a double free/delete. I very much doubt looking at the code for that actual function will really help as it's unlikely the actual problem lives there.
Avatar of mohet01

ASKER

Hello
If u feel, problem is in the code,
Then I would tell u that this c++ binary runs properly on other versions of windows 2008
Sham
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mohet01

ASKER

Hello
I agree that this is c++ binary but this internally call c dll  where exactly it stops in a c function.
Sham
When you say it is a C DLL do you mean it has a C Linkage interface or that all the code inside it is written only in C? There is a difference.

Does the DLL allocate any memory that you later free in your own code? This will also corrupt the heap as each module (a DLL is a module and the consumer is another module) MUST be responsible for freeing its own memory, you can't allocate in one module and deallocate in another.
Avatar of mohet01

ASKER

All the code in the dll is written in c
Ok, well at this point I suggest you get hold of a memory profiler and see what it reports. Something like PurifyPlus will do. It's not free but you can download the eval version and it is fully usable.

http://www-01.ibm.com/software/awdtools/purifyplus/

BTW: Have you tried running this in the debugger? You will probably find you'll have the option to break and this will give you an opportunity to examine the environment, which might also give some clues.
Avatar of mohet01

ASKER

Hello
Yes I will try debugger
Sham
Avatar of mohet01

ASKER

you are correct
Since I was correct and it took you 2 months to tell me that, why the B grade?
Avatar of mohet01

ASKER

1) 2 months because we had another priority so analysed the code later
2) B grade because, we were know about the function name but you answer did not help me in detecting the local array over run error which corrupts the stack which is very famous as per the docs on internet.


You only had to ask for more assistance. The problem is that since I don't know your code I can't possible tell you where in your code to look can I? The most I can do is help you diagnose the issue and to try and point you in the right direction (which I did). If you needed more assistance you really only had to ask.

As for the 2 months, a question is technically considered abandoned after 14 days. As the asker it is your responsibility to keep on top of your open questions.

I've requested a moderator review the out-come of this question. I'll leave it up to then (in conjunction with your feedback) to decide the outcome here.

Thanks for responding to my request for clarification.
Avatar of mohet01

ASKER

Hello
I did not realise that i need to show the function.
If you would have ask, definitely i would have provide the scenario.
The problem with heap/stack corruption is they can happen anywhere at any time so I would have needed access to all your source code to have any chance of telling you exactly what the cause was. The best I could do was explain the steps to take to diagnose the issue (ie, use a profiler -- this is effectively all I would have done anyway).
Avatar of mohet01

ASKER

Hello
We were already there in exact function which cause this problem I already told you in my update history:
ID: 35698919
"after this error, If i generate the process dump in that state using procdump.exe utility and analyse,  I see that process is getting stuck at close brace(}) of a particular C++ function as per windbg analysis(pop esi)."
Avatar of mohet01

ASKER

If u want i will make it to wahtever u ask.
I have no intention to hurt in any aspect.
It was my judgement(perfect/imperfect) that i gave you what i gave.
It is nothing more than that

mohet01,

It's fine. I was more curious as to what I could have done better in all honesty. It seems the moderator has taken all things into consideration and augmented the grade. I really just wanted an unbiased opinion and would have been happy with either outcome.

I'm please you got your issue resolved.

Best wishes.

-Rx.