From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 618A3BC6B for ; Thu, 28 Jun 2007 23:38:32 +0200 (CEST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l5SLcV0P011907 for ; Thu, 28 Jun 2007 23:38:32 +0200 Received: (qmail invoked by alias); 28 Jun 2007 21:38:31 -0000 Received: from Ze437.z.pppool.de (EHLO hmmm.de) [89.61.228.55] by mail.gmx.net (mp027) with SMTP; 28 Jun 2007 23:38:31 +0200 X-Authenticated: #20477425 X-Provags-ID: V01U2FsdGVkX18IXmoXYvsIvkN3dPXmal8fhby9pH30YmdtRFvUdH dL9DBw/F0j0aX5 Date: Thu, 28 Jun 2007 23:38:30 +0200 From: micha To: caml-list@yquem.inria.fr Subject: segfault in 3.10 Message-ID: <20070628233830.7d49539d@hmmm.de> X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 46842A57.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; segfault:01 segfault:01 ocamlopt:01 ocamlopt:01 printf:01 struct:01 hash:01 maxlen:01 hash:01 printf:01 argv:01 endline:01 exception:01 exception:01 int:01 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