I first noticed an issue with my nix installation when running darwin-rebuild switch --verbose, the rebuild just stopped dead at this point:
...
querying info about '/nix/store/xwwq90k84aljwh4xvbbm8kc213y2p20v-options.json' on 'https://cache.nixos.org'...
downloading 'https://cache.nixos.org/xwwq90k84aljwh4xvbbm8kc213y2p20v.narinfo'...
these 27 derivations will be built:
/nix/store/dhl3yyz0ljhlcf4c57az28dy2clakhb7-builder.pl.drv
/nix/store/2j91vwjq1mx9kb3h0w7lygriglq4c64w-options.json.drv
/nix/store/m7rmwvpksff81ga2mq46b27h9f82a7rb-home-configuration-reference-manpage.drv
/nix/store/0dzwfxvmny0njwgwy6g8xj7bly0jh61x-home-manager-fonts.drv
/nix/store/6kcj8qykvqapdnwfgqbax5zqfcc5j1g5-darwin-version.json.drv
/nix/store/zqiqrk0k29jm33zkas4a3ajb8yc5himr-options.json.drv
/nix/store/4njv5zdjb4wcgf81hkpniv2w35r8ig7k-options.json.drv
/nix/store/j2v9afrlyppqjd5p968f2zpvsgykx85v-darwin-manpages.drv
/nix/store/zb5r27lzvdklvxdvvc7qwcc1rza839hw-manpage-urls.json.drv
/nix/store/plbq8ahhbdgv73xwbjbxpcywxsxk91yn-darwin-manual-html.drv
/nix/store/v5krgcg9rq9bglga7fi6gffj1i3lmrjc-darwin-help.drv
/nix/store/j9a39fhvv6049m9k0fp9p07rnrjfimar-system-path.drv
/nix/store/xv42yj5jh1zw8kmcr7kf0jvmarjh6y3n-system-applications.drv
/nix/store/rsa8pwqwvg6zg06mns8mivjfy8dxcll6-darwin-system-24.05pre556102.09ec6a0881e1+darwin4.drv
/nix/store/c4kzqjfrrijk682s73331v9q54p5cknv-darwin-uninstaller.drv
/nix/store/a66vf6ch29q15xsg3jrab9ya0hsfkb08-system-path.drv
/nix/store/lrndp1aplgkawmp1d53adg1khcrzl8w1-home-manager-applications.drv
/nix/store/gn039gyz2v735fjgccqx1nlp9pgibdas-home-manager-files.drv
/nix/store/k9pk3lhb7x8rrhbpjhcdglp6nnw3s3xn-home-manager-path.drv
/nix/store/ismcmfmx1mqmlxdn7syihac204m7klm9-hm-modules-messages.drv
/nix/store/dq6rwf7v7ya1kcldzdb02pifjc9maw11-check.drv
/nix/store/q60y0raiv5zh693y4bdp3ch841ffva7z-cleanup.drv
/nix/store/p1h1l5qac08sb2jglz1mkjh128vbrhkb-activation-script.drv
/nix/store/3dskw54jas00pi3q8hsm9vk0wrk843zz-home-manager-generation.drv
/nix/store/mzw2mwyyx5hgfhfdzsapjdcmcqyk25sc-activation-aaronkelly.drv
/nix/store/yp75pql9qfjr174q2x8fdgzjz6syn664-system-applications.drv
/nix/store/2w8mw73jpc75y5cjnd90k20vkpq9fhvn-darwin-system-24.05pre556102.09ec6a0881e1+darwin4.drv
$
It looked like a segmentation fault, I could see the exit code 139 with this command:
$ echo $?
139
I then tried to run the standard nix-info command, but it also has the same issue:
$ nix-shell -p nix-info --run "nix-info -m" --verbose
...
evaluating file '/nix/store/h2l8kfyq4zca3k0nw2ygvz1h2rc0iy3k-nixpkgs/nixpkgs/pkgs/development/python-modules/future/default.nix'
evaluating file '/nix/store/h2l8kfyq4zca3k0nw2ygvz1h2rc0iy3k-nixpkgs/nixpkgs/pkgs/tools/nix/info/default.nix'
evaluating file '/nix/store/h2l8kfyq4zca3k0nw2ygvz1h2rc0iy3k-nixpkgs/nixpkgs/pkgs/stdenv/generic/common-path.nix'
[1] 43172 segmentation fault nix-shell -p nix-info --run "nix-info -m" --verbose
$ echo $?
139
Even poor cowsay cannot be run in a shell:
$ nix-shell -p cowsay --verbose
...
valuating file '/nix/store/h2l8kfyq4zca3k0nw2ygvz1h2rc0iy3k-nixpkgs/nixpkgs/pkgs/development/python-modules/future/default.nix'
evaluating file '/nix/store/h2l8kfyq4zca3k0nw2ygvz1h2rc0iy3k-nixpkgs/nixpkgs/pkgs/tools/misc/cowsay/default.nix'
evaluating file '/nix/store/h2l8kfyq4zca3k0nw2ygvz1h2rc0iy3k-nixpkgs/nixpkgs/pkgs/stdenv/generic/common-path.nix'
[1] 43294 segmentation fault nix-shell -p cowsay --verbose
How can I investigate/debug this issue? I don’t know where to start looking