caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OCaml+spacetime crashes during camlp5 compilation
@ 2017-02-17 22:00 Kakadu
  2017-02-18  1:53 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 13+ messages in thread
From: Kakadu @ 2017-02-17 22:00 UTC (permalink / raw)
  To: Caml List

Hey, folks

I got a crash during compilation of camlp5. Is it expected to be easy
fixable? Or something terrible?

Happy hacking,
Kakadu

➜  meta git:(master) ✗ OCAMLRUNPARAM="b" ocamlopt.opt -warn-error A -I
../main -I ../boot -I ../lib -I ../ocaml_stuff/4.04.0/utils -c -impl
q_MLast.ppo
Fatal error: exception Stack overflow

....
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 173, characters 8-60
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 160, characters 32-51
Called from file "asmcomp/spill.ml", line 160, characters 32-51
....

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-17 22:00 [Caml-list] OCaml+spacetime crashes during camlp5 compilation Kakadu
@ 2017-02-18  1:53 ` Daniel de Rauglaudre
  2017-02-18  1:58   ` Gabriel Scherer
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel de Rauglaudre @ 2017-02-18  1:53 UTC (permalink / raw)
  To: Kakadu; +Cc: Caml List

Hi,

Which version of OCaml and Camlp5? Taken from where? The github
sources? Or else which site?

On Sat, Feb 18, 2017 at 01:00:31AM +0300, Kakadu wrote:
> Hey, folks
> 
> I got a crash during compilation of camlp5. Is it expected to be easy
> fixable? Or something terrible?
> 
> Happy hacking,
> Kakadu
> 
> ➜  meta git:(master) ✗ OCAMLRUNPARAM="b" ocamlopt.opt -warn-error A -I
> ../main -I ../boot -I ../lib -I ../ocaml_stuff/4.04.0/utils -c -impl
> q_MLast.ppo
> Fatal error: exception Stack overflow
> 
> ....
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 173, characters 8-60
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> ....
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18  1:53 ` Daniel de Rauglaudre
@ 2017-02-18  1:58   ` Gabriel Scherer
  2017-02-18  7:39     ` Kakadu
  0 siblings, 1 reply; 13+ messages in thread
From: Gabriel Scherer @ 2017-02-18  1:58 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: Kakadu, Caml List

Note that a similar bug has already been reported for Camlp4:
  https://caml.inria.fr/mantis/view.php?id=7435

Camlp4/Camlp5 tend to be demanding in term of compilation (or rather,
they hit code shapes that the compiler does not handle very well), so
changes that make compilation more resource-intensive, such as
Spacetime, can tip over the edge and provoke a failure -- this is not
due to a hard bug on anyone's side.

On Fri, Feb 17, 2017 at 8:53 PM, Daniel de Rauglaudre
<daniel.de_rauglaudre@inria.fr> wrote:
> Hi,
>
> Which version of OCaml and Camlp5? Taken from where? The github
> sources? Or else which site?
>
> On Sat, Feb 18, 2017 at 01:00:31AM +0300, Kakadu wrote:
>> Hey, folks
>>
>> I got a crash during compilation of camlp5. Is it expected to be easy
>> fixable? Or something terrible?
>>
>> Happy hacking,
>> Kakadu
>>
>> ➜  meta git:(master) ✗ OCAMLRUNPARAM="b" ocamlopt.opt -warn-error A -I
>> ../main -I ../boot -I ../lib -I ../ocaml_stuff/4.04.0/utils -c -impl
>> q_MLast.ppo
>> Fatal error: exception Stack overflow
>>
>> ....
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 173, characters 8-60
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> Called from file "asmcomp/spill.ml", line 160, characters 32-51
>> ....
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
> --
> Daniel de Rauglaudre
> http://pauillac.inria.fr/~ddr/
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18  1:58   ` Gabriel Scherer
@ 2017-02-18  7:39     ` Kakadu
  2017-02-18  8:49       ` Leo White
  0 siblings, 1 reply; 13+ messages in thread
From: Kakadu @ 2017-02-18  7:39 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Caml List, Daniel de Rauglaudre

[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]

afair
Ocaml 4.04.0+spacetime
Camlp5 from git

On Feb 18, 2017 4:58 AM, "Gabriel Scherer" <gabriel.scherer@gmail.com>
wrote:

> Note that a similar bug has already been reported for Camlp4:
>   https://caml.inria.fr/mantis/view.php?id=7435
>
> Camlp4/Camlp5 tend to be demanding in term of compilation (or rather,
> they hit code shapes that the compiler does not handle very well), so
> changes that make compilation more resource-intensive, such as
> Spacetime, can tip over the edge and provoke a failure -- this is not
> due to a hard bug on anyone's side.
>
> On Fri, Feb 17, 2017 at 8:53 PM, Daniel de Rauglaudre
> <daniel.de_rauglaudre@inria.fr> wrote:
> > Hi,
> >
> > Which version of OCaml and Camlp5? Taken from where? The github
> > sources? Or else which site?
> >
> > On Sat, Feb 18, 2017 at 01:00:31AM +0300, Kakadu wrote:
> >> Hey, folks
> >>
> >> I got a crash during compilation of camlp5. Is it expected to be easy
> >> fixable? Or something terrible?
> >>
> >> Happy hacking,
> >> Kakadu
> >>
> >> ➜  meta git:(master) ✗ OCAMLRUNPARAM="b" ocamlopt.opt -warn-error A -I
> >> ../main -I ../boot -I ../lib -I ../ocaml_stuff/4.04.0/utils -c -impl
> >> q_MLast.ppo
> >> Fatal error: exception Stack overflow
> >>
> >> ....
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 173, characters 8-60
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> Called from file "asmcomp/spill.ml", line 160, characters 32-51
> >> ....
> >>
> >> --
> >> Caml-list mailing list.  Subscription management and archives:
> >> https://sympa.inria.fr/sympa/arc/caml-list
> >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> >> Bug reports: http://caml.inria.fr/bin/caml-bugs
> >
> > --
> > Daniel de Rauglaudre
> > http://pauillac.inria.fr/~ddr/
> >
> > --
> > Caml-list mailing list.  Subscription management and archives:
> > https://sympa.inria.fr/sympa/arc/caml-list
> > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> > Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 4646 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18  7:39     ` Kakadu
@ 2017-02-18  8:49       ` Leo White
  2017-02-18 10:31         ` Daniel de Rauglaudre
  0 siblings, 1 reply; 13+ messages in thread
From: Leo White @ 2017-02-18  8:49 UTC (permalink / raw)
  To: Kakadu; +Cc: Gabriel Scherer, Caml List, Daniel de Rauglaudre

>>
>> I got a crash during compilation of camlp5. Is it expected to be easy
>> fixable? Or something terrible?
>>

As Gabriel said, it is probably just camlp5 being expensive to compile
and spacetime tipping it over the edge. Have you tried increasing the
stack size limit?

Regards,

Leo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18  8:49       ` Leo White
@ 2017-02-18 10:31         ` Daniel de Rauglaudre
  2017-02-18 11:17           ` Kakadu
  2017-02-18 20:52           ` Gerd Stolpmann
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel de Rauglaudre @ 2017-02-18 10:31 UTC (permalink / raw)
  To: caml-list

On Sat, Feb 18, 2017 at 08:49:12AM +0000, Leo White wrote:

> As Gabriel said, it is probably just camlp5 being expensive to compile
> and spacetime tipping it over the edge. Have you tried increasing the
> stack size limit?

Hmmm... perhaps I could test this bug by decreasing my stack size
limit on my computer?

The example given seems to show a problem with the file
meta/q_MLast.ml which indeed contains a statement EXTEND which
generates a rather long OCaml expression. Strange that this problem
does not occur with ocaml_src/meta/q_MLast.ml which is a pretty
printed version of the same file (for Camlp5 cold stard).

I could try to split this EXTEND into several parts to make OCaml
not having to use so much memory?

BTW, how to show one's stack size limit (Linux) and change it?

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18 10:31         ` Daniel de Rauglaudre
@ 2017-02-18 11:17           ` Kakadu
  2017-02-18 20:52           ` Gerd Stolpmann
  1 sibling, 0 replies; 13+ messages in thread
From: Kakadu @ 2017-02-18 11:17 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: Caml List

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

I tried to hack stack size with setting OCAMLRUNPARAM (1). 250k was not
enough but compiler worked a little bit longer, imho

happy hacking,
Kakadu

(1) https://caml.inria.fr/pub/docs/manual-ocaml/runtime.html


On Feb 18, 2017 1:32 PM, "Daniel de Rauglaudre" <
daniel.de_rauglaudre@inria.fr> wrote:

On Sat, Feb 18, 2017 at 08:49:12AM +0000, Leo White wrote:

> As Gabriel said, it is probably just camlp5 being expensive to compile
> and spacetime tipping it over the edge. Have you tried increasing the
> stack size limit?

Hmmm... perhaps I could test this bug by decreasing my stack size
limit on my computer?

The example given seems to show a problem with the file
meta/q_MLast.ml which indeed contains a statement EXTEND which
generates a rather long OCaml expression. Strange that this problem
does not occur with ocaml_src/meta/q_MLast.ml which is a pretty
printed version of the same file (for Camlp5 cold stard).

I could try to split this EXTEND into several parts to make OCaml
not having to use so much memory?

BTW, how to show one's stack size limit (Linux) and change it?

--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

[-- Attachment #2: Type: text/html, Size: 2520 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18 10:31         ` Daniel de Rauglaudre
  2017-02-18 11:17           ` Kakadu
@ 2017-02-18 20:52           ` Gerd Stolpmann
  2017-02-18 21:02             ` Kakadu
  2017-02-19  3:00             ` Daniel de Rauglaudre
  1 sibling, 2 replies; 13+ messages in thread
From: Gerd Stolpmann @ 2017-02-18 20:52 UTC (permalink / raw)
  To: Daniel de Rauglaudre, caml-list

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

Am Samstag, den 18.02.2017, 11:31 +0100 schrieb Daniel de Rauglaudre:
> On Sat, Feb 18, 2017 at 08:49:12AM +0000, Leo White wrote:
> 
> > 
> > As Gabriel said, it is probably just camlp5 being expensive to
> > compile
> > and spacetime tipping it over the edge. Have you tried increasing
> > the
> > stack size limit?
> Hmmm... perhaps I could test this bug by decreasing my stack size
> limit on my computer?
> 
> The example given seems to show a problem with the file
> meta/q_MLast.ml which indeed contains a statement EXTEND which
> generates a rather long OCaml expression. Strange that this problem
> does not occur with ocaml_src/meta/q_MLast.ml which is a pretty
> printed version of the same file (for Camlp5 cold stard).
> 
> I could try to split this EXTEND into several parts to make OCaml
> not having to use so much memory?
> 
> BTW, how to show one's stack size limit (Linux) and change it?

print: ulimit -s (or just ulimit -a). This is in kilobytes.

Change: e.g. ulimit -s 16384 to set it to 16MB.

Note that there is a soft and a hard limit, and you cannot increase the
soft limit (which is the effective one) beyond the hard limit. Print
the hard limit with "ulimit -H -s". Root can also increase the hard
limit, however there's sometimes a per-architecture kernel limit.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18 20:52           ` Gerd Stolpmann
@ 2017-02-18 21:02             ` Kakadu
  2017-02-18 21:14               ` Kakadu
  2017-02-19  3:00             ` Daniel de Rauglaudre
  1 sibling, 1 reply; 13+ messages in thread
From: Kakadu @ 2017-02-18 21:02 UTC (permalink / raw)
  To: Gerd Stolpmann; +Cc: Daniel de Rauglaudre, Caml List

I also tried to comment some code in the file. OCamlopt tries to build
it and fails after eating all free RAM (5Gb).

On Sat, Feb 18, 2017 at 11:52 PM, Gerd Stolpmann <info@gerd-stolpmann.de> wrote:
> Am Samstag, den 18.02.2017, 11:31 +0100 schrieb Daniel de Rauglaudre:
>> On Sat, Feb 18, 2017 at 08:49:12AM +0000, Leo White wrote:
>>
>> >
>> > As Gabriel said, it is probably just camlp5 being expensive to
>> > compile
>> > and spacetime tipping it over the edge. Have you tried increasing
>> > the
>> > stack size limit?
>> Hmmm... perhaps I could test this bug by decreasing my stack size
>> limit on my computer?
>>
>> The example given seems to show a problem with the file
>> meta/q_MLast.ml which indeed contains a statement EXTEND which
>> generates a rather long OCaml expression. Strange that this problem
>> does not occur with ocaml_src/meta/q_MLast.ml which is a pretty
>> printed version of the same file (for Camlp5 cold stard).
>>
>> I could try to split this EXTEND into several parts to make OCaml
>> not having to use so much memory?
>>
>> BTW, how to show one's stack size limit (Linux) and change it?
>
> print: ulimit -s (or just ulimit -a). This is in kilobytes.
>
> Change: e.g. ulimit -s 16384 to set it to 16MB.
>
> Note that there is a soft and a hard limit, and you cannot increase the
> soft limit (which is the effective one) beyond the hard limit. Print
> the hard limit with "ulimit -H -s". Root can also increase the hard
> limit, however there's sometimes a per-architecture kernel limit.
>
> Gerd
> --
> ------------------------------------------------------------
> Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
> My OCaml site:          http://www.camlcity.org
> Contact details:        http://www.camlcity.org/contact.html
> Company homepage:       http://www.gerd-stolpmann.de
> ------------------------------------------------------------
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18 21:02             ` Kakadu
@ 2017-02-18 21:14               ` Kakadu
  0 siblings, 0 replies; 13+ messages in thread
From: Kakadu @ 2017-02-18 21:14 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: Caml List

Daniel,

It seems that program doesn't happen with ocaml_src/meta/q_MLast.ml
because it is compiled with ocamlc.opt and another q_MLast with
ocamlopt.opt.

Happy hacking,
Kakadu

On Sun, Feb 19, 2017 at 12:02 AM, Kakadu <kakadu.hafanana@gmail.com> wrote:
> I also tried to comment some code in the file. OCamlopt tries to build
> it and fails after eating all free RAM (5Gb).
>
> On Sat, Feb 18, 2017 at 11:52 PM, Gerd Stolpmann <info@gerd-stolpmann.de> wrote:
>> Am Samstag, den 18.02.2017, 11:31 +0100 schrieb Daniel de Rauglaudre:
>>> On Sat, Feb 18, 2017 at 08:49:12AM +0000, Leo White wrote:
>>>
>>> >
>>> > As Gabriel said, it is probably just camlp5 being expensive to
>>> > compile
>>> > and spacetime tipping it over the edge. Have you tried increasing
>>> > the
>>> > stack size limit?
>>> Hmmm... perhaps I could test this bug by decreasing my stack size
>>> limit on my computer?
>>>
>>> The example given seems to show a problem with the file
>>> meta/q_MLast.ml which indeed contains a statement EXTEND which
>>> generates a rather long OCaml expression. Strange that this problem
>>> does not occur with ocaml_src/meta/q_MLast.ml which is a pretty
>>> printed version of the same file (for Camlp5 cold stard).
>>>
>>> I could try to split this EXTEND into several parts to make OCaml
>>> not having to use so much memory?
>>>
>>> BTW, how to show one's stack size limit (Linux) and change it?
>>
>> print: ulimit -s (or just ulimit -a). This is in kilobytes.
>>
>> Change: e.g. ulimit -s 16384 to set it to 16MB.
>>
>> Note that there is a soft and a hard limit, and you cannot increase the
>> soft limit (which is the effective one) beyond the hard limit. Print
>> the hard limit with "ulimit -H -s". Root can also increase the hard
>> limit, however there's sometimes a per-architecture kernel limit.
>>
>> Gerd
>> --
>> ------------------------------------------------------------
>> Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
>> My OCaml site:          http://www.camlcity.org
>> Contact details:        http://www.camlcity.org/contact.html
>> Company homepage:       http://www.gerd-stolpmann.de
>> ------------------------------------------------------------
>>
>>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-18 20:52           ` Gerd Stolpmann
  2017-02-18 21:02             ` Kakadu
@ 2017-02-19  3:00             ` Daniel de Rauglaudre
  2017-02-19  7:34               ` Kakadu
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel de Rauglaudre @ 2017-02-19  3:00 UTC (permalink / raw)
  To: caml-list

Hi,

On Sat, Feb 18, 2017 at 09:52:24PM +0100, Gerd Stolpmann wrote:

> print: ulimit -s (or just ulimit -a). This is in kilobytes.
> Change: e.g. ulimit -s 16384 to set it to 16MB.

By setting my ulimit to 1024 (ulimit -s 1024, the default being 8192
in my computer), I managed to indeed repeat the error: I get a Stack
Overflow error while compiling q_MLast.ml.

But trying to split the big EXTEND statement into three parts, the
bug remains. Perhaps it is due to the global size of the file? I
don't know.

It would be interesting if the OCaml team (if you read this message)
could tell us the reason of this Stack Overflow inside OCaml and what
to change in my file to prevent it.

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-19  3:00             ` Daniel de Rauglaudre
@ 2017-02-19  7:34               ` Kakadu
  2017-02-19  8:43                 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 13+ messages in thread
From: Kakadu @ 2017-02-19  7:34 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: Caml List

Daniel,

Can you send me a diff of your splitting? I tried to do this but is
seems that I only introduced some bugs....

Kakadu

On Sun, Feb 19, 2017 at 6:00 AM, Daniel de Rauglaudre
<daniel.de_rauglaudre@inria.fr> wrote:
> Hi,
>
> On Sat, Feb 18, 2017 at 09:52:24PM +0100, Gerd Stolpmann wrote:
>
>> print: ulimit -s (or just ulimit -a). This is in kilobytes.
>> Change: e.g. ulimit -s 16384 to set it to 16MB.
>
> By setting my ulimit to 1024 (ulimit -s 1024, the default being 8192
> in my computer), I managed to indeed repeat the error: I get a Stack
> Overflow error while compiling q_MLast.ml.
>
> But trying to split the big EXTEND statement into three parts, the
> bug remains. Perhaps it is due to the global size of the file? I
> don't know.
>
> It would be interesting if the OCaml team (if you read this message)
> could tell us the reason of this Stack Overflow inside OCaml and what
> to change in my file to prevent it.
>
> --
> Daniel de Rauglaudre
> http://pauillac.inria.fr/~ddr/
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation
  2017-02-19  7:34               ` Kakadu
@ 2017-02-19  8:43                 ` Daniel de Rauglaudre
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel de Rauglaudre @ 2017-02-19  8:43 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

Hi,

On Sun, Feb 19, 2017 at 10:34:23AM +0300, Kakadu wrote:

> Can you send me a diff of your splitting? I tried to do this but is
> seems that I only introduced some bugs....

Included. But now, I am not sure that the problem really comes from
this EXTEND.

BTW, I found a bug about locations on error messages (giving <none>
as source file and no location). People should pull the new version
of Camlp5 on github. (This bug is independent from the compilation of
q_MLast.cmo.)

--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/

[-- Attachment #2: q_MLast.ml.diff --]
[-- Type: text/x-diff, Size: 3331 bytes --]

diff --git a/meta/q_MLast.ml b/meta/q_MLast.ml
index c0d54de..5558684 100644
--- a/meta/q_MLast.ml
+++ b/meta/q_MLast.ml
@@ -158,8 +158,13 @@ value class_str_item = Grammar.Entry.create gram "class_str_item";
 
 value ipatt = Grammar.Entry.create gram "ipatt";
 value let_binding = Grammar.Entry.create gram "let_binding";
+value fun_binding = Grammar.Entry.create gram "fun_binding";
 value type_decl = Grammar.Entry.create gram "type_decl";
+value type_parameter = Grammar.Entry.create gram "type_parameter";
 value match_case = Grammar.Entry.create gram "match_case";
+value ident = Grammar.Entry.create gram "ident";
+value mod_ident = Grammar.Entry.create gram "mod_ident";
+value patt_label_ident = Grammar.Entry.create gram "patt_label_ident";
 value constructor_declaration =
   Grammar.Entry.create gram "constructor_declaration";
 value label_declaration =
@@ -280,7 +285,8 @@ EXTEND
   GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature
     structure class_type class_expr class_sig_item class_str_item let_binding
     type_decl constructor_declaration label_declaration match_case ipatt
-    with_constr poly_variant;
+    with_constr poly_variant ident mod_ident fun_binding type_parameter
+    patt_label_ident;
   module_expr:
     [ [ "functor"; "("; i = SV UIDENT; ":"; t = module_type; ")"; "->";
         me = SELF ->
@@ -803,6 +809,18 @@ EXTEND
                (Qast.List [Qast.Tuple [p; Qast.VaVal (Qast.Option None); e]])]
       | "->"; e = expr -> e ] ]
   ;
+  direction_flag:
+    [ [ "to" -> Qast.Bool True
+      | "downto" -> Qast.Bool False ] ]
+  ;
+END;
+
+EXTEND
+  GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature
+    structure class_type class_expr class_sig_item class_str_item let_binding
+    type_decl constructor_declaration label_declaration match_case ipatt
+    with_constr poly_variant ident mod_ident fun_binding type_parameter
+    patt_label_ident;
   patt:
     [ LEFTA
       [ p1 = SELF; "|"; p2 = SELF -> Qast.Node "PaOrp" [Qast.Loc; p1; p2] ]
@@ -984,13 +1002,17 @@ EXTEND
       | i = LIDENT -> Qast.List [mkident i]
       | i = UIDENT; "."; j = SELF -> Qast.Cons (mkident i) j ] ]
   ;
-  direction_flag:
-    [ [ "to" -> Qast.Bool True
-      | "downto" -> Qast.Bool False ] ]
-  ;
   typevar:
     [ [ "'"; i = ident -> i ] ]
   ;
+END;
+
+EXTEND
+  GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature
+    structure class_type class_expr class_sig_item class_str_item let_binding
+    type_decl constructor_declaration label_declaration match_case ipatt
+    with_constr poly_variant ident mod_ident fun_binding type_parameter
+    patt_label_ident;
   (* Objects and Classes *)
   str_item:
     [ [ "class"; cd = SV (LIST1 class_declaration SEP "and") ->
@@ -1183,6 +1205,14 @@ EXTEND
     [ [ m = UIDENT; "."; l = SELF -> Qast.Cons (mkident m) l
       | i = LIDENT -> Qast.List [mkident i] ] ]
   ;
+END;
+
+EXTEND
+  GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature
+    structure class_type class_expr class_sig_item class_str_item let_binding
+    type_decl constructor_declaration label_declaration match_case ipatt
+    with_constr poly_variant ident mod_ident fun_binding type_parameter
+    patt_label_ident;
   (* Labels *)
   ctyp: AFTER "arrow"
     [ NONA

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-02-19  8:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 22:00 [Caml-list] OCaml+spacetime crashes during camlp5 compilation Kakadu
2017-02-18  1:53 ` Daniel de Rauglaudre
2017-02-18  1:58   ` Gabriel Scherer
2017-02-18  7:39     ` Kakadu
2017-02-18  8:49       ` Leo White
2017-02-18 10:31         ` Daniel de Rauglaudre
2017-02-18 11:17           ` Kakadu
2017-02-18 20:52           ` Gerd Stolpmann
2017-02-18 21:02             ` Kakadu
2017-02-18 21:14               ` Kakadu
2017-02-19  3:00             ` Daniel de Rauglaudre
2017-02-19  7:34               ` Kakadu
2017-02-19  8:43                 ` Daniel de Rauglaudre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).