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 SAA30220; Wed, 23 Oct 2002 18:12:10 +0200 (MET DST) 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 SAA31027 for ; Wed, 23 Oct 2002 18:12:09 +0200 (MET DST) Received: from lcavpc19.epfl.ch (lcavpc19.epfl.ch [128.178.8.56]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9NGC8520036 for ; Wed, 23 Oct 2002 18:12:08 +0200 (MET DST) Received: from localhost (henridf@localhost) by lcavpc19.epfl.ch (8.11.6/8.11.6) with ESMTP id g9NGC8B00772 for ; Wed, 23 Oct 2002 18:12:08 +0200 X-Authentication-Warning: lcavpc19.epfl.ch: henridf owned process doing -bs Date: Wed, 23 Oct 2002 18:12:08 +0200 (CEST) From: Henri Dubois-Ferriere X-X-Sender: Reply-To: Henri DF To: Subject: [Caml-list] problem with marshal and bytecode threads Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, After some headbanging, I realized that the out_of_memory exception I was getting on a Marshal.from_channel was only happening when running a thread-enabled bytecode executable. I then tried making a simplified reproducible example, and though I couldn't get the out_of_memory exception, I did see some weird behavior: testthread.ml: type mytype = T of (float * float) let fd = open_out_bin "/tmp/file.mld" let myval = T (1.0, 1.0) Marshal.to_channel fd myval [] close_out fd let fd = open_in_bin "/tmp/file.mld" let myval = (Marshal.from_channel fd: mytype) match myval with T bla -> bla running this snippet in a thread-enabled toplevel makes it segfault. (the toplevel is made as such: %ocamlmktop -thread /usr/lib/ocaml/threads/unix.cma /usr/lib/ocaml/threads/threads.cma -o ocaml-th) In fact, entering the code line-by-line in the toplevel shows that the type of myval is not recognized: # let myval = (Marshal.from_channel fd : mytype) val myval : mytype = I haven't filed a bug because I doubt such an obvious one would have gone by unnoticed, which leaves the more likely option that I missed something in the docs/list archives/bug database... any clues anyone? Thanks Henri ------------------- 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