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 WAA09163; Wed, 15 Jan 2003 22:25:55 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA08748 for ; Wed, 15 Jan 2003 22:25:54 +0100 (MET) Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0FLPrr21619 for ; Wed, 15 Jan 2003 22:25:53 +0100 (MET) Received: from user-0cev2t6.cable.mindspring.com ([24.239.139.166] helo=minsky-primus.homeip.net) by gull.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 18Yv2j-0003Wl-00 for caml-list@inria.fr; Wed, 15 Jan 2003 13:25:49 -0800 Received: from 141.155.88.179 (SquirrelMail authenticated user yminsky) by minsky-primus.homeip.net with HTTP; Wed, 15 Jan 2003 16:25:49 -0500 (EST) Message-ID: <29027.141.155.88.179.1042665949.squirrel@minsky-primus.homeip.net> Date: Wed, 15 Jan 2003 16:25:49 -0500 (EST) Subject: [Caml-list] Size limit on marshalling? From: "Yaron M. Minsky" To: "Caml List " X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.8) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I've been getting some fairly inexplicable crashes on marshalling and unmarshalling values, and I'm wondering if anyone has an idea why. Here's a code snippet that will crash my copy of ocaml. First, I create a pointlessly large array, and then save it to disk: # let save_value fname value = let file = open_out_bin fname in output_value file value; close_out file;; val save_value : string -> 'a -> unit = # let ar = Array.init (10000 * 256) (fun i -> String.copy "fooobar doobar");; # save_value "/home/yminsky/foo.val" ar;; The resulting file is 38400025 bytes long. Note that the length appears to be critical. If you replace "fooobar doobar' with "foobar doobar", the problem goes away. At this point, I start a new session of ocaml and reload the value, and then ensure that it is garbage collected. That's when I get the segfault. # let ar = (get_value "foo.val" : string array);; # let ar = ();; # Gc.compact ();; And that's when I get the segfault. So, any thoughts? Is this a bug? Or just some unspoken limit of the compiler? This is a dummy example, but this is a real limit I'm running up against in my code. Yaron -- |--------/ Yaron M. Minsky \--------| |--------\ http://www.cs.cornell.edu/home/yminsky/ /--------| Open PGP --- KeyID B1FFD916 (new key as of Dec 4th) Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916 ------------------- 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