<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/12/47b8738b1718fa8a52906babb45145b3"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-12-04T19:05:53"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception"
  prev="2003/12/92046be84e93b5a2a47e897222bfded0"
  next="2003/12/40b7b8cc4d914e46aa8f243bcc25e3a6"
  prev-in-thread="2003/12/92046be84e93b5a2a47e897222bfded0"
  next-in-thread="2003/12/5254d2036a06aae11b77de14da9203fa"
  prev-thread="2003/12/a44b6979f8c7ec6786ef716ab40f43de"
  next-thread="2003/12/e4ffe98ad674659fd303b53d209bccd5"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Troubles with marshaled/unmarshaled exception">
<msg 
  url="2003/12/de1b3ad250df2edf7b41c396f72930ee"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-12-04T15:46:26"
  subject="[Caml-list] Troubles with marshaled/unmarshaled exception">
<msg 
  url="2003/12/28552e05a36f09840e6f5cd232399029"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-12-04T18:12:31"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
<msg 
  url="2003/12/92046be84e93b5a2a47e897222bfded0"
  from="Eric C. Cooper &lt;ecc@c...&gt;"
  author="Eric C. Cooper"
  date="2003-12-04T18:51:18"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
<msg 
  url="2003/12/47b8738b1718fa8a52906babb45145b3"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-12-04T19:05:53"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
<msg 
  url="2003/12/5254d2036a06aae11b77de14da9203fa"
  from="Eric C. Cooper &lt;ecc@c...&gt;"
  author="Eric C. Cooper"
  date="2003-12-04T19:50:42"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
</msg>
</msg>
</msg>
<msg 
  url="2003/12/40b7b8cc4d914e46aa8f243bcc25e3a6"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-12-04T19:14:23"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
</msg>
</msg>
<msg 
  url="2003/12/bee38859b007b41ffefe31e5b16980d4"
  from="Jason Hickey &lt;jyh@c...&gt;"
  author="Jason Hickey"
  date="2003-12-05T00:14:46"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
<msg 
  url="2003/12/8a58951f46d789bf2b5c03ab17428fcf"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-12-05T07:31:44"
  subject="Re: [Caml-list] Troubles with marshaled/unmarshaled exception">
</msg>
</msg>
</msg>
</thread>

<contents>
Eric C. Cooper wrote:
&gt; On Thu, Dec 04, 2003 at 07:11:51PM +0100, Alex Baretta wrote:

&gt; But something is indeed broken.  Here's a slight variant of the above:
&gt; 
&gt;         Objective Caml version 3.07+2
&gt; 
&gt; # let e = Failure "test";;
&gt; val e : exn = Failure "test"
&gt; # let e' = Failure "test";;
&gt; val e' : exn = Failure "test"
&gt; # let e'' =  Marshal.from_string (Marshal.to_string e []) 0;;
&gt; val e'' : 'a = &lt;poly&gt;
&gt; # e'' ^ "good-bye";;
&gt; Segmentation fault
&gt; 

There's nothing wrong here. Module Marshal is not type safe. If you use 
it incorrectly you cannot complain if your program segfaults. The value 
represented by e'' actually has type exn, however the compiler cannot 
know this because you are defining it through Marshal.from_xxxx, which 
is not type safe. This allows you to type-check e'' ^ "good-bye" which 
segfaults.

Alex

-------------------
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

</contents>

</message>

