caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* segfault in 3.10
@ 2007-06-28 21:38 micha
  2007-06-28 22:35 ` [Caml-list] " Olivier Andrieu
  2007-06-29  0:22 ` Jon Harrop
  0 siblings, 2 replies; 3+ messages in thread
From: micha @ 2007-06-28 21:38 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-29  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-28 21:38 segfault in 3.10 micha
2007-06-28 22:35 ` [Caml-list] " Olivier Andrieu
2007-06-29  0:22 ` Jon Harrop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).