-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
When I write a parallel sorting program, I found that the following code causes segmentation fault both on my mac and linux.
fun copy a b e d j =
if e < b then ()
else let val v = Array.sub (Array.sub (a, 0), b)
in Array.update (Array.sub (d, 0), j, v);
copy a (b+1) e d (j+1)
end
fun sort a b e =
if e <= b then () else
let val q = Int.quot (b + e, 2)
in sort a b q;
sort a (q+1) e;
copy a b e a b
end
val a = Array.array (1, Array.array (1024, 0))
val _ = sort a 0 1023I checked out the repository and compiled the compiler as follows:
git clone https://github.com/ManticoreProject/manticore.git
git checkout 757fbcc4d # to make clear which revision I used
autoconf -Iconfig
autoheader -Iconfig
./configure --prefix=$PWD/dest
mkdir -p dest/bin dest/lib
make installI saved the above code in bug.pml and executed it as follows:
$ dest/bin/pmlc -o bug bug.pml
$ ./bug
Segmentation fault
Metadata
Metadata
Assignees
Labels
No labels