Thread View: alt.folklore.computers
4 messages
4 total messages
Started by lin... Peter van der Linden
Fri, 22 Dec 1989 21:34
The program that stumbled
Author: lin... Peter van der Linden
Date: Fri, 22 Dec 1989 21:34
Date: Fri, 22 Dec 1989 21:34
34 lines
2388 bytes
2388 bytes
A few years back I was working on some software for a brand-new hardware prototype (a board level implementation of the Intel 432, if you must know, that will produce gasps and sighs from the oldtimers). There were remarkably few debugging aids, and the software seemed to be behaving in a very strange way: execution seemed to be getting "stuck" on one particular address. It looked like the program was running OK until it hit this one address, then it seemed as though the program counter wasn't being incremented, and it would repeatedly execute the instruction at that address to the exclusion of all others. This was really strange! "Perhaps there is a big piece of data, sticking out blocking the bus at the next address" I suggested helpfully. We hauled out the oscilloscope (after exhausting the traditional software engineer methods of dealing with recalcitrant hardware - i.e. we knocked it silly). We probed that board left and right, up and down, side to side, and do you know what we found? (that was a rhetorical question, press "sp" if you want the rhetorical answer) It looked like execution was getting stuck at that one address because execution *was* getting stuck at that one address! There was an interrupt line which had not been strapped down, and zillions of spurious interrupts were coming in on it. In fact it was continuously interrupting, causing a continuous diversion of the flow of control to the first location in the interrupt service routine. Perfectly obvious once it's pointed out to you, but we certainly puzzled over our slightly out-of-whack observation. Merry Christmas, and to all a good hack. ---------------- Satisfaction not included. Batteries vary. Your mileage may guarantee. Peter van der Linden lin...@SuN.cOm (415) 336-6206
Re: The program that stumbled
Author: a... Andrew MacRae
Date: Fri, 22 Dec 1989 23:44
Date: Fri, 22 Dec 1989 23:44
23 lines
1707 bytes
1707 bytes
I too, had a program that seemed 'stuck' on one address. The machine was a Data General Nova 3 (remember them?) and I was writing some kind of diagnostic program in assembler. The way to debug such a program was by using the single step toggle switch on the front panel and watching the lights to follow your code as it executed one instruction at a time. The problem I had was that the program kept jumping to location zero instead of location 1000 (octal). I kept reloading the program and single stepping up the the jump, displaying each of the accumulators (not registers) on the front panel to no avail. The program kept on jumping to location zero instead of 1000. After many minutes of this the answer dawned on me. I toggled the lamp test switch (which turned on all of the lights) and sure enough, the light at octal 1000 was burned out. The program *was* jumping to 1000 all along, but with that light burned out the front panel only showed zero. What ever happened to front panels anyway? I miss them. Andrew MacRae Sun Microsystems
Re: The program that stumbled
Author: David Collier-Brown
Date: Sun, 24 Dec 1989 00:25
Date: Sun, 24 Dec 1989 00:25
52 lines
2956 bytes
2956 bytes
>I too, had a program that seemed 'stuck' on one address.
Alas, the address in question was zero, so its was reboot-time whenever
this occured. Real quick!
I and two collegaues had been writing a program that ran stand-alone on an
IBM 303x (well, actually virtual standalone, we were using vm to debug it).
One of the things it had to do was dispatch interrupts, which on a /360 was
something of a giant pain. Instead of writing the world's longest case
statement, we checked the manual for the supposed behavior of the channels
and sure enough, the channel control program counter pointed to the next
instruction after the end of the channel program. So I decided that the
channel programs would:
1) consist of single instructions
2) not modify themselves, and
3) be immediatly followed by the interrupt handler for that
program.
This worked perfectly as we started single-stepping through the program.
The first interrupt came in, the common handler set up a frame and called
the address in the channel's pc, it ran, detected that this was the first
time the device (an input pretending to be a cardreader) had been called and
this was just a "acknowlege startup" interrupt, returned, did an RTI and
all was well. Then I handed it a "card".
Reboot.
Trace it again, plant a breakpoint in the interrupt handler, hand it
a card.
Reboot.
Trace it AGAIN, plan a breakpoint in the common handler, hand it a
card, watch it pick up the channel pc and branch to it.
Reboot.
What!!!!! I just saw it work properly. It branched to the correct
location: Er... it branched to the pc, anyway...
Yes, it branched to the contents of the channel pc, which were zero. Thats
the cause of the reboot.
It seems like the channel pc was never used under VM, DOS & MVS unless
there was an error, so it was never set by VM unless the interrupt was due
to an error, startup interupt or other unusual event. If it was a
non-excepional i/o interrupt the channel pc was zeroed. To this day I don't
know if the bare iron would do the same thing: we never got time on a
stand-alone machine to try it.
Ah well, I never liked the /3sickly, anyway.
--dave
--
David Collier-Brown, | davecb@yunexus, ...!yunexus!davecb or
72 Abitibi Ave., | {toronto area...}lethe!dave
Willowdale, Ontario, | Joyce C-B:
CANADA. 416-223-8968 | He's so smart he's dumb.
Re: The program that stumbled
Author: k... Ken Yap
Date: Sun, 31 Dec 1989 19:44
Date: Sun, 31 Dec 1989 19:44
10 lines
1227 bytes
1227 bytes
|>I too, had a program that seemed 'stuck' on one address. Speaking of being stuck on one address, my professor once told this tale of misoptimization, quite possibly apocryphal. It seems these computer architects were looking to speed up their machine. They looked at their dynamic instruction counts and picked a branch instruction that was heavily used. After fixing the microcode they started up the system again and noticed NO improvement in speed. Turns out the branch was used by the idle loop in the scheduler. All they did was make the CPU spin its wheels faster.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads