GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C++
Go To First  |  Previous Question  |  Next Question 
 C++  |  Question 150 of 203    Print  
What was the most difficult debug you have ever done?

  
Total Answers and Comments: 3 Last Update: March 23, 2008     Asked by: shanecage 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 10, 2008 07:08:52   #1  
wanttochange Member Since: January 2008   Contribution: 9    

RE: What was the most difficult debug you have ever done?
can be if yr application get hanged...& you don't no even from where u should start debuging...this can be the most
 
Is this answer useful? Yes | No
January 10, 2008 07:08:53   #2  
wanttochange Member Since: January 2008   Contribution: 9    

RE: What was the most difficult debug you have ever done?
can be if yr application get hanged...& you don't no even from where u should start debuging...this can be the most difficult
 
Is this answer useful? Yes | No
March 23, 2008 01:50:12   #3  
indrajit_p Member Since: July 2007   Contribution: 2    

RE: What was the most difficult debug you have ever done?
Once there was a BIG fat bug inside my computer which had claws like ...

kidding.

I recently had to debug an intetioanlly bugged program in a debugging test where a function was being called recursively and the function was creating a string and passing it as an argument to the recursive call.

for creating the string a static global variable( char[]) was being used.

which is a MAJOR bug because imangine there is only one recursion. Inside it the static global char[] was being overwritten. Then that call returned. But in the calling function the char * pointing to the argument it was passed has been corrupted by the recursive call.

the solution was to make it a local char[] in the recursive function so each call would have it's own copy a pointer to which would be passed in any child call. Since it is a child call the pointer would point to a valid location (the local copy of the char [] in it's parent call) till the end of this call and beyond.

this was not the MOST difficult but definitely very tricky.

I would guess the most difficult bugs are forgetting to free allocated memory in a very involved program where it is easy to overlook the error.

cheers!
I

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape