Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4 29. (7 Jan 2003) Array subscript out of bounds crashes popl

v15.53
closed-fixed
5
2004-01-14
2004-01-14
Jeffrey T Best
No

Bug reported by Luc Beaudoin

Many thanks to
Chris Glur

and
Waldek Hebisch

for pin-pointing the problem in $popsrc/aarith.s

Recapitulation: Luc Beaudoin pointed out that on PC
linux Poplog array
out of bounds errors caused poplog to crash. (It turns
out that I had
reported the same problem in March 1991!)

This should produce a mishap (INVALID ARRAY SUBSCRIPT)
and then continue
newarray([1 10])(11) =>

It worked on Solaris and Alpha Unix poplog, but crashed
poplog on
PC+linux poplog and also on PC+Windows poplog

In an earlier message I traced the problem to
$popsrc/aarith.s

but did not know what exactly to look for.

Chris located the suspect code and Waldek's answer told
me exactly what
to do to fix that file:

> Date: 7 Jan 2003 16:19:42 GMT
> Organization: Politechnika Wroclawska
>
> : when there are no subscript errors, _array_sub
exits via the
> : jmp *_PD_EXECUTE(%eax)
> : ELSE it gets to:
> : subl , %USP ;;; reveal the last
index again
> : call XC_LAB(weakref Sys$-Array$-Sub_error)
> ^^^^

Waldek wrote:
> jmp works OK
> <snip>

To rebuild your PC+Linux poplog system, do the
following (for which you
may need root privileges if your system was installed
as root):

cd $popsrc
edit aarith.s
Change
call XC_LAB(weakref Sys$-Array$-Sub_error)
to
jmp XC_LAB(weakref Sys$-Array$-Sub_error)

Discussion

  • Jeffrey T Best
    Jeffrey T Best
    2004-01-14

    • status: open --> open-fixed
     
  • Jeffrey T Best
    Jeffrey T Best
    2004-01-14

    • status: open-fixed --> closed-fixed