-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
segfault during substitution on x86-64_darwin #9640
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Fixed: likely going to take some time to make it from staging to master |
…abi into libcxx (#292043) - merge libcxxabi into libcxx for LLVM 12, 13, 14, 15, 16, 17, and git. - remove the link time workaround `-lc++ -lc++abi` from 58 packages as it is no longer required. - fixes #166205 - provides alternative fixes for. #269548 NixOS/nix#9640 - pkgsCross.x86_64-freebsd builds work again This change can be represented in 3 stages 1. merge libcxxabi into libcxx -- files: pkgs/development/compilers/llvm/[12, git]/{libcxx, libcxxabi} 2. update stdenv to account for merge -- files: stdenv.{adapters, cc.wrapper, darwin} 3. remove all references to libcxxabi outside of llvm (about 58 packages modified) ### merging libcxxabi into libcxx - take the union of the libcxxabi and libcxx cmake flags - eliminate the libcxx-headers-only package - it was only needed to break libcxx <-> libcxxabi circular dependency - libcxx.cxxabi is removed. external cxxabi (freebsd) will symlink headers / libs into libcxx. - darwin will re-export the libcxxabi symbols into libcxx so linking `-lc++` is sufficient. - linux/freebsd `libc++.so` is a linker script `LINK(libc++.so.1, -lc++abi)` making `-lc++` sufficient. - libcxx/default.nix [12, 17] are identical except for patches and `LIBCXX_ADDITIONAL_LIBRARIES` (only used in 16+) - git/libcxx/defaul.nix does not link with -nostdlib when useLLVM is true so flag is removed. this is not much different than before as libcxxabi used -nostdlib where libcxx did not, so libc was linked in anyway. ### stdenv changes - darwin bootstrap, remove references to libcxxabi and cxxabi - cc-wrapper: remove c++ link workaround when libcxx.cxxabi doesn't exist (still exists for LLVM pre 12) - adapter: update overrideLibcxx to account for a pkgs.stdenv that only has libcxx ### 58 package updates - remove `NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}` as no longer needed - swift, nodejs_v8 remove libcxxabi references in the clang override #292043
This has also made its way into our Has the problem been solved? |
yes |
I don't know if this is tractable from the Nix side, but I figure it deserves a report since some users are encountering it when they invoke nix commands.
Describe the bug
Since the stdenv bump to LLVM 16 in Nixpkgs, at least some intel mac users have started seeing segfaults when Nix tries to print the size of missing store paths before substituting.
Depending on shell used, these can manifest like:
or:
When Nix is wrapped by something else like
darwin-rebuild
, these may also just be indicated by exit status (status139
in one known case).Reports so far indicate that this affects x86-64_darwin up to at least macOS 10.15.7. A similar segfault has been reported against Nixpkgs. I'm not 100% sure they share a root cause, but that report suggests this may affect up to macOS 11.x but not 12.x:
Steps To Reproduce
nix-shell -p cowsay --dry-run
Additional context
Here's the most-relevant part of the crash dump (full copy: nix_2023-12-17-113156_b8793364.txt):
The segfaults happen when
printMissing
tries toprintMsg
the float document/NAR sizes here:nix/src/libmain/shared.cc
Lines 67 to 79 in 7f5ed33
We can work around the crash with
--option print-missing false
because Nix only ends up on this code path whenprint-missing
is true (though it is the default):nix/src/nix-store/nix-store.cc
Lines 155 to 156 in 7f5ed33
Related posts/reports:
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: