r/talesfromtechsupport • u/Stock-Patience • Mar 30 '20
Short Failed once a year
Not sure this belongs here, Please let me know a better sub.
I knew a guy that worked on telephone CDR (Call Detail Reporting) equipment, of course they take glitches pretty seriously.
They installed a box in a carrier in the spring, and that fall they got a call from the carrier reporting a glitch. Couldn't find anything wrong, it didn't happen again, so everybody just wrote it off.
Until the next fall, it happened again, so this time he looked harder. And noticed that it happened on October 10 (10/10). At 10:10:10 AM. Analysis showed it was a buffer overflow issue!
Huh? Buffer overflow? Because of a specific date/time? Are you kidding? No.
What I didn't mention, this was back in the 80's, before TCP/IP, back in the days of SDLC/HDLC/Bisync line protocols.
Tutorial time: SDLC/HDLC are bit-level protocols. The hardware typically gets confused if there are too many 1 bits or 0 bits in a row (no, I'm not going into why that is, it's beyond my expertise), so these protocols will insert 0's or 1's as needed, and then take them out on the other end. From a user standpoint, you can put any 8-bit byte in one end, *magic happens*, and it comes out the other end.
Bisync (invented/used by IBM) is a byte-level protocol (8-bit bytes). It tries to be transparent, but control characters are mixed in with data characters. If you have any data that looks like a control character, then it is preceeded with an DLE character (0x10). You probably see where this is going.
Yes, any 0x10 data bytes look like a control character, so they get a 0x10 (DLE) inserted before them. Data of (0x10 0x10) gets converted to (DLE 0x10 DLE 0x10) or (0x10 0x10 0x10 0x10) The more 0x10's in the data stream, the longer the buffer needs to be. On 10/10 at 10:10:10, the buffer wasn't long enough, causing the overflow.
Solution: No code change, the allocated buffer just needed to be a few bytes longer.
8
u/rylnalyevo Mar 30 '20
Wouldn't all those tens bytes be transmitted as 0x0A?
105
u/Codemonky Mar 30 '20
I had a similar issue when I was creating reports on a system, and then the customer would upload them to a server. Once a month they would fail, and the file would be one byte short.
Finally realized it was always on the 13th. That particular number freaked out the client, but, it alerted me to the problem. See, they used kermit for the upload. It did a binary transfer (probably SX, YX, or ZX protocols). Those protocols assumed text files unless you marked them as binary. The reports were coming from a MS-DOS box, and were being uploaded to a unix server.
What does the translation look like from MS-DOS to unix? Well, DOS terminates lines with a carriage-return(ascii-13), followed by a line-feed(ascii-10) character. Unix only uses line-feeds.
So, once a month, when that binary date hit 13, the file upload recognized it as a carriage-return and removed it, shortening the file by one byte.
Repeatedly asking the customer to change their file transfer to binary finally fixed the issue.
EDIT: Now that I think about it, I think kermit had its own protocol for file transfer, too. So, I really don't know which protocol they were using, but, it was definitely one that had a distinction between ascii and binary transfers.
89
u/bacteen1 Mar 30 '20
I love the stories of "the ghost in the machine," Thanks.
38
u/sock2014 Mar 30 '20
great story, 10 thumbs up!
30
u/Sp4ceCore When in doubt, reboot. Mar 30 '20
This would benefit from a bit of ELI5-ification because it was a great story about grandma's communication protocols :D
For those who understand it it's wholesome though ! It's the more cheese means you need more bread, but more bread means you need more cheese :P
60
u/CyberKnight1 Mar 30 '20
My thought process:
This doesn't make sense. Bits and bytes are different. The program shouldn't see "10 10 10 10 10 10". Those are decimals. It should see the binary representation of those numbers. And 10 in binary is... 1010. *click* Oooohhhhh.
Reminds me of the Y2k leap year problem, where you miss it until you go that one layer deeper.
15
u/kuldan5853 Mar 30 '20
Insightful story - I learned something today!
12
u/ShinakoX2 Mar 30 '20
I work customer-facing tech support, and the phone system we were using would bug out sometimes and kick us out of the phone queue. I reported it to internal IT and they eventually noticed that it would happen every Tuesday between 2-3PM or something like that and got it fixed. I never asked what the problem was, but I wonder if it was something similar.
7
u/HammerOfTheHeretics Mar 30 '20
Not quite phase of the moon, but close.
11
u/WirelesslyWired Mar 30 '20
Reminds me of the RTE End Of File problem. RTE is an old OS run on HP1000 computers. RTE stands for Real Time Executor. These computers were used for control systems starting in the 1960's.
A few months before Y2K, at 9:09 in the morning, every one of this customer's RTE machines crashed. When the customer called me, I told them to leave it off for the rest of the day, and call back tomorrow.
RTE used seven "9" characters in the non-data part of the file (file header or file tail) to indicate an End Of File. Any file written on 1999 9/9 at 9:09 would have an EOF in the file header and would instantly be corrupted.
At this time, system admins were more worried about the Y2K problem. HP didn't have a patch for Seven 9's problem on the now unsupported OS. They just told people to turn those machines off on 1999/9/9. If they didn't, RTE would probably need to be reloaded.
Of course, my customer didn't read their mail or email on the problem. The next day, they got lucky. They were able to delete and restore all of the 0 byte non-dated files, and keep on running without a complete reload.
4
u/jeffbell Mar 30 '20
Back in my DEC days there was a story about a printer driver that only failed on certain Wednesdays in the fall. The printer added a header string that need a buffer to be one character longer.
2
u/BenHippynet Mar 31 '20
I work in broadcast and we have a test signal called pathological bars that generates just that situation, longest run of 0s and longest run of 1s. It's a good stress test.
2
u/evil_shmuel Mar 31 '20
There are protocols that use certain patterns of 1 and 0 to signal start/end of a message. anything in the message that will result in the same pattern need to be escaped.
There are protocols that need to see bit change at least every X bits. usually timing issues. the receiving side is having problem measuring the length of a bit, and with too many bits that look the same, the measuring error can accumulate to an additional bit. so any time a message have too many 1 or 0 together, it need to be disrupted.
1
u/K-o-R コンピューターが「いいえ」と言います。 Apr 01 '20
But "10" is 0x0A.
1
u/VirtualDeliverance Apr 05 '20
Wait, what? 0x10 means 16, while 10 is 0x0A!
0
u/[deleted] Mar 30 '20
[deleted] — view deleted comment