Version française
Home     About     Download     Resources     Contact us    
Browse thread
segfault in 3.10
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: micha <micha-1@f...>
Subject: segfault in 3.10
I get a segfault when compiling the program below with ocamlopt 3.10 on
linux (athlon xp) and running it without an argument (it should throw
an exception). The code below is the smallest part of my program
, without much sense now :-) which produces the segfault; changing
something gives you the normal exception:
  Fatal error: exception Invalid_argument("index out of bounds")

for accessing a non existing array field.

I comiled it with ocamlopt -o seg seg.ml

Is this on my system only or can someone reproduce this?

thanks
 Michael

---------------------------------
open Printf;;
module ISet = Set.Make (struct type t=int let compare = (-) end);;

let gen_hash keys maxlen = (fun i -> 0);;

let test_hash hash keys =
        let set = Queue.fold(fun set k -> ISet.remove 0 set)
(ISet.empty) keys in () ;;

let _ =
        printf "%s keys...\n" Sys.argv.(1);
        let k = Queue.create() in
        let h = gen_hash k 20 in
        print_endline "ready";
        test_hash h k