Well, I wanted to note down one of the most silliest bugs I have done in my coding. I started off my code thinking that I will create a array of string pointers and allocate memory for each string dynamically. I did my coding initially with that assumption and everything was working fine. Now, as time passed I had forgotten that i had started off that way and started assuming that I had declared a char pointer of fixed length.
And the size was declared to be 355. So, basically this array could hold 355 strings. I did my entire code assuming that I am handling an array of string pointers but overlooked the basic declaration where I had declared it to hold 355 records. So, what happened was at one point of time the code had to handle more than 355 recs and my code was going for a toss. I didnt do the stress testing and this didnt come up in the Test Env. It came up once but I was looking for the issue elsewhere.
Then I had to come to the client place to Mexico to support the go-live and the code bombed. Imagine the client sitting on top of your head and you had to deliver and had none to reach out to. And not one issue but ‘n’ number of issues. I was thinking and working for about 30 hours without going anywhere near the solution. I had already sent a SOS to my manager at India and at Mexico and we were trying to reach out to different people. Then finally one of the client techie questioned me why I had declared it that way. And asked me to recheck. I did a quick recheck and changed the size of the constant and lo!! the code worked.
I cursed myself for this blunder. But sometimes this is how you learn. And I can never ever forget this in my life. It gave me a good teaching of all the loopholes that you should expect in a code. And the importance of quality reviewing. And good testing too!!! Finally one correct question saved the day for me and the client as well. The code is working fine now and I can do a lot of tweaking now to increase performance. But, the biggest of blunders at the least unexpected place, just because you forgot to look at the header file for the size. I am such a moron!!!!
