One day, a busy IBM-compatible mainframe began slowing to a crawl. Hundreds of programmers noticed immediately - some even resorted to banging on the server room window whenever the system became unusable. The problem appeared after a microcode upgrade, but nothing pointed to an obvious cause. In this episode, Jack Smith talks to Matt about an extraordinary piece of low-level troubleshooting that led deep into the internals of VM, interrupt handling and timer queues. Armed with nothing more than hex dumps, careful reasoning and a willingness to modify live memory, Matt uncovered a vendor bug and devised a temporary workaround that kept the system running until a permanent fix arrived. It's a fascinating story of how understanding a system at its lowest levels can solve problems that no diagnostic tool could explain. Want even more info? Read our show notes and related blog post related to this episode: https://blog.ithorrorstories.eu/episode-20-microcode-mayhem/ 00:00 Introduction 01:07 Mainframe Tech 04:38 Microcode Issues 07:19 Timer Interrupts 15:02 Modern Comparisons 19:44 Final Insights 22:18 Conclusion
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Hey, everyone. Welcome back to IT Horror Stories with Jack Smith. I am Jack Smith, and across the table I have Matt. Good. Good afternoon to you, sir. Good afternoon. Matt, you are one of the folks that reached out to me from the population of experienced mainframe people on any stories that you would be able to share here for the podcast. And yours stood out for various reasons, but also because of the technology you
were using, because you came up to me with a lot of terminology. Vm, cms, you mentioned amdal, you mention and timeshares. Can we quickly summarize what that is for people not really acquainted with that terminology, please? Okay, so I was working at the time between my undergrad and graduate school careers at a company that offered as a product a database system and the scaffolding
around it to support material requirements planning for manufacturers and what we. We developed the software and then we sold it to clients, and they ran our software on a remote computer service that we bought time from and resold to them. So they would have an interactive session where they would work with our software, or they had batch jobs that they would run overnight that would produce reports for them to manage their manufacturing operations.
So in those days, small companies couldn't afford large powerful systems, so we bought time from companies that were in the business of selling that. Just like now, after a few life cycles, we've gotten back to doing that with cloud services. When you set your thinking right now, you would, you would rent CPU cycles and disk space from Amazon, and it's exactly the same. You just rent a bunch of memory
and cycles from a system you don't really own. Yeah. So IBM at the time had two different kinds of architectures for large systems. One was a single operating system that ran multi session, multiple sessions at a time, and that was called mvstso. Then they also offered the free first virtual machine environment, which was VM cms. And VM was a hypervisor that ran multiple virtual machines,
each one of which was a single user session. Okay. Yeah. So VM was the hypervisor, and CMS was the name of the operating system that ran an individual user session. And then you would. VM could also run mvstso as a timesharing service. Yeah, yeah, yeah. So, and then you would have a bunch of clients sessions, a bunch of VMs sessions, which are all single user, into this one hypervisor as their own little virtual machine. So to call it in today's terms. Right. So I went to work for them for three years
and I spent about half that time as a programmer Analyst. And then I spent the last half of it as a the VM CMS systems programmer. What had happened was at the time, that was the early days of cloud clones of IBM System 378 machines. And so Amdahl was one of the big players then trying to fit in the small company niche. There were several other corporations and we bought a clone from one of those smaller ones and we moved out of our offices and into a new set of offices where we could build
a machine room with a raised floor and glass. You know, the glass is always cool because you bring visitors in, show them, show them your cool property. So we pretty informal shop in those days. And the CPU was about desk height. And so if there were multiple people in the room, one of them would be sitting at the console and people they were talking to would often sit on the desk until we got a memo from management suggesting that that would be something that we would should avoid if guests were in the building. That's a
very costly chair to sit on. So that's kind of the background. I have a feeling not everything went well every time on those machines. Yeah, well, it was, you know, early technologies. The other thing it was early technologically in was microcoded CPU simulators. So we used the people who were building these clones, built them with off the shelf CPUs, and that would run microcode to emulate
to make it compatible. Yeah, okay. So they would add a layer that they would emulate in, so to speak the IBM language into their own. Okay, yeah, yeah. And so, you know, since we were early adopters of this particular company's work, we had the customer engineers on site with some frequency. Most interesting adventure was had to do with a microcode update, after which system just sort of started slowing down over the course of the day until it
was rendered effectively unusable and you'd have to re IPL or restart from scratch. And then nobody had a really clear idea why it would do that. But I started investigating and I ended up learning a whole lot about the operation of the CPU and the internals of the hypervisor operating system in order to finally run down what was actually happening, which is what we were dropping timer interrupts. So the way that works. For people who aren't familiar with the internal
workings, computer memory is sort of a. Is basically a sequential list of numbered bins where data is stored. One of the bins in a fixed location is the clock, which increments automatically through the hardware by like once every microsecond or so. And Then another location is an alarm which holds a fixed time. And when the timer matches the time in the alarm location, an interrupt is generated.
And that calls an operating system routine to deal with whatever the event is and list of events. I can indeed imagine if that timing goes wrong. Not much will happen anymore if that gets messed up. So in order to find this, you need to know how the the list of current events is stored. And that is a linked list. So there's again a known location in memory that points to a location that can change where the next entry in
the event queue lives. And then each entry in the event queue holds the location of the next entry in the event queue. And then there's a known location where the back end is. What happens is when the alarm goes off, when an event becomes the first event in the queue, whether because it's the first event you post or because the event before it is processed, the operating system reads its alarm time and posts that into the alarm location, goes from there. Yeah, okay. And then if you add an event to the queue, it goes
on the back. And then each time the alarm goes off, you pull the event off the front of the queue, update the alarm with the next event's timer, and then process the event and do whatever it was you were supposed to do. So the entire, let's say multitasking between all those single user session that would be in there. So and if that one failed, then, or indeed went slower, you lost your slot and you had to go around. Okay, so that is. That's very annoying. Yeah.
So IBM, of course we all were using 3270 terminals which were synchronous. So you pressed Enter and what you your reward for that was an entry in event queue until that event came up. And then whatever you wanted to have happen would happen. Yes. And so what I finally identified was when this started to happen, the event at the front of the event queue was in the past and the alarm was in the past. So what had happened was, was that the clock had run right past the alarm time and had
not generated the interrupt to process the corresponding event. So that was the bug. And the hotfix was ended up being to pause the machine, put a time in the future in the alarm. Oh no, resume the machine and hope this time that the timer interrupt would catch and then it would clear all the past events. Oh wow. Don't miss an episode. Subscribe now on Spotify, Apple Podcasts, YouTube and more. Support us by leaving a like or a
review. You can always find more at it. Horror Stories eu and we're just an email away at hellot Horror Stories eu. Okay. And how many times did you have to do this? I had to do it a few times a day for. Everything just completely stopped because everything was slow down until, you know, until you had application
programmers banging on the glass. Oh, yeah. Because their session would be stuck or renewed. Right. You hit Enter and nothing happened. Yeah. And then, of course, with all the glass panels, there was nowhere to hide because you were clearly visible. Yeah. I think we found the downsides from all the marketing in the glass room. So then we had to call in the customer engineers and they had to sit and watch for a couple of days while I did this over and over and over again to convince them that in fact it was a microcode bug where something about the microcode
caused the interrupt to just get dropped. I don't know if it was generated and not handled or if it was just missed entirely. That's. But, yeah, but let's just say that the symptom was very clear that something wasn't being translated properly. It wasn't handled properly. Yeah. In front of the Amdahl people. No, it wasn't Amdal. It was just a different company, but. Oh, a different company. Sorry. Okay, my bad. So anyway, they went off and they got it fixed after that in a couple of days. We updated and everything worked
well after that. How did you prove to the guys that it's the microcode? Because I imagine if you call Microsoft or VMware today, they will say, well, it's not my problem, the kernel is fine, the microcode is fine. So how. You're going to have to show them something that. Here it is. Yeah, it's, you know. Here, take a look. We paused the machine and you can look and you can see that the clock has now passed the alarm. And. And the event corresponding to the alarm is still at the front of the event queue. So the alarm didn't
generate the interrupt. That's clear enough that that's not a problem that the software had. Right. So you can actually, you know, you can sort of watch that happen if you. As it happens. Yeah. Or as it does not happen, actually, you can sort of step along and you could play around with. I can stick something on the event queue that doesn't do anything, but it's got to trigger the alarm if it's on the queue. Okay, so you can simulate it. You can put in a fake alarm and then see if it gets triggered, is what you mean. Yeah. So the
thing Is since it's intermittent, sometimes that works and sometimes it doesn't. But then sometimes bugs are always the best to find. And then when the microcode was found as the culprit. Yeah, so they're system engineers. Then take my explanation of what's going on. And it was convincing enough that, that they were able to investigate the actual microcode and find the bug. Oh, so they did actually find something from your thing. So, so I didn't have to actually prove it. I had to convince
them, just provide enough evidence that their people were convinced that it was something they had to look into. And then apparently it was reasonably easy to find after that. Okay, and then how does the object get to you? Do they ship you a new. A new EPROM or, or new paper tape? How does the microcode get to you? That came. I think it must have come on some tape of some sort. Yeah, I would say, I would probably guess like an 8 inch floppy or
a tape that you load at startup. Seemed the most logical to me, although I've never touched one of those machines, so I'm guessing here. Yeah. However it was, it was in the cabinet. I remember that. So I'm guessing it probably was an 8 inch floppy at that point in those days. And then that would have the microcode, it would boot up their own iron and then you would get into the emulated IBM environment. So on that system can describe what it looked like because we imagine mainframes as a row of cabinets and
the spinning tape drives with the loops going up and down and then the big punch card readers. But this was beyond that, I guess. Well, I mean we had a couple of tape drives and we had a couple of 3330s. The removable multi multi disk disk drives. The CPU itself I remember was IBM Blue and it was desk height and it had three sections. There were two wings with the angle between them about 130 degrees. And then in
between them was a cabinet with a. Essentially a 3270 terminal on the top, that keyboard. And that would be your operator console. Right. And the whole thing was desk height and it was probably 8ft from end to end. And that was the entire system. Did that come with already with removable disk packs? Because those, I think those were getting common back then. That's what we had. They were built into the unit. We had separate actual
32 drives. Yeah. Okay, well that's, that is something that 3330 is 10 platters. 19 sides were writable and they came in a clear plastic Cover unit and you would drop the unit into the top of the thing and you'd screw it down. Then you close the lid and it would create a vacuum. And then just. Okay, looking at. Because you did all that bug fixing so many years ago,
how much of that investigation would still apply today if something like that would happen? Let's try to compare it to today's tech if we can. Okay. Yeah, it was, I mean technology for microcomputers has, and even mainframes hasn't changed. I mean it's advanced, but it hasn't fundamentally changed since then. You still have a cpu, it still runs microcode to the processor is pretty simple,
but it runs microcode to implement the complete instruction set. It was probably about 10 years ago that somebody discovered that intel processors were doing division wrong. Yes, the fdif. And they actually discovered, I think sort of by accident that some division that they were doing in a spreadsheet produced an obviously wrong result. And so, so you need to be able to update the microcode in a computer, anybody's computer now. And I've noticed on usually
I run Linux on my workstations and I have noticed that basically every device now comes with a microcode loader quite often because the, every, the internal Intel CPUs, they, they no longer speak x86 since years or decades. So they do have some interpreter, the microcode in front of them. And I don't see you put a new floppy disk in an Intel CPU to update the microcode. No, I think, yeah, at this point it just becomes integrated into the system or, or it's provided as a, as a downloadable driver
and then they work around it. That's right. Have grown much more sophisticated since those days. So you have to do the same kind of thing on like a video card because video cards are fantastically complicated. Now your Linux systems today. Could you, can you still look into the interrupt scheduler today? Is that still possible or is that completely hidden inside the kernel space? Can we still do that debugging that you did back then? Can we still do
that? Well, you can certainly still look at the software itself because Linux is all open source. Yes, you have the source. Correct. As a user, since going back to graduate school, basically I don't know that there is a user accessible way to actually pause the actual hardware cpu. And step. You can certainly look at memory. But yeah, I can indeed see you
have. Well, if you have access into kernel memory, then indeed you can find the scheduler. But indeed going step by step, maybe also if you have a Virtualized environment. But I will have the Linux specialists, which is not me, reply to that in the comments. Since then I have never pause the CPU that was low level enough for the rest of your career, let's just call it. No, I mean, you know, in a debugger you pause the execution. You can step through the execution of user space programs, but I
don't think you have the same hardware access that we had. I think this was a fascinating lesson of how like low level those machines were a few decades ago and that it was still all fixable if you had the correct access and knew how to read. Interrupt Scheduler this podcast features Jack Smith and guests. We say thank you to our demoscene friends who helped making this podcast possible. Commander Homer for editing. Danko for music and audio advice. Net Poet for
additional voiceovers. So Matt, final question, because you mentioned briefly that people would have timeshare systems, but of course this evolved. How this, how did this evolution work from the
timeshare and then everybody getting a terminal on their own desk. Did this go quickly? Was where the growing pains. Because today we imagine a desktop and a laptop on our desk and three in our lab. But back then that was not the case. Yeah, well actually, and the end of the story is that we do that now, but we have cloud services. But actually my father worked in the really early computer industry on one of the very first business computers.
And in those days a company would have to be oh, medium sized or better to be able to afford a computer. And then as the machines got large enough to handle multiple users simultaneously and the software developed to be reliable enough to do that and serve everybody online at the same time, time sharing services developed and they would allow you to run interactive and batch jobs remotely as a customer. And they had multiple customers and build
them all separately. And this is how small tech companies basically operated in those days is you, you didn't have your own computer because it was too expensive really to have an organization's computer. So we just all had timesharing accounts then that was shortly before the advent of the personal computer. After that, instead of just having a terminal that was connected to a computer far away over a phone line, you had. Because this was before the Internet really got started too.
Yes, you could have your own computer and it had two little five and a quarter inch floppy disk drives and eventually ten megabyte hard drives and a couple of gigabytes of memory or several megabytes of memory. Yeah, indeed. After that the cloud services came in so small companies could buy large scale Computing resources without having to actually own them. But and then in between there
was these, the clones. And Amdahl was a player in the big metal, big iron market. And these other companies that we were dealing with were trying to give small companies. We had 33 employees. I was employee 33 and then we had about 60 by the time we had our own computer and we could afford our own mainframe. And for us that was great because we could turn around and instead of having to resell timesharing services for our clients, we could sell directly
to them. You did it yourself on your own mainframe instead of renting it somewhere. Right. And we could cut the price and increase our revenue at the same time. But in the meantime, I quickly looked up Amdal and because I honestly never heard of them before and it seems that they are now a part of Fujitsu. And that does ring a bell because Fujitsu indeed still has mainframes. I think that might still be the old Amdal still kicking
around inside Fujitsu. That to me is amazing computer history, to be honest. So I looked at my old company and they have been folded into larger companies a couple of times and then finally disbanded. But I didn't get a chance to look up the original computer company. But I suspect like many of the companies in those days, they've probably just sort of faded away. Rest assured that the way that computer programs are still kept developed somewhere, that code is still running today.
You can on all the big mainframes. It is not that hard to find COBOL code that is a few decades old. Actually we have come around multiple times here. It is wonderful. Yeah, we run a Citrix system here on campus that basically if you don't have a Windows machine on your desk, you can log in remotely and have a Windows desktop on your desktop. Yes, exactly. So this was IT Horror Stories with Jack Smith. Thanks Matt for the information and the story.
You can find us on Spotify, Apple Music, YouTube, Deezer and wherever you find your panic attacks. Multiple episodes a month. We have merchandise shop.ithorrorstories.eu and we have a website, ithorrorstories.eu. It can be that easy. Social media. Yes, we do. Instagram, TikTok, Facebook, LinkedIn, Blue sky and Mastodon. And all the other links are on links.ithorrorstories.eu. Thank you all for tuning in and we will listen to each other in the
next one. The content of this podcast is intended for entertainment purposes only and is meant to humorously explore various tech related situations. Any resemblance to actual events or real persons living or dead is purely coincidental. We ridicule situations, never individuals or groups. Listener discretion is advised, and we encourage everyone to approach technology with a sense of humor and an
Why does Windows still dominate the corporate desktop after all these years? One answer is surprisingly old: Group Policy. Microsoft has spent decades building centralised management directly into Windows, allowing...
From the classic backhoe cutting through a cable to redundant network paths, data protection, user connectivity, and the cost of building infrastructure that can survive failures, we explore where redundancy helps and...
What happens when a company rushes into AI adoption without understanding what it actually costs? Ankit Mishra joins Jack Smith to share a firsthand incident involving an AI-powered sales lead generation platform,...
Call Center Down: If Only AI Could Diagnose Network Traffic Problems What happens when hundreds of call center employees suddenly find their systems grinding to a halt, only for everything to return to normal at 5 pm?...
Two critical PHP vulnerabilities. Emergency patches. Government websites going offline. And IT teams around the world suddenly discovering just how much forgotten infrastructure they're responsible for. But the real...