Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Henri Dubois-Ferriere <henridf@lcavsun1.epfl.ch>
To: <caml-list@inria.fr>
Subject: [Caml-list] problem with marshal and bytecode threads
Date: Wed, 23 Oct 2002 18:12:08 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.33.0210231748001.530-100000@lcavpc19.epfl.ch> (raw)

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 = <unknown constructor>

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


                 reply	other threads:[~2002-10-23 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.33.0210231748001.530-100000@lcavpc19.epfl.ch \
    --to=henridf@lcavsun1.epfl.ch \
    --cc=caml-list@inria.fr \
    --cc=henri.dubois-ferriere@epfl.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox