[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]
A somewhat nasty bug has turned up in the implementation of arrays
in linux poplog.
The following commands should all produce an error due to use of an
array index that is out of bounds:
newarray([1 10 1 10])(11, 11) =>
newsarray([1 10 1 10])(11, 11) =>
defclass sfloatvec :sfloat;
newanyarray([1 10 1 10], sfloatvec_key)(11, 11) =>
On Solaris/Sparc poplog all of the above produce the expected
mishap message:
;;; MISHAP - INVALID ARRAY SUBSCRIPT
;;; INVOLVING: 11
;;; DOING : sys_exception_final sys_exception_handler
;;; sys_raise_exception(array-subscr:type-intrange) etc.
Also on Digital Alpha Unix Poplog.
However on Linux+PC Poplog it gets as far as printing this:
;;; MISHAP - INVALID ARRAY SUBSCRIPT
;;; INVOLVING: 11
;;; FILE : /home/staff/axs/news/linux.arraybug LINE NUMBER: 13
;;; DOING : sys_exception_final sys_exception_handler
;;; sys_raise_exception(array-subscr:type-intrang
Then there's a long pause, with everything frozen, then
Segmentation fault (core dumped)
and a 12 Mbyte core dump is created.
As far as I can see that error message is produced by the procedure
Sub_error defined in $popsrc/errors.p
That is invoked in the assembler file
$popsrc/aarith.s
which includes a definition of the subroutine _array_sub
So it it looks as if there may either be something wrong with the
general mechanism for returning from a pop procedure to an assembler
sub-routine in linux poplog, or something wrong with the specific code
for handling the array subscript error in the aarith.s file for
linux+PC.
Any offers of a fix?
I have no experience of programming at that level.
In the mean time anyone using arrays in linux poplog needs to be doubly
sure not to let array subscripts get out of range.
Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk (ReadATas@please !)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html
|