NL crash on Matrix op

Started by hds1, February 11, 2015, 06:01:04 AM

Previous topic - Next topic

hds1

Hi,



just stumbled upon crashes of newlisp 10.6.2 on not possible Matrix ops.

>(set 'A '((1 2 3) (4 5 6)))
>(det A 1e-10)

--> Speicherzugriffsfehler (Speicherabzug geschrieben)

(Memory acces error) and NL crashes. Happens with or without pivot and also on (mat ...) ops.

> (set 'B '((-1 1 1) (1 4 -5) (1 -2 0)))
> (set 'A '((1 2 3) (4 5 6)))
> (mat + B A)

--> same error as above.

I would expect NL not to crash but throw an error signal if Matrix dimensions are wrong.



If it is intended behaviour could you pls put a note in the docs that the user has to check proper dimensions before any Matrix op ?

Or do i miss something basic here .... ?



Heiko

Kernel 3.13.0-45-generic, Kubuntu 14.04 64bit, newLISP v.10.6.2 64-bit on Linux IPv4/6 UTF-8 libffi.

Compiled from tgz.

Lutz

#1
This seems to be limited to the UBUNTU version only. On my UBUNTU 14.04 64-bit the first example also crashes. But other OS are ok:



newLISP v.10.6.2 64-bit on OSX IPv4/6 UTF-8 libffi, options: newlisp -h

> (set 'A '((1 2 3) (4 5 6)))
((1 2 3) (4 5 6))
> (det A 1e-10)

ERR: wrong dimensions in function det : A
> (set 'B '((-1 1 1) (1 4 -5) (1 -2 0)))
((-1 1 1) (1 4 -5) (1 -2 0))
> (set 'A '((1 2 3) (4 5 6)))
((1 2 3) (4 5 6))
> (mat + B A)

ERR: wrong dimensions in function mat
>


it also works fine on FreeBSD and Windows. Will investigate for UBUNTU.

Lutz

#2
The problem is fixed for 10.6.3 and both examples run now fine on UBUNTU Linux 14.04 64-bit.



Changes also tested on OSX 64-bit, OpenBSD 64-bit, FreeBSD 64-bit and Windows 32-bit.



http://www.newlisp.org/downloads/development/inprogress/">http://www.newlisp.org/downloads/develo ... nprogress/">http://www.newlisp.org/downloads/development/inprogress/

hds1

#3
great. thanks.



Regards

Heiko