segmentation fault

Notices and updates
Post Reply
kesha
Posts: 7
Joined: Tue Dec 04, 2012 9:11 pm

segmentation fault

Post by kesha »

OS: GNU/Linux Gentoo x86_64 and Gentoo x86
gcc: 4.9.3

Code: Select all

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

Code: Select all

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

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: segmentation fault

Post by Lutz »

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/newlis ... tml#unpack
... in the second paragraph.

kesha
Posts: 7
Joined: Tue Dec 04, 2012 9:11 pm

Re: segmentation fault

Post by kesha »

I don't think this is the correct behaviour.
The program falls, without the possibility to fix something.

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: segmentation fault

Post by Lutz »

A segfault may leave a process in an unknown, potentially unsafe, state and the process should exit.

Post Reply