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

Stack-size crash in runLatex #66

Open
RustanLeino opened this issue Mar 23, 2020 · 0 comments
Open

Stack-size crash in runLatex #66

RustanLeino opened this issue Mar 23, 2020 · 0 comments

Comments

@RustanLeino
Copy link

I have a Madoko-authored book manuscript that's over 450 printed pages (over 22,000 lines of Madoko source). Lately (perhaps because of my growing document or perhaps because of my upgrade to Madoko version 1.2.3), I'm no longer able to generate PDF. When I try, I get the following crash in findLines in (the Koka generated) runLatex.js:

/usr/local/lib/node_modules/madoko/lib/runLatex.js:122
  return $std_core.map_3(
    offsets,
    function(ofs  /* int */ ) {
      var total = { value: 0 };
      var current = { value: 1 };
      $std_core.foreachUntil(
        slens,
        function(len  /* int */ ) {
          ((total).value = ((((total).value) + len)|0));
          var _x0 = ((total).value) > ofs;
          if (_x0) {
            return $std_core.Just(((current).value));
          } else {
            $std_core._unit_;
          }
          ((current).value = ((((current).value) + 1)|0));
          return $std_core.Nothing;
        });
      return ((current).value);
    });
                                                                                                                                                           ^

RangeError: Maximum call stack size exceeded
    at /usr/local/lib/node_modules/madoko/lib/runLatex.js:122:156
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1786:15)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)
    at foreachUntil (/usr/local/lib/node_modules/madoko/lib/std_core.js:1787:28)

(For readability, I inserted the line breaks in code above.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant