Error: cannot push beyond allocated stack
See original GitHub issueI am getting this error:
duktape fatal error, aborting: uncaught: 'cannot push beyond allocated stack'
But if I just add this line in the code before that error happens, everything works ok (yes, I am not using the return value at all)
duk_to_string(ctx, -1);
I guess the duk_to_string call is causing the stack to grow, so that the condition for the error does not happen. I tried replacing that call with one of these two lines:
duk_require_stack(ctx, 1000);
duk_check_stack(ctx, 1000);
but the error did not go away. Any hints? Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
RangeError: cannot push beyond allocated stack - - Bountysource
I'm trying to bind a C function to duktape , this function should return an object containing each processes with their loaded modules...
Read more >Error Pushing To My Own Stack in Assembly Masm x86
"Push" is a matter of adding an item to the next available position. "Pop" is a matter of removing from the highest used...
Read more >Duktape API
Note that an attempt to push a value beyond the currently allocated value stack causes an error: it does not cause the value...
Read more >Memory Management, C++ FAQ - Standard C++
If you cannot handle allocation/deallocation implicitly as part of an object you need in your application anyway, you can use a resource handle...
Read more >The Stack - Robert G. Plantz
An attempt to push too many items onto a stack causes stack overflow . And an attempt to pop items off the stack...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@gonzus Could you provide something I could reproduce the error with?
duk_require_stack() should be enough to grow the stack.
I don’t think the recursive reference itself is critical, but the
.moduleis used by the minimal unit tests in the Makefile on purpose.