Build with dune build main.bc.js --release
Demonstrates stack overflow on dynlinking the bap_c library.
Troubleshooting is difficult. Unfortunately the overflow error is being caught and translated in a way that obscures the original cause. To find what I believe is an accurate stack trace do the following: Go into _build/default/main.bc.js
. Add Error.stackTraceLimit = Infinity;
to the top. Grep for RangeError
. Add in console.log(e.stack);
into the exception handler like so
{if(e instanceof Array)return e;
if
(joo_global_object.RangeError
&&
e instanceof joo_global_object.RangeError
&&
e.message
&&
e.message.match(/maximum call stack/i)) {
//console.trace()
console.log(e.stack);
Maybe there is a better way of going about this?
You can run node --stack-size=5000 _build/default/main.bc.js
to confirm it is a stack size issue.