Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM causes strange stack overflow (while naïve interpreter does NOT) #87

Closed
gfngfn opened this issue Jun 12, 2018 · 0 comments · Fixed by #88
Closed

VM causes strange stack overflow (while naïve interpreter does NOT) #87

gfngfn opened this issue Jun 12, 2018 · 0 comments · Fixed by #88
Labels

Comments

@gfngfn
Copy link
Owner

gfngfn commented Jun 12, 2018

Typesetting the following document foo.saty by invoking the command$ satysfi --bytecomp foo.saty fails due to stack overflow, while typesetting it by $ satysfi foo.saty does NOT:

@require: stdja

let-inline \repeat n it =
  let-rec aux n it =
    if n <= 0 then {} else
      let it-after = aux (n - 1) it in {#it;#it-after;}
  in
    aux n it
in

document (|
  title = {Sample Document}; author = {gfn};
  show-title = false; show-toc = false;
|) '<
  +p{\repeat(2){foo}}
>

The stdout and stderr is as follows:

 ---- ---- ---- ----
  target file: 'foo.pdf'
  dump file: 'foo.satysfi-aux' (will be created)
  parsing 'foo.saty' ...
  parsing 'stdja.satyh' ...
  parsing 'pervasives.satyh' ...
  parsing 'gr.satyh' ...
  parsing 'geom.satyh' ...
  parsing 'list.satyh' ...
  parsing 'math.satyh' ...
  parsing 'color.satyh' ...
 ---- ---- ---- ----
  reading 'pervasives.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'list.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'color.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'geom.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'math.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'gr.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'stdja.satyh' ...
  type check passed.
 ---- ---- ---- ----
  reading 'foo.saty' ...
  type check passed. (document)
 ---- ---- ---- ----
  evaluating texts ...
Uncaught exception:

  Stack overflow

Raised at file "lib/read.mll", line 712, characters 13-36
Called from file "lib/read.mll", line 241, characters 23-47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant