• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

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
 error
0
mohet01
Asked:
mohet01
  • 10
  • 8
  • 2
1 Solution
 
Todd GerbertIT ConsultantCommented:
Are you able to modify the source code for this program and re-compile it?
0
 
mohet01Author Commented:
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
0
 
Todd GerbertIT ConsultantCommented:
Can you post the code for the problem function?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
evilrixSenior Software Engineer (Avast)Commented:
>> 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.
0
 
mohet01Author Commented:
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
0
 
evilrixSenior Software Engineer (Avast)Commented:
Sham,

That is not actually that uncommon with heap corruption. The result is pretty much random because the C++ standard does not prescribe any specific behaviour other than it is undefined. There are many things that could result in different behaviour on a different machine including versions of the C Runtime and external factors such as the machine environment.

There is nothing else other than your code (or any code you run in-process) that could corrupt your processes heap-space so this really can't be anything else other than a problem with this application.

-Rx.
0
 
mohet01Author Commented:
Hello
I agree that this is c++ binary but this internally call c dll  where exactly it stops in a c function.
Sham
0
 
evilrixSenior Software Engineer (Avast)Commented:
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.
0
 
mohet01Author Commented:
All the code in the dll is written in c
0
 
evilrixSenior Software Engineer (Avast)Commented:
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.
0
 
mohet01Author Commented:
Hello
Yes I will try debugger
Sham
0
 
mohet01Author Commented:
you are correct
0
 
evilrixSenior Software Engineer (Avast)Commented:
Since I was correct and it took you 2 months to tell me that, why the B grade?
0
 
mohet01Author Commented:
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.


0
 
evilrixSenior Software Engineer (Avast)Commented:
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.
0
 
mohet01Author Commented:
Hello
I did not realise that i need to show the function.
If you would have ask, definitely i would have provide the scenario.
0
 
evilrixSenior Software Engineer (Avast)Commented:
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).
0
 
mohet01Author Commented:
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)."
0
 
mohet01Author Commented:
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

0
 
evilrixSenior Software Engineer (Avast)Commented:
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.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 10
  • 8
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now