NL crash on Matrix op

Q&A's, tips, howto's
Locked
hds1
Posts: 28
Joined: Thu Mar 20, 2014 5:02 pm

NL crash on Matrix op

Post by hds1 »

Hi,

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

Code: Select all

>(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.

Code: Select all

> (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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: NL crash on Matrix op

Post by Lutz »

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:

Code: Select all

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: NL crash on Matrix op

Post by Lutz »

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/develo ... nprogress/

hds1
Posts: 28
Joined: Thu Mar 20, 2014 5:02 pm

Re: NL crash on Matrix op

Post by hds1 »

great. thanks.

Regards
Heiko

Locked