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

nix build for first-time home-manager build fails with address boundary error (SIGSEGV) #6554

Closed
muni-corn opened this issue May 20, 2022 · 3 comments · Fixed by #6582
Closed
Labels

Comments

@muni-corn
Copy link

muni-corn commented May 20, 2022

Original posts here and here (very sorry about the spam)

Describe the bug

So I recently wiped my laptop to change its filesystem from btrfs to ext4, hoping for a little performance improvement (every bit counts at its age). I was able to re-partition my disk and re-install NixOS smoothly on my laptop. (Here's my NixOS config.)

But I cannot build my home-manager configuration.

I manage my home-manager config with flakes. To build it for the first time on a fresh system, I'm trying to use nix build --no-link ~/.config/nixpkgs/#homeConfigurations.<machine_name>.activationPackage. However, this fails with an address boundary error (SIGSEGV).

Steps To Reproduce

Steps to reproduce the behavior:

  1. You may need a fresh install of NixOS with nixUnstable. My system config above now uses nixFlakes, which is not affected by this bug.
  2. Clone home-manager config (also linked above) to ~/.config/nixpkgs
  3. cd ~/.config/nixpkgs
  4. nix build --no-link ~/.config/nixpkgs#homeConfigurations.littlepony.activationPackage

You should get something like nix build ... terminated by SIGSEGV (Address boundary error)

Expected behavior

I should be able to build my home-manager configuration successfully

Additional context

[user@system:~] $ nix-env --version
nix-env (Nix) 2.9.0pre20220512_d354fc3

I haven't found anything online about this. I've tried running it with env GC_DONT_GC=1, but that didn't fix the issue.

Here's gdb output and an strace that might help.

Thank you in advance for any help, workarounds, or suggestions :)

@muni-corn muni-corn added the bug label May 20, 2022
@muni-corn
Copy link
Author

I discovered I can use pkgs.nixFlakes in the meantime, which works fine. I was using pkgs.nixUnstable for my system, which was, well, unstable.

Keeping this issue up since it affects unstable.

@thufschmitt
Copy link
Member

Thanks for the report. Looks like something fishy's going in the git fetcher (though I've no idea what). I can't reproduce though because the repo is using git-crypt for some files so I can't evaluate it. Do you think you could add a branch with all the encrypted files replaced by a (dummy) clear version to see whether it can be reproduced?

@thufschmitt
Copy link
Member

I wonder whether this is the same issue as #6554 (which is also about a sigsev related to the git fetcher)

thufschmitt pushed a commit that referenced this issue May 27, 2022
The git fetcher code used to dereference the (potentially empty) `ref`
input attribute. This was magically working, probably because the
compiler somehow outsmarted us, but is now blowing up with newer nixpkgs
versions.

Fix that by not trying to access this field while we don't know for sure
that it has been defined.

Fix #6554
github-actions bot pushed a commit that referenced this issue May 31, 2022
The git fetcher code used to dereference the (potentially empty) `ref`
input attribute. This was magically working, probably because the
compiler somehow outsmarted us, but is now blowing up with newer nixpkgs
versions.

Fix that by not trying to access this field while we don't know for sure
that it has been defined.

Fix #6554

(cherry picked from commit 027fd45)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants