It was supposed to be a simple handover. One legacy application that was about to be retired. Paul smiled and took full responsibility.

It wasn't the complete absence of any documentation that broke him. Nor the extended hours trying to get it to build and run on another PC while the PHB bombarded him with messages from the airport on his way to a week’s holiday. The odd C++ inheritance wasn't a problem, nor the home brewed string class. The massive data allocation did cause a few raised eyebrows but thankfully it didn't leak badly enough to fix just yet. After all, it was going to be retired just as soon as Paul could get it running on anybody else's machine and it only crashed once an hour. The custom logging API, while not unusual, was no worse than anything Paul had met before.

Even the strange wrapper that seemed to be an attempt at a generic persistence layer was difficult but not out of this world. Paul struggled to find just what this monster needed just to build and ended up copying everything in the various registry setting and the whole convoluted data structure. Of course, the massive number of interdependent DLLs was a headache as was the very, very strange code surrounding and protecting a call to LoadLibrary. The custom string class also seemed to use a custom memory handler as malloc was probably found wanting in some respect. The occasional new was never explained.

What finally caused Paul to break down and lose it was:

  int errors=0;          
  do
  {
	LOG_E_BREAK("");
    	int const nMatrices=m_rawData.nMatricesX()*m_rawDataDim.nMatricesY();
	errors+=m_CCDDataGainArr.SetSize(nMatrices);
	LOG_E_BREAK("");

  } while(0);
  return errors;

Every single line of application code was written the same. Any error caused a blank line to be written to the log file together with the date and time and the code line. No other explanation. In release build it just continued until it silently and permanently died. Looking back, it was the "while" loop that reached the tipping point.

Paul is now recovering with the help of family and friends.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!