-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Segmentation fault on require("@swc/core") in a Node.js worker thread #2276
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
Comments
Native node bindings are expected to
or
It's the limitation of node js itself. cc @Brooooooklyn |
I don’t know of any such limitation. Perhaps you’re confusing worker threads (JS threads created using the In worker threads, Node.js addons should be able to perform synchronous and asynchronous operations, provided they follow certain rules about thread safety and context awareness. |
Yes. I will dig into this issue today. |
This issue only occurs on Linux GNU platform with I need more time to dig into it. |
Does it happen only on centos? |
@kdy1 I originally found this on NixOS 21.11; the |
Maybe a valid workaround rust-lang/rust#91979 (comment) |
+1,i meet this problem too,it also caused by terser-webpack-plugin’s new swcMinify function. |
@Jackson-p What are your system and |
CentOS Linux release 7.4.1708(Core) ldd(GNU libc) 2.17 |
I've confirmed, this issue should have been fixed in #3314
|
/cc @devongovett since you can use the |
@Brooooooklyn Do you mean this issue can be closed? |
Yes |
Thank you! |
@Brooooooklyn could you explain how this works and how it fixes the Rust issue? Does this mean it doesn't depend on glibc somehow? |
@devongovett It is a little complex, I'll write an article to talk about this. In a nutshell, But it's weakly linked since If a library is built with target < |
@Brooooooklyn ah interesting. So if I understand correctly, another solution would be to build on a system (or docker image) with an older glibc version? What kind of magic is zig doing here?
That would be great! |
Yes, we can only compile our codes on an older glibc version system without If we are using https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Running
require("@swc/core")
inside a Node.js worker thread causes a segfault. (This causes problems with terser-webpack-plugin’s newswcMinify
function.)I’m running Node 14.17.6 on Linux x86-64 (NixOS 21.11). In case this is system-dependent, here’s a Dockerfile that should reproduce reliably:
The text was updated successfully, but these errors were encountered: