Description
- Version: 12.18.3
- Platform: macOS and Linux
- Subsystem:
What steps will reproduce the bug?
Here's a sample program I wrote to repro the issue.
function sleep(ms) {
return new Promise(res => setTimeout(res, ms))
}
async function h() {
for (let i = 0; i < 10000; i++) {
try {
throw new Error("BAH")
} catch (e) {
await sleep(6)
}
}
}
async function g() {
await h()
}
async function f() {
await g()
}
f()
Running this with
node --experimental-report --report-on-signal test.js &
# and then
kill -USR2 <PID>
View the report file.
How often does it reproduce? Is there a required condition?
Reproduce every time.
What is the expected behavior?
I tested the same program with Node 10 + node-report. A stack trace is reported.
==== JavaScript Stack Trace ====================================================
JavaScript VM state: <unknown>
0: [pc=0x1dedf9ce74b3] sleep (/Users/zeno/Developer/tmp/node/diag.js:1:77)
1: [pc=0x1dedf9ce7071] h (/Users/zeno/Developer/tmp/node/diag.js:10:10)
What do you see instead?
"javascriptStack": {
"message": "No stack.",
"stack": [
"Unavailable."
],
"errorProperties": {
}
}
Additional information
Note that this is not a consistent behavior - sometimes node 10 also reports No stack trace, but I've repeatedly tested Node 12 and no stack trace is reported, ever (after about seeing 40 reports). This is definitely a better way to reproduce this, but I do believe there's a pattern here. The example above is for demonstration purpose. This also applies with a real world express application.
Without the javascriptStack, it renders the diagnostic report useless - Basically all other info can be obtained easily and not as useful for debugging.
Let me know if any further info is needed. I believe this is a high-pri breakage on a major feature.