RAM at 100% and laptop thrashing


Since a few days, when I run nix-shell with this shell.nix my computer’s CPU starts working at 100%, until when the computer virtually freezes.

This seems to happen when evaluating /nix/store/xhlaj0ym83v3jcll7wbd7ybippr8p1fm-source/pkgs/tools/archivers/unzip/default.nix, because the last line of output says:

evaluating file '/nix/store/xhlaj0ym83v3jcll7wbd7ybippr8p1fm-source/pkgs/tools/archivers/unzip/default.nix'

To reproduce, run nix-shell --argstr eth_from foo.

Does anyone know what could be going on? I tried using s-tui in combination with stress to stress my CPU, but that didn’t trigger the issue.

❯ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.105, NixOS, 18.09.2337.5d972dd2c94 (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(root): `"nixos-18.09.2337.5d972dd2c94, nixos-hardware"`
 - channels(asymmetric): `"home-manager-18.09, nixos-unstable-19.09pre172943.da1a2b1eeaf"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

My Thinkpad T450s is not one of the models mentioned here but I wonder if the problem mentioned there could have something to do with it.

This would import ~/.dapp/testnet/8545/keystore into the store. How big is that directory?

Currently 84K, so I don’t think that’s the problem.

Noticed that it happens when running nix-build -A solc on the latest nixpkgs, when evaluating exactly the same file.

Is there a way to rollback to a generation before that file was used? I.e. how do I find out at which generation it was introduced?

I’m not sure if I understood your reply correctly, but solc from master
(0cbe2fa18cd) builds here.

I think nix-channel supports rollbacks, so you could try that.

It looks like the issue is my machine runing out of memory when evaluating that package unzip/default.nix.

Found out how to remove the issue:

I had symlinked this file under ~/.config/nixpkgs/overlays.

Removing the symlink removes the issue. No idea why this was causing memory usage to explode.

Steps to reproduce:

  • add this to your overlays
  • get a clone of nixpkgs
  • run nix-build -A solc in your nixpkgs clone