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 148237EEF8 for ; Mon, 10 Aug 2015 04:45:36 +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.178; 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.178 as permitted sender) identity=mailfrom; client-ip=209.85.160.178; 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-f178.google.com) identity=helo; client-ip=209.85.160.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="postmaster@mail-yk0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D4AAA7D8hVlLKgVdFdg29aDwaDHqofkXmFeQKBHQdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBAQMBEhEdARsdAQMBCwYFCw0qAgIhAQERAQUBHAYTIod2AQMKCA2peYEuPjGLQIFsgnmKYQoZJw1XhFUBAQEBAQEBAwEBAQEBAQEBFAEFDotDgk+BVxEBTQQHgmmBQwWHGoZmhwQHhQKFdYFsgUlGkDsKg0OCGhIjgRcXgh0cgW8iM4EOgT4BAQE X-IPAS-Result: A0D4AAA7D8hVlLKgVdFdg29aDwaDHqofkXmFeQKBHQdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBAQMBEhEdARsdAQMBCwYFCw0qAgIhAQERAQUBHAYTIod2AQMKCA2peYEuPjGLQIFsgnmKYQoZJw1XhFUBAQEBAQEBAwEBAQEBAQEBFAEFDotDgk+BVxEBTQQHgmmBQwWHGoZmhwQHhQKFdYFsgUlGkDsKg0OCGhIjgRcXgh0cgW8iM4EOgT4BAQE X-IronPort-AV: E=Sophos;i="5.15,641,1432591200"; d="scan'208";a="142390334" Received: from mail-yk0-f178.google.com ([209.85.160.178]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Aug 2015 04:45:34 +0200 Received: by ykaz130 with SMTP id z130so21953738yka.0; Sun, 09 Aug 2015 19:45:33 -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=GQjR1ByyrCpdJvIjDN6+25WplOrYeR4POETRCRcgc1M=; b=0yPhmZtptUZC/ipHt6QKXBIJux67ChLXYWqxOZy7GiNpiunLyuzpX/zKyBAbUI6aqt dKDRF4XSIFd5Jtse2qRiTaZ8egTEBboiZVEP27g8fD0BCQJdxHns92M/rYG9nJPe1pt9 RgIezi6+PZn2Hrlz8iTut8Ucuua3O8qwpOxhW9FglZ15kOzm6wJ95WZB5gQHvxq1q8k0 x/VwchHMS8JYdORtrFWalUv5ipLxSxrV1Pc/+VEj/ucwBR1p14sE8paFSSO7QlZcb7lL Hqvig4fiK1n9Wh2DCiQ2z9UOF3JZNbMCuPq/oziLWbVUg4kdisAMTCjHFNf1IYs30p9G vpcQ== MIME-Version: 1.0 X-Received: by 10.170.150.7 with SMTP id r7mr19135433ykc.48.1439174733098; Sun, 09 Aug 2015 19:45:33 -0700 (PDT) Received: by 10.37.56.140 with HTTP; Sun, 9 Aug 2015 19:45:33 -0700 (PDT) In-Reply-To: References: Date: Sun, 9 Aug 2015 22:45:33 -0400 Message-ID: From: Bob Zhang To: Gabriel Scherer Cc: Caml List , Xavier Leroy Content-Type: multipart/alternative; boundary=001a1139c0d2bc77d0051cebfa46 Subject: Re: [Caml-list] Questions about changing lambda IR --001a1139c0d2bc77d0051cebfa46 Content-Type: text/plain; charset=UTF-8 Indeed, it works now, thank for your time! On Sat, Aug 8, 2015 at 10:13 AM, Gabriel Scherer wrote: > Attached to this email is the patch I tried. It's exactly your proposed > change, with necessary dummy changes to make it compile. The following > process works reliably on my trunk: > > - make world > - apply the patch > - make bootstrap > - make world > > On Sat, Aug 8, 2015 at 1:28 PM, Bob Zhang wrote: > >> 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 < >>> gabriel.scherer@gmail.com> 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 >> > > -- Regards -- Hongbo Zhang --001a1139c0d2bc77d0051cebfa46 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Indeed, it works now, thank for your time!

On Sat, Aug 8, 2015 at 10:1= 3 AM, Gabriel Scherer <gabriel.scherer@gmail.com> wr= ote:
Attached to th= is email is the patch I tried. It's exactly your proposed change, with = necessary dummy changes to make it compile. The following process works rel= iably on my trunk:

- make world
- apply the= patch
- make bootstrap
- make world
<= /div>
On Sat, Aug 8, 2015 at 1:28 PM, Bob Zhang <bobzhang1988@gmail.com> wrote:
Before I changed Lambda.lambda, and it works, it mig= ht be that we serialized structured_constant somewhere in the bootstrapping= process?

On Sat, Aug 8, 2015 at 7:25 AM, Bob Zhang <bobzhang1988@gmail= .com> wrote:
It does not work for me. Since it fails to compile, I pushed it to anoth= er branch=C2=A0https://github.com/bobzhang/ocaml/tree/fails (sorry for = the misinformation)

I did `git clean -fxd` and try confi= gure, make world, it failed in the same place.
Thank you for your time!<= /div>

On Sat, Aug 8, 2015 at 3:37 AM, Gabriel Scherer <<= a href=3D"mailto:gabriel.scherer@gmail.com" target=3D"_blank">gabriel.scher= er@gmail.com> wrote:
You need to run "make bootstrap" to avoid having part = of the definition compiled against the stale definition of lambda.cmi. (I j= ust checked that it works on your change: after a bootrsap, "make worl= d", "make opt", "make opt.opt" work.)

On Sat, Au= g 8, 2015 at 5:50 AM, Bob Zhang <bobzhang1988@gmail.com> wrote:

Dear caml develpers,

=C2=A0 =C2=A0I am working on an experim= ental branch to pass more information from typedtree to lambda to enable oc= aml generate user readable javascript code(https://github.com/bobzhang/oca= ml/tree/master) (online-demo: http://zhanghongbo.me/js-demo/)

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

```<= /div>
type pointer_info =3D=C2=A0
=C2=A0 | NullConstructor of= string
=C2=A0 | NullVariant of string=C2=A0
=C2=A0 | N= APointer=C2=A0

type tag_info =3D=C2=A0
<= div>=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_constant =3D
<= div>=C2=A0 =C2=A0 Const_base of constant
=C2=A0 | Const_pointer o= f int * pointer_info
=C2=A0 | Const_block of int * tag_info * str= uctured_constant list
=C2=A0 | Const_float_array of string list
=C2=A0 | Const_immstring of string
```
Note th= at the enriched info is not used in ``emitcode``, now I get a segfault in m= ake world:

```
../../boot/ocamlrun = ../../ocamlc -nostdlib -I ../../stdlib -c -w +33..39 -warn-error A -bin-ann= ot -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
```

<= div>Any help is appreciated : )
--
Regards
-- Hongbo Zhang




--
=
Regards
-- Hongbo Zhang



--
=
Regards
-- Hongbo Zhang




--
=
Regards
-- Hongbo Zhang
--001a1139c0d2bc77d0051cebfa46--