Post

ca.2009, I was assigned to the most deranged software task of my life. Our lab machines that ran testcases had a small program that polled a server to see what tasks the machine should do (run a test, install suchandsuch software, etc)

This application was *ancient*, probably older than a lot of you reading this post. It was written in Visual Basic (pre-.NET), but the new OS images didn't have the VB runtime anymore, so machines could no longer bootstrap

We needed to rewrite the VB app into something that didn't have any installation dependencies, so they decided to rewrite this in C++ But instead of rewriting it (look at the code, determine what it does, write a new app), they decided to *line-for-line port* the VB6 code to C++

This is, objectively speaking, a doomed endeavor. This app had to run for weeks at a time. VB has a garbage collector, and C++ does not, so a single memory leak here will eventually brick a lab machine and require human intervention

Regardless, they hired a contractor team to do the port, but the contractors were "done" when the project compiled, not when it worked. Making it actually work (at all!) was our job

1 repost11 likes

In VB this is string concat; in C++ this is *pointer arithmetic* and we were jumping into the data memory where string literals are built into the binary, so you'd see different strings depending on the ping, starting at a random offset