Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runCallSync freezes because wasStopped is never set #2396

Closed
mhart opened this issue Jul 18, 2022 · 2 comments
Closed

runCallSync freezes because wasStopped is never set #2396

mhart opened this issue Jul 18, 2022 · 2 comments

Comments

@mhart
Copy link

mhart commented Jul 18, 2022

It seems that wasStopped is never actually set, even though it's checked for in runCallSync:

if (wasStopped) throw new Error('The service was stopped');

This means that runCallSync calls will just freeze at

let status = Atomics.wait(sharedBufferView, 0, 0);
if there's actually a problem with the worker service starting

@mhart
Copy link
Author

mhart commented Jul 18, 2022

I think this is a relatively easy reproduction (Node.js v16.16.0, macOS M1)

$ npm install esbuild
$ node -p 'require("esbuild").formatMessagesSync([], { kind: "error" })'
[]

$ rm -rf node_modules/esbuild-darwin-arm64

$ node -p 'require("esbuild").formatMessagesSync([], { kind: "error" })'

# Freezes...

@mhart
Copy link
Author

mhart commented Jul 18, 2022

The actual circumstances that led to this are that I'm running VS Code on my Mac, but it appears to be an x64 build, running under Rosetta. So when I run node -p 'os.arch()' from the terminal in VS Code, it's outputting x64 – on the macOS terminal app, this is outputting arm64.

So running in VS Code's terminal, esbuild is looking for the wrong architecture. That's fine – but it's just freezing instead of actually throwing an error and exiting.

@evanw evanw closed this as completed in ecae25d Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant