Open sadkebab opened 2 months ago
interesting
i wonder if #include <stdin.h>
has a side effect here causing this
I didn't include stdin.h in the file tho.
I tried removing the headers in the C file (since they are not needed for my example) but the behaviour stays the same. And as I stated in the issue description this behaviour was not present in v1.1.28, it only happened in canary and now that v1.1.29 has been released it is in the stable version too.
What version of Bun is running?
1.1.28-canary.3+866a6d918
What platform is your computer?
Darwin 22.3.0 arm64 arm
What steps can reproduce the bug?
int myFn() { return 1; }
console.log("start"); await sleep(10000); console.log("end");
Run it with
bun run index.js
and pressctrl+C
to send a SIGINT, the execution will stop because "end" won't get printed but the process won't be terminated and it will start eating all the CPU powerIf you add a handler on SIGINT it will be handled correctly and execution will stop if
process.exit
is calledprocess.on("SIGINT", async () => { process.exit(0); });
function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); }
console.log("start"); await sleep(10000); console.log("end");