-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
16.11.1 cant build and execute on FreeBSD 13 #40467
Comments
@nodejs/platform-freebsd |
Installing from packages (which currently has node-16.10.0 in the set) on FreeBSD 13 here works for me:
|
Not works for me: https://github.com/Brooooooklyn/snappy/runs/3913092013?check_suite_focus=true $ node -v
|
I got that same error after pkg update/upgrade to node 16.10.0 a few days ago and then after upgrade to node 16.11.1 today. Today I tried running:
That fixed it. The node --version is now reported as v16.11.1 without the openssl error (without needing to reinstall node). |
I have a similar trace during compilation. When I install the prebuilt package from the repository, I'm also getting that trace after running node binary. |
I use truenas Core 12.0 -U6 (freebsd 12.2) I see same message.. |
Have you managed to fix it? I'm facing the same issue on the same TueNAS release. |
same error for truenas - freebsd 12.2 jail |
This bug is caused by setting note that just calling node --version, i'll get:
but as soon as i involve any JavaScript in the process it's not too happy about this What allow WX=0 is that it disables executable sections to be writable.
if i do this manually:
then re-enable allow_wx, it works:
note that this seems to be a new feature in 16 and 17, it does not happen in 14. |
Found a random twitter thread that suggests V8 started using RWX pages so this could explain a regression. |
Can everyone who has experienced this issue confirm that they've set the allow_wx sysctl to 0? |
I did set it and setting it to 1 allows node to be built. |
I've just found this ticket searching for the error message I was seeing building node16 on my poudriere server, and indeed I have w^x enabled and turning it off allowed node to build! |
Do we know if this is a bug in the FreeBSD port or a bug in nodejs itself? |
Neither. It's an issue with nodejs starting to use JIT. Ideally, there would be an option in nodejs to disable JIT, or FreeBSD ports could disable ASLR selectively for node binary. |
There's a A better option is |
Interestingly Debian Code Search and Google both turn up no hits for "nowrite_code_using_rwx" so I guess this is not really used in the wild today (other than on macOS on arm64, as a #if compile-time default)?
https://chromium.googlesource.com/v8/v8/+/master/src/flags/flag-definitions.h#747 If someone is willing to write a patch and upstream it I think the best case would be to have the process use procctl(2) on FreeBSD to determine if the process has wx mappings disabled and set write_code_using_rwx appropriately (i.e., a run-time rather than compile-time default). As a much more straightforward (and easier to be accepted) change we could also just default Finally nodejs's build infrastructure or the FreeBSD port could use elfctl to mark the binary as requiring wx mappings (using wxneeded flag). There is ports infrastructure to handle this in a consistent way if the port maintainer wants to go that way. |
The same "issue" happens on OpenBSD. I think that turning |
Version
v16.10.0
Platform
FreeBSD fundev.local 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
If I install it from pkg.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: