begoon
begoon4mo ago

thread 'tokio-runtime-worker' has overflowed its stack

I have a complex CLI application to generate PDF's with pdfkit and a few extra libraries. After the latest Deno update
deno --version deno 1.44.4 (release, aarch64-apple-darwin) v8 12.6.228.9 typescript 5.4.5
everything crashes no matter what with:
cd src/pdf && \ deno run -A --watch \ pdf-cli.ts Watcher Process started. thread 'tokio-runtime-worker' has overflowed its stack fatal runtime error: stack overflow
I'm puzzled how to raise a bug report because I don't know how supply a simple reproducible test case. Also, when I run this project AS IS but with bun, it works as expected. No crashes. Any advice?
5 Replies
begoon
begoon4mo ago
I have just realised that in the dockerfile, there is a version of deno which I didn't upgrade. The application DOES work with that version: deno --version deno 1.43.1 (release, aarch64-apple-darwin) v8 12.4.254.12 typescript 5.4.3 I have downgraded my main CLI deno to 1.43.1 and... the crash is gone. Something had been broken between 1.43.1 and 1.44.4.
begoon
begoon4mo ago
GitHub
thread 'tokio-runtime-worker' has overflowed its stack · Issue #243...
Version: Deno 1.44.4 I have a complex CLI application to generate PDF's with pdfkit and a few extra libraries. After the latest Deno update: deno --version deno 1.44.4 (release, aarch64-apple-d...
begoon
begoon4mo ago
I have bisected the releases and found that the last working release for me is 1.43.5. In 1.43.6, the application starts crashing because of the error above.
Deno AI Helper
Deno AI Helper4mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like you're encountering a stack overflow error within the Tokio runtime, which is an asynchronous runtime used by Deno. The error message "thread 'tokio-runtime-worker' has overflowed its stack" suggests that there might be a deep recursion or an infinite loop within your code or one of the libraries you are using that is causing the stack to overflow. This could potentially be related to the latest Deno update you mentioned, but without a reproducible test case, it's difficult to pinpoint the exact cause. Since you mentioned that the project works with Bun, it's possible that the issue is specific to how Deno's runtime is handling your code. Here are a few general suggestions that might help you troubleshoot the issue: 1. Review recent changes in your codebase that could have introduced deep recursion or an infinite loop. 2. Check if any of the libraries you are using have known issues with the latest version of Deno. 3. Try to isolate the part of your code that is causing the stack overflow by commenting out sections and gradually reintroducing them. Please note that this advice is not based on the Deno documentation, and I recommend double-checking the accuracy of the advice given. If you're unable to resolve the issue, consider raising a bug report with Deno. When doing so, try to provide as much information as possible, even if you can't supply a simple reproducible test case. Include details about your environment, the Deno version, and the error message. If you can narrow down the code that's causing the issue, even if it's not a minimal example, it could still be helpful for the Deno team to investigate the