Live data from Hacker News

Ask HN: Weirdest hack that you ever saw in production?

news.ycombinator.com

191–200 of 289 posts

Re: Ask HN: Weirdest hack that you ever saw in production?

#191
Here's the weirdest hack that no one thought of as a weird hack:

I worked in a vehicle assembly plant from the mid to late 2000s, and our real-time monitoring was performed with a commercial off the shelf system called Cimplicity. Cimplicity was an excellent systems integrator... for the 1990s.

Cimplicity's main problem was that it wasn't enterprise scale; updating the content of screen objects was laborious.

Someone's solution was to add a database call to every object on the screen - some screens had about 100 objects.

So on each and every screen startup, on each and every computer, about 100 database calls were made.

---

I guess that wasn't too hacky, but when absolutely everything is half hacked together like that, it's hard to what is a hack and what is normal.

Re: Ask HN: Weirdest hack that you ever saw in production?

#192
Once we had a problem with Microsoft' LDAP library not handling referrals correctly on a Big Corp AD forest with domains on each sites. Real headache as we were already late for meeting our deadline...

Backstory: we produced a custom software that used Windows Embedded' LDAP library to handle the LDAP part (Winldap32 library with the Winldap.h headers). The machine running our software didn't join the domain, so it only authenticated the users with the ldap_bind function.

If I recall correctly, we found the ldap32 library referral problem when we used AdInsight (by Mark Russinovich) and saw the library was poking all around the place (the other forest DCs) and never completed any of the requests. I think we confirmed with Wireshark.

The hack was in 2 parts:

1) We made a DLL that offered the same ldap_* functions as those we used in our software. The library then redirected the LDAP calls to a python script that used a native ASN1/LDAP implementation which relied on nothing but pure python code.

2) Then we made a injection software that injected the DLL in our software at startup and replaced the Winldap32 functions with our DLL functions.

We then were able to bypass the MSFT' LDAP library problem, and I think we pretty close to our initial deadline in the end. Apart from the (very small) added latency on LDAP code, everything was fine in the end.

Re: Ask HN: Weirdest hack that you ever saw in production?

#193
post #144

I worked for a chain of medical clinics in the early 2000s in Florida. Everything was going digital. We had a “remote” office across the street that didn’t have internet access and it was really expensive to have lines installed. I don’t remember what the device was called but it was some sort of satellite dish. Our network admin had ordered them and installed them on the roof tops of both buildings and we could prov…

this was an awesome way to start my Sunday, thanks!

If you ever need a pick-me-up at my past selfs expense let me know ;) That place was full of stories!

Re: Ask HN: Weirdest hack that you ever saw in production?

#194
CTO had to make a deadline for the next morning, so he decided to override the safety system of an Autonomous Guided Vehicle of a few tons. Just bridged over it electrically.

Not only this, but he failed to inform the onsite crew that was going to put it in production.

AGV went somewhere it wasn't supposed to go, first employee pushed the red safety stop. AGV kept on riding, and thank god there was another person at the electonics panel to make it stop.

I was outraged about this, said that someone could have died, and that could mean jail time for the CTO. They said I was overreacting, and continued on their latest project that involved an AGV carrying people in an amusement park. I quited after that.

Re: Ask HN: Weirdest hack that you ever saw in production?

#195
post #153
post #120

Earlier quoted context omitted.

I have a simple rule about adding "magic" like that- if you can't make it immediately obvious to the readers of the code just what it is the magic is going to do, don't do it. AOP Java lead me to that rule because of too many obscure annotations that did insane things to help one developer avoid some minor nuisance.

I disagree that you shouldn't do it. The way you do it is to add a comment // This %thing% was generated from %template% using data from %data%. If your language is too restrictive to add sensible tools, you should write the tools yourself. As with any code, write it in a way such that other people will be able to understand it. There is no magic, it's just code. I wish people would stop using that word.

The original comment says "they just weren't anywhere in the code that humans could see."

Where would you and the comment in a situation like that one?

I don't have anything against generated code but it should be visible and, as you said, it should be crystal clear where it come from

Re: Ask HN: Weirdest hack that you ever saw in production?

#196
post #150

I once worked maintenance on a large C++ program used in production by a lot of customers. It was odd in several ways, but the feature that stands out in my mind was the numerous classes that were not defined anywhere in the source code or libraries. If that sounds unlikely to you, it sounded unlikely to me, too. I wasted a lot of time trying to figure out where they were defined. I couldn't ask the original author o…

Honestly, that sounds pretty normal, or at least ok, to me. Auto-generation of code is one of my primary daily tools, and I think it's just right for whole categories of problems. I currently generate a good third of my compiled sources, and also generate a rudimentary typescript library out of my source code to be used by the my colleagues. That being said, I usually work in Scala which provides language-based tools…

Hey, I'm a common lisp programmer. I'm down with automated code generation. But in Lisp or in Scala, as you say, it's in-language, so you can see what's going on by reading the code. This was different.

Re: Ask HN: Weirdest hack that you ever saw in production?

#197

In the midnineties I was hired to improve the performance (and eventually rewrite) a custom in-house search engine. I dipped into the software and there were some quick wins, but I couldn’t get the damn thing to reply quicker than 100 ms. In desperation I just grepped for the number 100 and sure enough I found a 100 ms sleep in the routines handling the connections. Turned out the author had made a mess of his socket…

I can vividly imagine finding this kind of bug through a random feel and briefly feeling great relief before flying into an apoplectic rage haha

Re: Ask HN: Weirdest hack that you ever saw in production?

#198

I once worked maintenance on a large C++ program used in production by a lot of customers. It was odd in several ways, but the feature that stands out in my mind was the numerous classes that were not defined anywhere in the source code or libraries. If that sounds unlikely to you, it sounded unlikely to me, too. I wasted a lot of time trying to figure out where they were defined. I couldn't ask the original author o…

If I had to guess, it was a hamfisted way of doing JS-style objects in C++. They could just slap properties onto objects, etc, and the build process will determine what each class needs. Clever, but terrible.

For what it's worth, it was before JS existed.

Re: Ask HN: Weirdest hack that you ever saw in production?

#199

Earlier quoted context omitted.

I've got one of those from "Only on WIndows" series. One of my colleagues uses WIndows and tends to remote in from home. Unfortunately when a cleaner cleans the office after hours she sometimes accidentally hits the CAPS key and he can't log in anymore remotely. His solution was to rip out the CAPS key and cover the hole with duct tape.

I do this, too. The first thing I do when I get a new keyboard is to remove the caps lock key. I never used it in my 20 years of PC usages and I don't get why it's still there. Back in my CounterStrike gaming days I would also remove the Windows key because it would crash the game when accidentally pressed.

My wife would kill me. She uses it to enter uppercase first letters. Just won’t (or can’t) work the shift key.

Re: Ask HN: Weirdest hack that you ever saw in production?

#200
I did some work for a major Australian Federal government department. They had a very secure environment and couldn’t (well, wouldn’t) allow webservices or anything else of that nature between themselves and other government departments. However, they did allow for email.

Luckily the ITSM system I had took incoming and outgoing email. They had a stored procedure “hook” for email. I reimplemented the SLA functionality by inserting the relevant data into the database, calculated the SLAs via the procedure.

Post reply on HN