[clean-list] segmentation fault

John van Groningen johnvg at cs.ru.nl
Mon Aug 27 13:54:46 MEST 2007


lethevert wrote:
>The following program leads to a segmentation fault.
>
>==== ListModl.dcl ====
>definition module ListModl
>import _SystemStrictLists
>
>map :: !(u:a -> v:b) w:(l u:a) -> w:(l v:b) | List l a & List l b, [w <= u,w <= v]
>
>==== ListModl.icl ====
>implementation module ListModl
>import ListModl
>
>map :: !(u:a -> v:b) w:(l u:a) -> w:(l v:b) | List l a & List l b, [w <= u,w <= v]
>map f [|] = [|]
>map f [|a:aa] = [|f a: map f aa]
>
>==== Main.icl ====
>module Main
>import ListModl, StdInt
>
>Start = map ((+) 1) [1,2,3,4,5]
>
>==================
>
>But the error will be disappeared if I add specialized functions.
>
>map :: !(u:a -> v:b) w:(l u:a) -> w:(l v:b) | List l a & List l b, [w <= u,w <= v]
>  special l = []; l = [!]; l = [ !]; l = [!!]

I had discovered this too when looking at the Zip/Unzip problem reported by
Shivkumar Chandrasekaran.

See my reply to him on the clean-list for more information.

You can fix this by updating _system.abc file (for 32 bit systems)

http://clean.cs.ru.nl/download/Clean22/source/_system.abc

or: (for 64 bit systems)

http://clean.cs.ru.nl/download/Clean22/source/64/_system.abc

in Libraries/StdEnv/Clean System Files or lib/stdenv/Clean System Files (linux).

On linux the file
lib/stdenv/Clean System Files/_system.o
should be removed after updating _system.abc. A new one can be generated with
clm -O _system
The CleanIDE seems to automatically regenerate _system.o when _system.abc
is modified.

>I found the error both in Windows and in Linux.

All versions of Clean 2.2 have this error (older versions don't have this
error as far as I know).

Kind regards,

John van Groningen


More information about the clean-list mailing list