News for hackers. Stuff that matters.
Re:Ask HN: Weirdest hack that you ever saw in production? by kieckerjan on Sunday March 25, 2018 @08:56AM (#16671985)
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 handling and by trial and error had found out he could get the thing to work reliably only by waiting for a while.
Re:Ask HN: Weirdest hack that you ever saw in production? by krylon on Sunday March 25, 2018 @01:30PM (#16673264)
An SAP consultant once told me that his preferred technique of averting long-winded and pointless discussions about irrelevant details was to insert random delays into his code. That way, instead of discussing irrelevant details, people would get upset about the performance. He would then sigh, dramatically, and say he would see what he could do, remove a few lines, spend the rest of the day reading the news, and - importantly - billing the customer.
Re:Ask HN: Weirdest hack that you ever saw in production? by jhanschoo on Monday March 26, 2018 @05:37AM (#16677711)
I'm pretty sure I've seen this before, is it one of the BOFH stories?
Re:Ask HN: Weirdest hack that you ever saw in production? by codfrantic on Monday March 26, 2018 @11:00AM (#16679380)
Re:Ask HN: Weirdest hack that you ever saw in production? by shoo on Tuesday March 27, 2018 @04:44AM (#16686500)
there's also the memory-optimization variant of this, from the land of game dev. see "the programming anti-hero": https://www.gamasutra.com/view/feature/132500/dirty_coding_t...

most of the other game dev dirty trick on gamasutra are good value -- the "(s)elf-exploitation" one from Jonathan Garrett, Insomniac Games is particularly awfully clever:

https://www.gamasutra.com/view/feature/194772/dirty_game_dev...

Re:Ask HN: Weirdest hack that you ever saw in production? by krylon on Monday March 26, 2018 @10:40AM (#16679215)
I am too lazy to check right now. ;-)

Honestly, this story was told to me by an SAP consultant. I do not think he was an avid reader of BOFH. I might be wrong though.

Either way, I think this approach to avoiding bikeshedding has been invented independently numerous times. ;-)

Re:Ask HN: Weirdest hack that you ever saw in production? by jakevoytko on Sunday March 25, 2018 @01:52PM (#16673390)
I once found a "sleep(1000);" in the middle of some hairy critical code -- something existentially important like payment processing. There was no obvious reason for it, it had been added without explanation, and the author was long gone from the company.

I didn't have the guts to remove it.

Re:Ask HN: Weirdest hack that you ever saw in production? by lgl on Monday March 26, 2018 @08:26AM (#16678297)
Having an important endpoint delay every response by 1 second (assuming the 1000 are ms) is a relatively common and easy way to delay brute force attacks. E-mail servers call this tarpitting.
Re:Ask HN: Weirdest hack that you ever saw in production? by jcranberry on Sunday March 25, 2018 @01:01PM (#16673088)
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