caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Mentre <David.Mentre@inria.fr>
To: Brian Rogoff <bpr@best.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Segfault in a native code multi-threaded program
Date: 20 Aug 2001 11:12:52 +0200	[thread overview]
Message-ID: <qtlofpb3xij.fsf@pochi.inria.fr> (raw)
In-Reply-To: <Pine.BSF.4.21.0108170940130.18517-100000@shell5.ba.best.com>

Brian Rogoff <bpr@best.com> writes:

> > > <hint for next ocaml ;)> > 
> >   It would be very nice to be able to rely on Marshal as safely as on
[...]
> > </hint for next ocaml ;)>
> 
> A more type safe marshaling framework is way up there on my list of
> desired enhancements. I think this will be part of the extensional
> polymorphism enhancements that you can see now in G'Caml. 

In my opinion, they are two different kinds of marshaling that one could
expect: the safe one and the correct one.

Supose that I have :

 type t = A | B of int | C of float

To be safe is just to ensure that if I marshal a B(3), then if I receive
a B(2.6) it will raise an exception. In other words, the marshaled data
structure should contain enough information to ensure that once
unmarshaled, it won't trigger a segfault. That's all. Basically, it
means to encode in some way the type constructor of sent data structure
(in my example, something like (type t: first: nothing; second: int;
third: float)), and to check those constructors at unmarshaling time.

The correct encoding is of course to ensure that the A of my program is
the same A of the .mli you are using to send to me a data structure. It
is of course much more difficult.

I have probably missed something on the difficulty of marshaling. I
tried to look at the mailing list archive, but did not find out the
relevant messages. Any pointer?

Best regards,
d.
-- 
 David.Mentre@inria.fr
 Opinions expressed here are only mine.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-08-20  9:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-16  8:08 David Mentre
2001-08-16 12:45 ` Vitaly Lugovsky
2001-08-17  8:09   ` David Mentre
2001-08-17 16:54     ` Brian Rogoff
2001-08-20  9:12       ` David Mentre [this message]
2001-08-20 16:54       ` Jun P. FURUSE
2001-08-18 23:15     ` John Max Skaller
2001-08-19  0:24       ` John Gerard Malecki
2001-08-19 18:18         ` [Caml-list] Ocaml ffi release 1.2.2 dsfox
     [not found] ` <3B7C5A74.15141D95@maxtal.com.au>
     [not found]   ` <qtlitfm6ajh.fsf@pochi.inria.fr>
     [not found]     ` <3B7F0C99.FEDEAA86@maxtal.com.au>
     [not found]       ` <qtl3d6m4vkt.fsf@pochi.inria.fr>
2001-08-21 19:20         ` [Caml-list] Segfault in a native code program using pm variants John Max Skaller
2001-08-23  8:54           ` Xavier Leroy
2001-08-20 12:57 [Caml-list] Segfault in a native code multi-threaded program Krishnaswami, Neel

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=qtlofpb3xij.fsf@pochi.inria.fr \
    --to=david.mentre@inria.fr \
    --cc=bpr@best.com \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).