This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-03
Channels
- # announcements (3)
- # babashka (29)
- # beginners (95)
- # calva (109)
- # cider (16)
- # clj-kondo (6)
- # clj-together (1)
- # cljdoc (2)
- # cljsrn (2)
- # clojure (85)
- # clojure-europe (26)
- # clojure-india (1)
- # clojure-seattle (1)
- # clojure-uk (6)
- # clojurescript (14)
- # conjure (4)
- # cursive (8)
- # datomic (6)
- # emacs (21)
- # events (1)
- # figwheel-main (5)
- # fulcro (11)
- # graalvm (32)
- # graphql (1)
- # holy-lambda (7)
- # humbleui (7)
- # jobs (3)
- # membrane (8)
- # nextjournal (31)
- # off-topic (29)
- # pathom (14)
- # polylith (6)
- # portal (16)
- # practicalli (4)
- # reitit (17)
- # releases (1)
- # remote-jobs (2)
- # ring (4)
- # sci (20)
- # shadow-cljs (24)
- # sql (1)
- # vim (12)
- # xtdb (3)
I have polyglot code. clojure jvm calling into code in the graal js environment. A call into the js code blows the stack on a native-image, but works when jarred and running under graals jvm.
if I dont stress the js stack, the code runs. But when I feed it something more complex, on native-image it explodes with:
#error {
:cause RangeError: Maximum call stack size exceeded
:via
[{:type org.graalvm.polyglot.PolyglotException
:message RangeError: Maximum call stack size exceeded
:at [<js> Opal.send Unnamed 1671]}]
:trace
[[<js> Opal.send Unnamed 1671]
[<js> alias Unnamed 1861]
[<js> :anonymous Unnamed 22885]
[<js> $$2 Unnamed 22884]
[<js> Opal.yield1 Unnamed 1452]
[<js> $$each Unnamed 12527]
[<js> Opal.send Unnamed 1671]
[<js> $$apply_subs Unnamed 22877]
[<js> :anonymous Unnamed 26325]
[<js> $$content Unnamed 26323]
[org.graalvm.polyglot.Context eval Context.java 425]
[bootleg.asciidoc$asciidoctor_convert invokeStatic asciidoc.clj 37]
[bootleg.asciidoc$convert invokeStatic asciidoc.clj 46]
[bootleg.asciidoc$convert doInvoke asciidoc.clj 46]
[clojure.lang.RestFn invoke RestFn.java 410]
[bootleg.asciidoc$asciidoc invokeStatic asciidoc.clj 68]
[bootleg.asciidoc$asciidoc doInvoke asciidoc.clj 63]
[clojure.lang.RestFn invoke RestFn.java 410]
[clojure.lang.AFn applyToHelper AFn.java 154]
[clojure.lang.RestFn applyTo RestFn.java 132]
[clojure.core$apply invokeStatic core.clj 667]
[bootleg.pod$main$fn__17406 invoke pod.clj 942]
[bootleg.pod$main invokeStatic pod.clj 935]
[bootleg.core$_main invokeStatic core.clj 96]
[bootleg.core$_main doInvoke core.clj 91]
[clojure.lang.RestFn invoke RestFn.java 397]
[clojure.lang.AFn applyToHelper AFn.java 152]
[clojure.lang.RestFn applyTo RestFn.java 132]
[bootleg.core main nil -1]]}
I tried all the obvious compile options, and I tried looking for a js option when building the context that altered stack size and their doesnt seem to be one. And the "sandbox" embedded language stack size controls are only available on enterprise edition
@retrogradeorbit I think this question is better suited for the GraalVM slack, they have a graal-js channel with one of the maintainers on there. There is also a Github Discussions on their repo.
yeah i asked over there too. still waiting for a response. if nothing happens theres always opening a ticket
@retrogradeorbit Is this happening with a musl-compiled binary? I have stack problems with those with a solution
@retrogradeorbit In that case, I may know a solution
Here is the issue, it's likely that you are hitting it too: https://github.com/oracle/graal/issues/3398
See this "solution": https://github.com/babashka/babashka/blob/638ae3aaeb8cc2c94502811546c2241fba3c63e5/src/babashka/main.clj#L950-L968
It's best if the graalvm team fixed this. They are aware but commenting on the issue may help