From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA00806; Mon, 23 Dec 2002 11:35:05 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA00196 for ; Mon, 23 Dec 2002 11:35:04 +0100 (MET) Received: from mail.gmx.net (pop.gmx.de [213.165.65.60]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id gBNAZ3n15969 for ; Mon, 23 Dec 2002 11:35:03 +0100 (MET) Received: (qmail 15958 invoked by uid 0); 23 Dec 2002 10:35:02 -0000 Received: from unknown (HELO tema.sit) (195.5.26.27) by mail.gmx.net (mp007-rz3) with SMTP; 23 Dec 2002 10:35:02 -0000 Date: Mon, 23 Dec 2002 12:34:19 +0200 From: Artem Prisyznuk To: caml-list@inria.fr, caml-bugs@pauillac.inria.fr Subject: [Caml-list] "dangling" exception in native code. Message-Id: <20021223123419.6ca009a2.temofey@gmx.net> Reply-To: tema@sit.kiev.ua X-Mailer: Sylpheed version 0.8.7 (GTK+ 1.2.8; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, Next small example produce segfault for native code, but work ok in byte code. I use OCaml 3.06. I compile and run this example on Linux, Win98, and Cygwin systems, result is same. type s = { mutable exc : exn };; let run max = begin let rec loop n acc = if n > 0 then let s = { exc = Not_found } in let f () = s.exc <- Failure (string_of_int n); raise Not_found in loop ( n - 1 ) ( (s, f) :: acc ) else acc in print_endline "Make list"; flush_all (); let lst = loop max [] in print_endline "Iter 1"; flush_all (); List.iter (fun (s,f) -> try f () with Not_found -> () ) lst; print_endline "Iter 2"; flush_all (); List.iter (fun (s,_) -> ignore(Printexc.to_string s.exc) ) lst; print_endline "The End"; flush_all () end;; let _ = run 3000 ;; -- Best Regards, Artem Prisyanuk tema@sit.kiev.ua ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners