From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id B334680043 for ; Tue, 18 Oct 2016 14:47:35 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=andre@digirati.com.br; spf=Pass smtp.mailfrom=andre@digirati.com.br; spf=Pass smtp.helo=postmaster@mta113.f1.k8.com.br Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of andre@digirati.com.br) identity=pra; client-ip=187.73.32.185; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="andre@digirati.com.br"; x-sender="andre@digirati.com.br"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of andre@digirati.com.br designates 187.73.32.185 as permitted sender) identity=mailfrom; client-ip=187.73.32.185; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="andre@digirati.com.br"; x-sender="andre@digirati.com.br"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@mta113.f1.k8.com.br designates 187.73.32.185 as permitted sender) identity=helo; client-ip=187.73.32.185; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="andre@digirati.com.br"; x-sender="postmaster@mta113.f1.k8.com.br"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AqHALQBHsVVKlOslr/yxZRZ1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ75pM6wAkXT6L1XgUPTWs2DsrQf2rCQ7vyrBDRIyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBy?= =?us-ascii?q?brysXNWD1YLqi6vvo9X6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu?= =?us-ascii?q?5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MdFVeD+fr8kZb1eFjUvdW4vt+PxshyW?= =?us-ascii?q?ZA2D/HZUdGwKkhNOS1zM6h3gU7/9syT7rONh2W+ROsiwR6piCmfq1LtiVBK90H?= =?us-ascii?q?RPDDU+6myC0sE=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0ChAAAqGQZYh7kgSbtcHAEBFgEBCwEBB?= =?us-ascii?q?hgHBoJ+AQEBAQGBHlK4coIIiCI4FAEBAQEBAQEBAQEBEgEBAQoLCQkZL4IyGIJ?= =?us-ascii?q?BBBkBAThcAiILAgE8CAEBiFC1E2eESQEBBYg7BgmIOodrggALLYJbmguBOoIGg?= =?us-ascii?q?XiKZk2IcBKBAYULkHkCHnoGCIIsAQEIAQEBAQFUgXZaiFYBAQE?= X-IPAS-Result: =?us-ascii?q?A0ChAAAqGQZYh7kgSbtcHAEBFgEBCwEBBhgHBoJ+AQEBAQG?= =?us-ascii?q?BHlK4coIIiCI4FAEBAQEBAQEBAQEBEgEBAQoLCQkZL4IyGIJBBBkBAThcAiILA?= =?us-ascii?q?gE8CAEBiFC1E2eESQEBBYg7BgmIOodrggALLYJbmguBOoIGgXiKZk2IcBKBAYU?= =?us-ascii?q?LkHkCHnoGCIIsAQEIAQEBAQFUgXZaiFYBAQE?= X-IronPort-AV: E=Sophos;i="5.31,361,1473112800"; d="asc'?scan'208";a="197223360" Received: from mta113.f1.k8.com.br ([187.73.32.185]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2016 14:47:33 +0200 Received: from localhost (localhost [127.0.0.1]) by smtpz.f1.k8.com.br (Postfix) with ESMTP id 3069C80197 for ; Tue, 18 Oct 2016 12:47:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpz.f1.k8.com.br ([127.0.0.1]) by localhost (mta113.f1.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EI9-CVanOxsn for ; Tue, 18 Oct 2016 12:47:27 +0000 (UTC) Received: from [10.200.12.21] (unknown [201.76.188.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtpz.f1.k8.com.br (Postfix) with ESMTPSA id 92ECD80041 for ; Tue, 18 Oct 2016 12:47:27 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 smtpz.f1.k8.com.br 92ECD80041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digirati.com.br; s=default; t=1476794847; bh=QquhybOYIyLSFaguric1CiqegIBuuxVB29oxCDLEhb4=; h=To:From:Subject:Date; b=FTmxippfi5NvbN5ImUllt4CGQiLUhUbLpL7F6fpLU6Ha4TtZYTyemhr0xroKjFyKA 5thWUjtH1ZFuKWUuMRkjqBGiLYiCkypFrR6f0PwVMJ7dvXLP8TsqhWYLKCr0dGQBE+ xbbaLLiWxnTd9Tr+lwu/lm3glMiyfZvf6AevE4nE= To: caml-list@inria.fr From: Andre Nathan Message-ID: Date: Tue, 18 Oct 2016 10:47:20 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OKXgT0fd7SUAQF26qFBXMU3M54NDCUk9a" Subject: [Caml-list] Segfault with open GADTs This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OKXgT0fd7SUAQF26qFBXMU3M54NDCUk9a Content-Type: multipart/mixed; boundary="TwLWkfga98HElF4fpQv5STkR5DhPMUnSS"; protected-headers="v1" From: Andre Nathan To: caml-list@inria.fr Message-ID: Subject: Segfault with open GADTs --TwLWkfga98HElF4fpQv5STkR5DhPMUnSS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi I'm trying to use extensible variants to allow users to extend a type from my library, which is a GADT, but it's resulting in a segfault when the program is executed. I've managed to reproduce the issue with this code: module M0 =3D struct type 'a t =3D .. type 'a t +=3D | I : int -> int t | S : string -> string t | P : 'a t * 'b t -> ('a * 'b) t let rec to_string : type a. a t -> string =3D function | I i -> "I:" ^ string_of_int i | S s -> "S:" ^ s | P (x, y) -> to_string x ^ to_string y end module M1 =3D struct include M0 type 'a t +=3D T : 'a t -> 'a t let to_string =3D function | T t -> to_string t | x -> to_string x end let () =3D print_endline @@ M1.to_string (M1.P (M1.T (M1.I 42), M1.S "foo")) Is this sort of thing supposed to work? Thanks, Andre --TwLWkfga98HElF4fpQv5STkR5DhPMUnSS-- --OKXgT0fd7SUAQF26qFBXMU3M54NDCUk9a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJYBhnZAAoJED4JW1qwFY2cWG8IAK9gAXIr4lEMnWwmDtcsmBNX rVLpjPBswPoIRN9zCnldzPuvdXoP4cjjsEBKCAnfq24vk1heOB54BwpOJxnSCKiH Cq9dsHfrf0+lDf3Ale4wiLDkxqLCzWfr+I+e+r6WnH7eTS+dPi4FzcquKMYJ0qsY iF3QgaWdZSSwt2qFIZjjaI7GJkly5DpiLYauIPyl1QYhfyaKbrKKlckRG0+GspFi THEmG8sLmB5j/hbK/YlHJ909KpYwyFxOKzvod+edWJwXO59BdicFqqrP6g5xnByf 8rr762T7ezOE7Uyu/4zQSUkaHqM35oj9PsKycPEJrNagcIEmHyCtAQMZpnld90w= =N92H -----END PGP SIGNATURE----- --OKXgT0fd7SUAQF26qFBXMU3M54NDCUk9a--