question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: cannot push beyond allocated stack

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
svaaralacommented, May 29, 2018

@gonzus Could you provide something I could reproduce the error with?

duk_require_stack() should be enough to grow the stack.

0reactions
svaaralacommented, May 30, 2018

I don’t think the recursive reference itself is critical, but the .module is used by the minimal unit tests in the Makefile on purpose.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found