[net.bugs.4bsd] compatibility mode bus errors

emrath (12/01/82)

#N:uiucdcs:8200007:000:859
uiucdcs!emrath    Dec  1 00:54:00 1982

I'm curious to know if the following glitch is in the vax780 or unix.
If you get a bus error while in compatibility (pdp-11) mode, the pc
passed on the stack to the trap handler points at the instruction that
caused the trap. This is true even if the trap occurs on the destination
address of a 2 or 3 word instruction. This is not really a problem, however-

If you do an "rei" instruction with the pc=1 and the compatibility mode bit
set in the new psl, the trap handler is given -1 (32 bits) as the pc.
In fact, the stacked pc is always 2 less than the pc used in the rei.
In my case, the trap handler tried to fetch the instruction (erroneously)
for debug purposes, but using the pc of -1 results in a segmentation fault.

Naturally, I had to track down that segmentation fault.
But I had to give up looking for the system source that handles this stuff.