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

Segmentation fault when building ISO image with nixFlakes #4246

Open
rbvermaa opened this issue Nov 11, 2020 · 19 comments
Open

Segmentation fault when building ISO image with nixFlakes #4246

rbvermaa opened this issue Nov 11, 2020 · 19 comments
Labels

Comments

@rbvermaa
Copy link
Member

Describe the bug

Segmentation fault when building ISO image with nixFlakes from release-20.09

Steps To Reproduce

To reproduce (on nixpkgs release-20.09):

nix-instantiate -A iso_minimal_new_kernel.x86_64-linux nixos/release.nix

Expected behavior

No segmentation fault

nix (Nix) 2.4pre20201102_550e11f

@rbvermaa rbvermaa added the bug label Nov 11, 2020
@roberth
Copy link
Member

roberth commented Nov 11, 2020

Probably #4178 which has been fixed in master. That time it wasn't reproduced by Eelco, so it's probably best if you try for yourself. You could use NixOS/nixpkgs#102932 if you think that's more convenient.

@jonringer
Copy link
Contributor

For others who land on this page.

Until there's a proper fix, you may try adding GC_DONT_GC=1 to the command.

GC_DONT_GC=1 nix build ...

this seems to allow IFD to complete successfully for me

@pinpox
Copy link
Member

pinpox commented Jan 13, 2021

For others who land on this page.

Until there's a proper fix, you may try adding GC_DONT_GC=1 to the command.

GC_DONT_GC=1 nix build ...

this seems to allow IFD to complete successfully for me

This "fixed" the problem for me aswell, but it seems more like a workaround. Any plans to get this fixed properly?

@jaen
Copy link

jaen commented Jan 23, 2021

It has just now happened to me while building a non-ISO configuration, so it seems it's not limited to something that the ISO derivation is doing.

@tomberek
Copy link
Contributor

This occurred with building an amazonImage.

  • tried with flakes
  • tried with legacy
    GC_DONT_GC fixed it.
    nix (Nix) 2.4pre20201205_a5d85d0

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-can-i-debug-this-segfault-trying-to-build-my-system-with-flakes/9716/3

@stale
Copy link

stale bot commented Oct 11, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Oct 11, 2021
@jonringer
Copy link
Contributor

#4944 most likely fixed this, this is likely to be no longer applicable.

@stale stale bot removed the stale label Oct 11, 2021
ggreif added a commit to dfinity/motoko that referenced this issue Nov 19, 2021
Domen gave me the hint that the crashes tend to happen in `nix` GC,
see e.g. NixOS/nix#4246
mergify bot pushed a commit to dfinity/motoko that referenced this issue Nov 19, 2021
Domen gave me the hint that the crashes tend to happen in `nix` GC,
see e.g. NixOS/nix#4246

## Background

The GitHub release action for new tags keeps failing on MacOS X
@ggreif
Copy link

ggreif commented Nov 20, 2021

Sorry for the linkspam above... I'll leave this comment here, as it looks like there is still some lurking bug in 2.4. There is also a fresh backtrace.

@snajpa
Copy link

snajpa commented Jun 21, 2022

yes it is, even in 2.6... I'm being bit by this or something related, flakes aren't involved in my setup, it's a NIX_PATH override with heavy overlays... prefixing nix-build with GC_DONT_GC=1 seems to avoid the segfault

@nrdxp
Copy link

nrdxp commented Nov 22, 2022

hit a segfault in 2.11.1 that was resolved with the GC_DONT_GC var when building a devshell with some heavy IFD, so this bug is likely still around

@omnibs
Copy link

omnibs commented Dec 8, 2022

Same on 2.12.0, also resolved with GC_DONT_GC

@n8henrie
Copy link
Contributor

Same, Segmentation fault (core dumped) building an aarch64 iso image. Works with GC_DONT_GC. Would love to learn more about how to debug these.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.1-arch1-1, Arch Linux, noversion, rolling`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - channels(root): `"nixpkgs-22.11"`
 - channels(n8henrie): `"nixpkgs-22.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/n8henrie/channels/nixpkgs`

n8henrie added a commit to n8henrie/nixos-btrfs-pi that referenced this issue Dec 27, 2022
n8henrie added a commit to n8henrie/nixos-btrfs-pi that referenced this issue Dec 27, 2022
@terlar
Copy link

terlar commented Jan 24, 2023

I just hit this as well on a PR that updates my flake inputs. I could try to find out which updated input that caused the issue. This also only happens in GH Actions, running the same command locally had no issues.

@roberth
Copy link
Member

roberth commented Jan 24, 2023

Probably needs #7679. Is it a linux action or macos?

@terlar
Copy link

terlar commented Jan 24, 2023

It was a Linux action

@terlar
Copy link

terlar commented Jan 24, 2023

I have isolated the issue being triggered by nixpkgs upgrade:
terlar/nix-config@83ef162

I have not bisected anything to figure out exact at what point it broke. This breaks evaluation consistently for my GH action. Good to see a fix, will have to try it out when a new version is released. Or if anyone has a "one-liner" that could be used with install-nix-action, I guess via the install_url.

Not sure if there are any hints in this information in order to make something small and reproducible.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rust-in-nix-discussion-thread/5092/20

@yannham
Copy link
Contributor

yannham commented Feb 14, 2023

I don't know if I'm hitting the same issue, but as @terlar, I get a segmentation fault on a nix flake check run by the CI of a PR updating flake inputs (generated by the update_flake_lock action) on a MacOS runner. The Linux runner got cancelled, so hard to say if it would be affected or not): https://github.com/tweag/nickel/actions/runs/4172595547/jobs/7223897501#step:5:23. Mentioning as a potential data point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

15 participants