<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks for the patch, Christopher.  I’ve incorporated it in the trunk and am cc’ing the unison-hackers list so that people know that there may be other issues lurking with the 4.02 OCaml update.<div><br></div><div>    - Benjamin<br><div><br><div><blockquote type="cite">From: Christopher Zimmermann <<a href="mailto:chrisz@openbsd.org">chrisz@openbsd.org</a>><br>Subject: Unison Uprintf obsolete<br>Date: Fri, 19 Sep 2014 16:36:49 +0200<br><br>Hello,<br><br>I am porting OCaml stuff for OpenBSD. We updated to OCaml 4.02 some<br>weeks ago. Since the upgrade the stable unison port is segfaulting in<br>different places. One place is the Uprintf module, whose use of<br>Obj.magic is no longer safe. Since its only use is in ubase/util.ml<br>and its additional functionality is provided by the OCaml stdlib<br>since 3.09 I propose the following diff:<br><br>--- ubase/util.ml.orig<span class="Apple-tab-span" style="white-space:pre">    </span>Fri Sep 19 12:38:42 2014<br>+++ ubase/util.ml<span class="Apple-tab-span" style="white-space:pre"> </span>Fri Sep 19 12:39:27 2014<br>@@ -62,7 +62,8 @@<br>   if s <> !infos then begin clear_infos (); infos := s; show_infos ()<br>end <br> let msg f =<br>-  clear_infos (); Uprintf.eprintf (fun () -> flush stderr; show_infos()) f<br>+  clear_infos ();<br>+  Printf.kfprintf (fun _ -> flush stderr; show_infos ()) stderr f<br><br> let msg : ('a, out_channel, unit) format -> 'a = msg<br><br><br>with this diff the Uprintf module can be removed.<br><br><br>Regards, <br>Christopher<br><br><br>-- <br><a href="http://gmerlin.de">http://gmerlin.de</a><br>OpenPGP: http://gmerlin.de/christopher.pub<br>F190 D013 8F01 AA53 E080  3F3C F17F B0A1 D44E 4FEE<br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>From: </b></span><span style="font-family:'Helvetica';">Christopher Zimmermann <chrisz@openbsd.org><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Subject: </b></span><span style="font-family:'Helvetica';"><b>Unison Uprintf obsolete</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>Date: </b></span><span style="font-family:'Helvetica';">September 19, 2014 at 10:36:49 AM EDT<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(127, 127, 127, 1.0);"><b>To: </b></span><span style="font-family:'Helvetica';">unison-hackers@lists.seas.upenn.edu<br></span></div><br><br>Hello,<br><br>I am porting OCaml stuff for OpenBSD. We updated to OCaml 4.02 some<br>weeks ago. Since the upgrade the stable unison port is segfaulting in<br>different places. One place is the Uprintf module, whose use of<br>Obj.magic is no longer safe. Since its only use is in ubase/util.ml<br>and its additional functionality is provided by the OCaml stdlib<br>since 3.09 I propose the following diff:<br><br>--- ubase/util.ml.orig<span class="Apple-tab-span" style="white-space:pre">   </span>Fri Sep 19 12:38:42 2014<br>+++ ubase/util.ml<span class="Apple-tab-span" style="white-space:pre"> </span>Fri Sep 19 12:39:27 2014<br>@@ -62,7 +62,8 @@<br>   if s <> !infos then begin clear_infos (); infos := s; show_infos ()<br>end <br> let msg f =<br>-  clear_infos (); Uprintf.eprintf (fun () -> flush stderr; show_infos<br>()) f<br>+  clear_infos ();<br>+  Printf.kfprintf (fun _ -> flush stderr; show_infos ()) stderr f<br><br> let msg : ('a, out_channel, unit) format -> 'a = msg<br><br><br>with this diff the Uprintf module can be removed.<br><br><br>Regards, <br>Christopher<br><br><br>-- <br>http://gmerlin.de<br>OpenPGP: http://gmerlin.de/christopher.pub<br>F190 D013 8F01 AA53 E080  3F3C F17F B0A1 D44E 4FEE<br><br><br></blockquote></div><br></div></div></body></html>