PDP-11 C compiler bug
utzoo!decvax!ucbvax!menlo70!sri-unix!gwyn at UTEXAS-11
utzoo!decvax!ucbvax!menlo70!sri-unix!gwyn at UTEXAS-11
Fri Jan 1 20:10:45 AEST 1982
The following problem exists at least for a 7th Ed. C system on a 6th Ed.
kernel: When a large (greater than 8Kb) floating-point array is allocated
local to a block, that is, off the stack, and a reference is made to a f.p.
variable allocated after the array, an unrecoverable segmentation violation
occurs. I believe this is due to a "hole" in the allocated segmentation
registers and a problem in the kernel when trying to grow the stack by more
than 8Kb at once when the faulting instruction is floating-point.
I fixed this by modifying the generated code slightly: After entry to the
procedure in question, there is code to extend the stack by updating the
stack pointer to point to top of local variable pool. Just after this, I
generated "tst (sp)" if and only if (a) floating-point is used in the
procedure, and (b) the stack wasn't grown by "tst -(sp)" instructions, which
keep have already gotten the mapping registers set up to cover the stack.
-------
More information about the Comp.unix.wizards
mailing list