newLISP Fan Club

Forum => newLISP newS => Topic started by: kesha on April 25, 2016, 03:38:10 AM

Title: segmentation fault
Post by: kesha on April 25, 2016, 03:38:10 AM
OS: GNU/Linux Gentoo x86_64 and Gentoo x86

gcc: 4.9.3

newLISP v.10.7.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h
> (unpack "c" 1)
segmentation fault


newLISP v.10.7.1 32-bit on Linux IPv4/6 UTF-8, options: newlisp -h
> (unpack "c" 1)
segmentation fault

Oops...
Title: Re: segmentation fault
Post by: Lutz on April 25, 2016, 10:18:57 AM
The second parameter of unpack must contain a valid memory addrees or a segfault can occur. This is mentioned in the documentation:

http://www.newlisp.org/downloads/newlisp_manual.html#unpack

... in the second paragraph.
Title: Re: segmentation fault
Post by: kesha on April 25, 2016, 01:46:15 PM
I don't think this is the correct behaviour.

The program falls, without the possibility to fix something.
Title: Re: segmentation fault
Post by: Lutz on April 26, 2016, 11:26:12 PM
A segfault may leave a process in an unknown, potentially unsafe, state and the process should exit.