nix-community / nix-eval-jobs

Parallel nix evaluator with a streamable json output [maintainers @Mic92, @adisbladis]
GNU General Public License v3.0
140 stars 26 forks source link

nix-eval-jobs C++ crash on recent nixpkgs #297

Closed anmonteiro closed 4 months ago

anmonteiro commented 4 months ago

consider the following flake:

{
  description = "showcase a bug in nix-eval-jobs";
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system: {
      packages =
        let
          legacyPackages = import nixpkgs {
            inherit system;
          };
        in
        { inherit (legacyPackages) hello; };
    });
}

Running

$ nix run 'github:nixOS/nixpkgs#nix-eval-jobs' -- \
     --gc-roots-dir $(mktemp -d) \
     --workers 1 \
     --flake '.#packages.aarch64-darwin'

currently produces a weird C++ crash:

/nix/store/halxxa3djkhgddflg8iva8nlj70fvami-libcxx-16.0.6-dev/include/c++/v1/optional:962: assertion this->has_value() failed: optional operator* called on a disengaged valueerror: error: while checking worker process, evaluation worker got killed by signal 6 (Abort trap: 6)

Using a known-to-work version of nixpkgs produces the expected output, though. This leads me to believe there's a bug in nix-eval-jobs:

# using the currently locked-version in nix-fast-build
$ nix run 'github:nixOS/nixpkgs?rev=c082856b850ec60cda9f0a0db2bc7bd8900d708c#nix-eval-jobs' -- \
     --gc-roots-dir $(mktemp -d) \
     --workers 1 \
     --flake '.#packages.aarch64-darwin'

this is the same issue reported in https://github.com/Mic92/nix-fast-build/issues/59, but now with a consistent repro.

Mic92 commented 4 months ago

Thanks. We saw this issue also in nix-community @zowoq