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 2EDFE7EEBF for ; Sat, 8 Aug 2015 13:28:40 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bobzhang1988@gmail.com) identity=pra; client-ip=209.85.160.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of bobzhang1988@gmail.com designates 209.85.160.171 as permitted sender) identity=mailfrom; client-ip=209.85.160.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yk0-f171.google.com) identity=helo; client-ip=209.85.160.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="postmaster@mail-yk0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D2AQAd58VVlKugVdFbg29aDwaDHqofkXmFeQKBIwdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBAQMBEhEdARsdAQMBCwYFCw0qAgIhAQERAQUBHAYTIod2AQMKCA2pWoEuPjGLP4FsgnmLEwoZJw1XhFUBAQEBAQEEAQEBAQEBAQEUAQUOi0OCT4I2BAeCaYFDBYcahmaHBAeFAoV1gWyBSUaQOwqDQ4IaEiOBFxeCHRyBbyIxgkwBAQE X-IPAS-Result: A0D2AQAd58VVlKugVdFbg29aDwaDHqofkXmFeQKBIwdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBAQMBEhEdARsdAQMBCwYFCw0qAgIhAQERAQUBHAYTIod2AQMKCA2pWoEuPjGLP4FsgnmLEwoZJw1XhFUBAQEBAQEEAQEBAQEBAQEUAQUOi0OCT4I2BAeCaYFDBYcahmaHBAeFAoV1gWyBSUaQOwqDQ4IaEiOBFxeCHRyBbyIxgkwBAQE X-IronPort-AV: E=Sophos;i="5.15,633,1432591200"; d="scan'208";a="142323106" Received: from mail-yk0-f171.google.com ([209.85.160.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 08 Aug 2015 13:28:38 +0200 Received: by ykcq64 with SMTP id q64so102399739ykc.2; Sat, 08 Aug 2015 04:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=udvlr7YbXhSaOoXZ0EXx0FouMp7FLcjmJlyMVX7tfJ0=; b=OocWzx6pYzZqrU6okGduxMqi9k/cjtoMLwkAGgFPy+BmNYI+5Om5nPNvRGqvLNpzsf 7+IBnCl2xpGmH2BcdPJlmDdRmdltw8wd4FgxboC4NMeuORmaQXNo9SX3K3Am4XeqQSW7 e3tOsidgdNmKqpl9gGsi/7Pum9Wm2XsAxfSV4AdNtoSxRiDeMKgA2yqDsZ3j482N9xGm 9B5L2HtKuEC9J03bW+Agincze5sjcxjZN1SQteBn5h/N8nyMoFmN0X+ReRFuNsIdur5M TST/b1tN0oLfUk+7k16sT79a2i7pqxP+ZqDk5EbpVc/dJ17L4AavjRAQ/ITgtILp42k5 IX8A== MIME-Version: 1.0 X-Received: by 10.170.150.7 with SMTP id r7mr12525953ykc.48.1439033317405; Sat, 08 Aug 2015 04:28:37 -0700 (PDT) Received: by 10.37.56.140 with HTTP; Sat, 8 Aug 2015 04:28:37 -0700 (PDT) In-Reply-To: References: Date: Sat, 8 Aug 2015 07:28:37 -0400 Message-ID: From: Bob Zhang To: Gabriel Scherer Cc: Caml List , Xavier Leroy Content-Type: multipart/alternative; boundary=001a1139c0d2b43d1c051ccb0d64 Subject: Re: [Caml-list] Questions about changing lambda IR --001a1139c0d2b43d1c051ccb0d64 Content-Type: text/plain; charset=UTF-8 Before I changed Lambda.lambda, and it works, it might be that we serialized structured_constant somewhere in the bootstrapping process? On Sat, Aug 8, 2015 at 7:25 AM, Bob Zhang wrote: > It does not work for me. Since it fails to compile, I pushed it to another > branch https://github.com/bobzhang/ocaml/tree/fails (sorry for the > misinformation) > > I did `git clean -fxd` and try configure, make world, it failed in the > same place. > Thank you for your time! > > On Sat, Aug 8, 2015 at 3:37 AM, Gabriel Scherer > wrote: > >> You need to run "make bootstrap" to avoid having part of the definition >> compiled against the stale definition of lambda.cmi. (I just checked that >> it works on your change: after a bootrsap, "make world", "make opt", "make >> opt.opt" work.) >> >> On Sat, Aug 8, 2015 at 5:50 AM, Bob Zhang wrote: >> >>> >>> Dear caml develpers, >>> >>> I am working on an experimental branch to pass more information from >>> typedtree to lambda to enable ocaml generate user readable javascript code( >>> https://github.com/bobzhang/ocaml/tree/master) (online-demo: >>> http://zhanghongbo.me/js-demo/) >>> >>> Here I get a segfault, after I change const_block: >>> Below is my minimal change: >>> >>> ``` >>> type pointer_info = >>> | NullConstructor of string >>> | NullVariant of string >>> | NAPointer >>> >>> type tag_info = >>> | Constructor of string >>> | Tuple >>> | Variant of string >>> | Record >>> | NA >>> >>> type structured_constant = >>> Const_base of constant >>> | Const_pointer of int * pointer_info >>> | Const_block of int * tag_info * structured_constant list >>> | Const_float_array of string list >>> | Const_immstring of string >>> ``` >>> Note that the enriched info is not used in ``emitcode``, now I get a >>> segfault in make world: >>> >>> ``` >>> ../../boot/ocamlrun ../../ocamlc -nostdlib -I ../../stdlib -c -w +33..39 >>> -warn-error A -bin-annot -g -safe-string -I ../../stdlib -I ../../utils -I >>> ../../typing -I ../../bytecomp -I ../../asmcomp extract_crc.ml >>> ../../boot/ocamlrun ../../ocamlc -nostdlib -I ../../stdlib -o >>> extract_crc dynlink.cma extract_crc.cmo >>> make[3]: *** [extract_crc] Segmentation fault: 11 >>> make[3]: *** Deleting file `extract_crc' >>> make[2]: *** [otherlibraries] Error 2 >>> make[1]: *** [all] Error 2 >>> ``` >>> >>> Any help is appreciated : ) >>> >>> -- >>> Regards >>> -- Hongbo Zhang >>> >> >> > > > -- > Regards > -- Hongbo Zhang > -- Regards -- Hongbo Zhang --001a1139c0d2b43d1c051ccb0d64 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Before I changed Lambda.lambda, and it works, it might be = that we serialized structured_constant somewhere in the bootstrapping proce= ss?

On Sat, = Aug 8, 2015 at 7:25 AM, Bob Zhang <bobzhang1988@gmail.com> wrote:
It does not w= ork for me. Since it fails to compile, I pushed it to another branch=C2=A0<= a href=3D"https://github.com/bobzhang/ocaml/tree/fails" target=3D"_blank">h= ttps://github.com/bobzhang/ocaml/tree/fails (sorry for the misinformati= on)

I did `git clean -fxd` and try configure, make world= , it failed in the same place.
Thank you for your time!

On Sat, Aug 8, 2015 at 3:37 AM, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
You need to run "make bootstrap" to avoi= d having part of the definition compiled against the stale definition of la= mbda.cmi. (I just checked that it works on your change: after a bootrsap, &= quot;make world", "make opt", "make opt.opt" work.= )

On Sat, Aug 8, 2015 at 5:50 AM, Bob Zhang <bobzhang1988@gmail.com= > wrote:
<= br clear=3D"all">
Dear caml develpers,

=C2=A0 =C2=A0I am working= on an experimental branch to pass more information from typedtree to lambd= a to enable ocaml generate user readable javascript code(https://github.co= m/bobzhang/ocaml/tree/master) (online-demo: http://zhanghongbo.me/js-demo/)
=

=C2=A0 =C2=A0Here I get a segfault, after I change cons= t_block:
=C2=A0 =C2=A0Below is my minimal change:

<= /div>
```
type pointer_info =3D=C2=A0
=C2=A0 | Null= Constructor of string
=C2=A0 | NullVariant of string=C2=A0
<= div>=C2=A0 | NAPointer=C2=A0

type tag_info = =3D=C2=A0
=C2=A0 | Constructor of string
=C2=A0 | Tuple=
=C2=A0 | Variant of string=C2=A0
=C2=A0 | Record=C2=A0=
=C2=A0 | NA

type structured_const= ant =3D
=C2=A0 =C2=A0 Const_base of constant
=C2=A0 | C= onst_pointer of int * pointer_info
=C2=A0 | Const_block of int * = tag_info * structured_constant list
=C2=A0 | Const_float_array of= string list
=C2=A0 | Const_immstring of string
```
Note that the enriched info is not used in ``emitcode``, now I get a= segfault in make world:

```
../../= boot/ocamlrun ../../ocamlc -nostdlib -I ../../stdlib -c -w +33..39 -warn-er= ror A -bin-annot -g -safe-string -I ../../stdlib -I ../../utils -I ../../ty= ping -I ../../bytecomp -I ../../asmcomp extract_crc.ml
../../boot/ocamlrun ../../oca= mlc -nostdlib -I ../../stdlib -o extract_crc dynlink.cma extract_crc.cmo
make[3]: *** [extract_crc] Segmentation fault: 11
make[3]= : *** Deleting file `extract_crc'
make[2]: *** [otherlibrarie= s] Error 2
make[1]: *** [all] Error 2
```

Any help is appreciated : )

--
Regards
-- Hongbo Zhang




--
=
Regards
-- Hongbo Zhang



--
=
Regards
-- Hongbo Zhang
--001a1139c0d2b43d1c051ccb0d64--