Async stack trace stitching
Maintainers usually reply within 5 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, javascript
- Domain
- compilers
Research direction
Reproduce the two async examples shown in test_ex3.js and compare their stack traces. Then inspect JSJobEntry and the pending-job execution path; done means errors after await retain the async caller frames, with any DEBUG_PRESERVE_ASYNC_STACKS behavior covered by tests.
Written by the indexing model from the issue text.
Description
When you call await in async functions, it truncates the stack trace on errors.
For example, this:
async function a() {
await b();
}
async function b() {
await 1;
throw Error("poof");
}
a().catch((ex) => {
console.error(ex);
});
will result in a stack trace like this:
Error: poof
at b (test_ex3.js:8:16)
But when we remove the await 1; statement we get the full stack:
Error: poof
at b (test_ex3.js:8:16)
at a (test_ex3.js:3:12)
at <eval> (test_ex3.js:11:2)
Could async stack capture be built into QuickJS? For example, by copying the current stack to JSJobEntry when scheduling and then restoring the stack when executing pending jobs. Perhaps this could be enabled only when a DEBUG_PRESERVE_ASYNC_STACKS flag is set.
For reference:
Spidermonkey only does it when debugger tools are open: https://bugzilla.mozilla.org/show_bug.cgi?id=1601179
V8 has a more elaborate solution http://bit.ly/v8-zero-cost-async-stack-traces
- Dominant language
- C
- Stars
- 11.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bellard/quickjs
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 5 days
-
RegExp: patterns with more than 255 capture groups fail with "too many captures"Possibly taken @andreasrosdal claimed this 3 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
bellard/quickjs#624 · 1 comment ·
Maintainers usually reply within 5 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bellard/quickjs#620 · 1 comment ·
Maintainers usually reply within 5 days
-
(comment on #611) `function g(a, d = (a = 10)) { return a; }` returns the argument instead of 10Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 5 days
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 5 days
Similar issues
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JulianKemmerer/PipelineC#409 ·
-
Linux build fails without libspeechd-dev, which INSTALL.md doesn't list and CMake reports as foundOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
needs-playtest slice
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Life-Framework/Life-Framework#4861 ·
Maintainers usually reply within 1 day