Bug hunting really was bug hunting in those days...
...can you even imagine anyone going to those lengths now? "Eh, just ship it, we'll patch it later"
Veteran Microsoft engineer Raymond Chen shared another fireside tale – one to strike fear into the hearts of engineers everywhere: the bug that can't be replicated in the debugger. The story begins near the end of the Word 97 release cycle, when a defect surfaced in the test labs but vanished the moment engineers reached for a …
In the 90s we had to bring in an ICE to catch a number of bugs our side because Apple couldn't write according to standards. Their AppleTalk Remote Access product implemented v.42bis compression in software, and obviously their programmers thought standard docs were bathroom reading only.
Wonderful bugs like sizing the data compression dictionary not quite like the standard said, but one or two slots shorter or longer. So bugs only appeared after completely filling the compression dictionary through long runs and then happening to hit a reference to old and somehow invalid dictionary strings. Permutate until pow.
As we warped our validated software further and further to match Apple's take on standards, the bug stops got rarer and rarer until finally the test harness coughed only every 12 to 16 hours or so. We had to have the external tracebacks the ICE gave us to have any clues.
Came in on the morning, got printouts from the ICE hardware, then spend hours trying to figure out how to understand the garbage Apple had sent. Crinkle the code some more, set up another test run, then return to our normal work load.
And yes, the managers thought the ICE an unneeded expense. "What, you can't debug your code?" No, we can't fathom the non-standard insane crap Apple is sending us. Reverse engineering intensely ego-ridden code hurts!
Perhaps these days AI can be used as an ICE to reverse-engineering ego-ridden management thinking?
Curiously I encountered this undocumented instruction (XHCF) when looking up the Motorola 6809 instruction set.
As a result of nostalgia† on my part - the 6809 was the first micro I programmed in assembly and probably the nicest instruction set of all the 8 bitters (never dealt with the 2650 or the TMS 9900… arguably 16 bit.)
Presumably 'halt' because only exits the test mode with a hardware reset and 'catch fire' because it is thrashing the address bus with incrementing addresses which presumably generates a lot more heat than just sitting in some sleep state awaiting an interrupt or reset.
† the pain (-algia) of foolishly comparing our aged jaundiced view of the present (nost) with those the rose tinted view of our misremembered, juvenile past
I started on the PDP 11 specifically an 11/10. In those days the CPU was all TTL all the way down. The later versions used a micro code emulator. However in the PDP 11/10 there was a specific self destruct instruction 014747(oct) which was:
01 MOV instruction
4 double decrement before read accessing memory pointed by register
7 Register 7 the PC
4 double decrement before write accessing memory pointed by register
7 Register 7 the PC
MOV --(PC),--(PC)
So when the CPU read the memory pointed to by the PC that contained this instruction it would then double increment the PC then start executing the instruction
MOV -> move instruction
--(PC) -> double decrement PC and read contents from location pointed to by PC
--(PC) -> double decrement PC and write contents into location pointed to by PC - AND LEAVE PC unchanged so that it pointing to the word before the previous instruction.
The result of this instruction was to start at the initial 014747 and fill the whole memory below it with 014747
Jesus. I was retarded enough to buy an iPad so I could read PDFs at lunch without it turning into postage stamp theatre.
Then I tried to transfer said PDFs from my Linux box without any Windows machines anywhere in the vicinity (and I didn't know about VMs at the time)
What was amusing was trying to explain it to the Apple Genius and being told to contact my Linux manufacturer.
Said iPad ended up being used for target practice.
Edit: This was back when iPads were pretty much the only tablet-anything. Later I was even stupider and bought a Motorola Xoom.
In embedded development we commonly used ICE's until JTAG made it possible to take more direct control of processors and do debugging without an ICE.
Devs still have talent, but most of us have moved so far up the stack away from the silicon that we don't do stuff like this any longer. I miss those days but there is more work to be done higher up in the stack and you have to go where the work is.
Hardly anyone.
Intel a few years ago published an open letter pleading for microelectronics engineers. They said that the US jobs market essentially had none to offer, and no one was doing the subject at university either. The irony was that this was after they’d had a firing round after some chip taped out, so they’d not exactly encouraged anyone to take it on…
And when it comes to manufacturing the chips, we’ll, as we all know that’s got to the “one deep” stage long ago, which is why TSMC et al are so important.
It's a classic, things that break while running live run flawlessly while under the debugger microscope.
I've had one like that, that I never found out cause or how to correct - it was probably due to events timing or concurrency that stop being a problem when run on a step-by-step basis. Somehow, after a seemingly non-related change, it went away.
> things that break while running live run flawlessly while under the debugger microscope.
Happens a lot when you have an optimising compiler - in debug mode the variables were stored neatly, within expected boundaries, but when optimised (i.e. stored into exactly the space required) bad things happened when you tried to reference them at the expected positions.
Worked on a product involving VOIP-ish packets from peers and a remote SAAS endpoint. Inhouse testing was perfect until it went to the customer test site, where it promptly fell over. The issue was out of order messages confusing the system. Only one of the devs could repro it. Turned out he was on ethernet whereas everyone else was on wifi. There was just enough of a difference on wifi to mask the bug. Guess what the customer site was using?
Did you not read the part of the article which said that they couldn't change to a new compiler version that late in the cycle because they would then have had to restart the whole test and certification process in case the new compiler introduced other, new, bugs?
Word already had Word Basic. Word 97 and Excel got a common language engine and as part of that, Word 97 adopted the 'Excel Basic' name. Not really a headline feature, because Word Basic, Access Basic, and excel basic were all variants of the same language, and the move move to a common library object was import internally for Microsoft, not externally for users.
So you probably already realize that Oracle patches are done with a Java executable.
And of course you usually have to use the LATEST and GREATEST version of Java. WHEEE!!!!
One of the recent middleware patches ran into an situation where the optimizer ended up issuing misaligned data accesses, which pissed off the RedHat libc that's picky about such things, which results in SIGSEGV applying the patch.
Oracle's solution? Run opatch with the -debug option, which disables the optimization.
I once found a long-standing bug in a BlueTooth chip codebase: one particular build consumed a lot more power, like 100x more, than it should. The change that "caused" the bug couldn't possibly do this.
I proved it by editing the faulty binary, to undo the one code change that apparently "caused" the fault, by replacing its test and branch with NOPs. The fault was still there. So it had to be to do with the code *orientation* wrt page boundaries or cache lines or something. And so it was. Someone had removed an "unnecessary" delay sometime in the deep past. It was necessary again, with the code in that particular orientation, which just suited the caching and page boundaries and suchlike. FFS.
This, IMHO, is the only reasonable use for editing a binary with NOPs. It's a powerful technique. I earned greybeard-wizard points :-) But you don't ship it!
Boring detail: I found the mechanism by normal debugging: the chip should, every 10ms or something, read its own temperature, and if it's changed by more than some amount, recalibrate some clocks and oscillators. It was doing this every single time. Because instead of a temperature, the read-temp routine was returning "Failed to read temperature" so its caller did the recal every time just in case. And all because the code to read back the temp was hitting the HW register too soon after kicking off the "get a temperature" AtoD converter.
I must have seen dozens under MS Codeview and MSDOS. I was never sure whether it was due to differing memory layout, timing, or the whole int3 patching thing. Generally used binary search and embedded writes to localise the bug or more commonly, coding error.
I have seen similar timidity under sdb and dbx with various Unix versions especially in the early days - not so much with adb but then you are usually desperate at that point.
The one I didn't expect was the C compiler using the wrong instruction for byte (or half word) swapping which was inexplicably obscured by the debugger. Only spotted it after generating assembly output from the compiler. Lesson: don't trust anything or anybody (and with those qualifications become a BOFH instead.)
This reminded me of an email in the Windows 3.X days. There was an email that a number of us had fun with in our building. To the best of our knowledge, the corruption was an accident, but any IBM PS/2 that scrolled to the end crashed. The user could reboot fine, as long as the user didn't scroll through the email again. We had a lot of fun with that one.