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' freezes system on High Sierra with multi-user install #1583

Closed
matthewbauer opened this Issue Sep 28, 2017 · 64 comments

Comments

Projects
None yet
@matthewbauer
Member

matthewbauer commented Sep 28, 2017

I'm suspecting this has more to do with the new file system than Nix. But this has only happened while Nix is running, so I'm going to report it here.

Basically, running a fairly download intensive Nix build freezes the entire High Sierra OS, causing the mouse and keyboard to not work. The only way to fix once this happens is to force reboot the system.

I'm getting very little information on why this is happening but I've only had it happen when nix-build was running the terminal. The tail of that output (before freezing) is:

fetching path ‘/nix/store/ij8nflh8kgbxz9a4zvzqr29qr8qczhkn-hspec-core-2.4.4-doc’...

*** Downloading ‘https://cache.nixos.org/nar/18m7q4fpg4ym69pnbbqk8jlv5zz6x90iq8k8z70b7cs234ihzb24.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/6g7nmj00asjavdcamjs6ndndkpm3msl1-th-expand-syns-0.4.3.0’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
*** Downloading ‘https://cache.nixos.org/nar/013sygin5zrqgdsw5n1656v3i2c9c2cxp9rcdvmvavkh3xgcxnpm.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/siz3is7w8qkx1ssmjha5cqg4p1n1ibdg-ChasingBottoms-1.3.1.3-doc’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
*** Downloading ‘https://cache.nixos.org/nar/04qzk7nkl9c707k0w0gv286ajmms055xipfbxvm57w7k1pgkv3gq.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/ij8nflh8kgbxz9a4zvzqr29qr8qczhkn-hspec-core-2.4.4-doc’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 38576  100 38576    0     0  38576      0  0:00:01 --:--:--  0:00:01  118k

fetching path ‘/nix/store/nzkviwc6yf5g72wgkk5gslqbq5lm9gsc-hspec-meta-2.4.4-doc’...
100 61948  100 61948    0     0  61948      0  0:00:01 --:--:--  0:00:01  177k

fetching path ‘/nix/store/0cwzgwkj6ciy7rgnwqw9il0f54gb3hrn-quickcheck-io-0.2.0-doc’...

*** Downloading ‘https://cache.nixos.org/nar/103pn3xq9076f8p64riy8kyvyag13k4im7pn2r8xnbf250h8pagw.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/nzkviwc6yf5g72wgkk5gslqbq5lm9gsc-hspec-meta-2.4.4-doc’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
*** Downloading ‘https://cache.nixos.org/nar/03w98rqgk9q8i9lyv11nnscsvj8xbknh4npnnil18mqsfpm76h20.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/0cwzgwkj6ciy7rgnwqw9il0f54gb3hrn-quickcheck-io-0.2.0-doc’...
100 85348  100 85348    0     0  85348      0  0:00:01 --:--:--  0:00:01  152k

fetching path ‘/nix/store/65q2hsxdmqixwhj1psx3dzl2gxj237rd-quickcheck-unicode-1.0.1.0-doc’...
 63 4365k   63 2764k    0     0  2764k      0  0:00:01  0:00:01 --:--:-- 1538k  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 77096  100 77096    0     0  77096      0  0:00:01 --:--:--  0:00:01  193k

fetching path ‘/nix/store/5dsaw36ikcki8p5kkdaj4lz7qrd0f74c-hspec-2.4.4-doc’...
100 22528  100 22528    0     0  22528      0  0:00:01 --:--:--  0:00:01 77150


*** Downloading ‘https://cache.nixos.org/nar/1ax3rddcv89k107jimgkppklxvsxcjy8lziy8z8n2rjwssh74bd2.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/65q2hsxdmqixwhj1psx3dzl2gxj237rd-quickcheck-unicode-1.0.1.0-doc’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0fetching path ‘/nix/store/z2i77z1vyghw8n47zhpgh1ia8kcri4ss-hspec-smallcheck-0.4.2-doc’...

*** Downloading ‘https://cache.nixos.org/nar/0mn6hk91ix2khv6q95vpw6ahhyqnagi3wh253l46axmriax42nb4.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/5dsaw36ikcki8p5kkdaj4lz7qrd0f74c-hspec-2.4.4-doc’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
*** Downloading ‘https://cache.nixos.org/nar/0cvvp36xjrs5cvvph3h6zr6wpmgrn4vyzpkpghkn7cj8a36qx5bk.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/z2i77z1vyghw8n47zhpgh1ia8kcri4ss-hspec-smallcheck-0.4.2-doc’...
100 26184  100 26184    0     0  26184      0  0:00:01 --:--:--  0:00:01 79105
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
fetching path ‘/nix/store/dm7vy3dgsn9sp7nc8yqd7akjg4c64az8-tasty-quickcheck-0.8.4-doc’...
100 4365k  100 4365k    0     0  2182k      0  0:00:02  0:00:02 --:--:-- 1755k

This could just be from just too many writes to the disk at one time. That last file, /nix/store/dm7vy3dgsn9sp7nc8yqd7akjg4c64az8-tasty-quickcheck-0.8.4-doc does not exist on my system after recovery so I wonder if it is an I/O issue there. I'm going to run a disk diagnostic to see if something is wrong with the hardware, but I've never had the issue before the switch APFS. Any way, I want to see if others have a similar experience on High Sierra.

@m-idler

This comment has been minimized.

Show comment
Hide comment
@m-idler

m-idler Sep 28, 2017

I'm experiencing similar issues when starting a nix-shell that triggers several downloads via default.nix. After some time the system freezes as you described (sometimes only the mouse keeps responsible a little bit longer, but no clicking is possible).
The freeze itself is reproducible after hard reboot / new installation of nix. If it helps i can provide a verbose output of the build.

m-idler commented Sep 28, 2017

I'm experiencing similar issues when starting a nix-shell that triggers several downloads via default.nix. After some time the system freezes as you described (sometimes only the mouse keeps responsible a little bit longer, but no clicking is possible).
The freeze itself is reproducible after hard reboot / new installation of nix. If it helps i can provide a verbose output of the build.

@edolstra

This comment has been minimized.

Show comment
Hide comment
@edolstra

edolstra Sep 28, 2017

Member

@m-idler Are you also using APFS?

Member

edolstra commented Sep 28, 2017

@m-idler Are you also using APFS?

@m-idler

This comment has been minimized.

Show comment
Hide comment
@m-idler

m-idler Sep 28, 2017

@edolstra yes, it was converted automatically within the upgrade

m-idler commented Sep 28, 2017

@edolstra yes, it was converted automatically within the upgrade

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Sep 28, 2017

Member

@m-idler What hardware are you using? I'm running into this on the MacBook (Early 2016).

Member

matthewbauer commented Sep 28, 2017

@m-idler What hardware are you using? I'm running into this on the MacBook (Early 2016).

@whiteley

This comment has been minimized.

Show comment
Hide comment
@whiteley

whiteley Sep 29, 2017

I just experienced a similar issue on a Mac mini (Mid 2011) with a fusion drive formatted with hfs. I had installed nix 1.11.15 and was running the nix-darwin bootstrap when it failed. Similar to the first report, the last file listed was not present upon reboot thought the previous ones seem to be. I had to force the machine off with the power button.

The following messages were the last in /var/log/system.log before the BOOT_TIME message.

Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.lsb.02000000-0000-0000-0000-000000000000[1042]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[1020]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.05000000-0000-0000-0000-000000000000[1015]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.lsd[991]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.06000000-0000-0000-0000-000000000000[1016]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.08000000-0000-0000-0000-000000000000[1004]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.secd[1002]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.trustd.agent[992]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000[970]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.04000000-0000-0000-0000-000000000000[969]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.02000000-0000-0000-0000-000000000000[968]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.07000000-0000-0000-0000-000000000000[1014]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000[971]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.distnoted.xpc.agent[973]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.lsd[1076]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.distnoted.xpc.agent[1071]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000[1069]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.04000000-0000-0000-0000-000000000000[1067]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000[1070]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.02000000-0000-0000-0000-000000000000[1068]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]

To be clear, this was in High Sierra but since the machine doesn't have an SSD it was not converted to APFS.

whiteley commented Sep 29, 2017

I just experienced a similar issue on a Mac mini (Mid 2011) with a fusion drive formatted with hfs. I had installed nix 1.11.15 and was running the nix-darwin bootstrap when it failed. Similar to the first report, the last file listed was not present upon reboot thought the previous ones seem to be. I had to force the machine off with the power button.

The following messages were the last in /var/log/system.log before the BOOT_TIME message.

Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.lsb.02000000-0000-0000-0000-000000000000[1042]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.bundles[1020]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.05000000-0000-0000-0000-000000000000[1015]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.lsd[991]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.06000000-0000-0000-0000-000000000000[1016]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.08000000-0000-0000-0000-000000000000[1004]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.secd[1002]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.trustd.agent[992]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000[970]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.04000000-0000-0000-0000-000000000000[969]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.02000000-0000-0000-0000-000000000000[968]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.single.07000000-0000-0000-0000-000000000000[1014]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000[971]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:26 facet com.apple.xpc.launchd[1] (com.apple.distnoted.xpc.agent[973]): Service exited due to signal: Killed: 9 sent by nix-daemon[1049]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.lsd[1076]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.distnoted.xpc.agent[1071]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000[1069]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.04000000-0000-0000-0000-000000000000[1067]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000[1070]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]
Sep 28 17:29:41 facet com.apple.xpc.launchd[1] (com.apple.mdworker.shared.02000000-0000-0000-0000-000000000000[1068]): Service exited due to signal: Killed: 9 sent by nix-daemon[1309]

To be clear, this was in High Sierra but since the machine doesn't have an SSD it was not converted to APFS.

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Sep 29, 2017

Member

@matthewbauer Do you know if the xnu source for high sierra is out yet? That was definitely correct for older versions of the kernel but I wouldn't at all be surprised if it's just changed behavior now. cc @copumpkin

Member

shlevy commented Sep 29, 2017

@matthewbauer Do you know if the xnu source for high sierra is out yet? That was definitely correct for older versions of the kernel but I wouldn't at all be surprised if it's just changed behavior now. cc @copumpkin

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Sep 29, 2017

Member

Anyway I'll dig into this this weekend 😭

Member

shlevy commented Sep 29, 2017

Anyway I'll dig into this this weekend 😭

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Sep 29, 2017

Member

Can I get uname -a for someone on high sierra please?

Member

shlevy commented Sep 29, 2017

Can I get uname -a for someone on high sierra please?

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Sep 29, 2017

Member
Matthews-MacBook:~ mbauer$ uname -a
Darwin Matthews-MacBook.local 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
Member

matthewbauer commented Sep 29, 2017

Matthews-MacBook:~ mbauer$ uname -a
Darwin Matthews-MacBook.local 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Sep 29, 2017

Member

@matthewbauer thanks! Do you by chance have access to a machine with 10.12.6 you can run your test on?

Member

shlevy commented Sep 29, 2017

@matthewbauer thanks! Do you by chance have access to a machine with 10.12.6 you can run your test on?

@m-idler

This comment has been minimized.

Show comment
Hide comment
@m-idler

m-idler Sep 29, 2017

@matthewbauer my device is a MacBook Pro, Early 2015 with SSD, APFS with encryption enabled.

I got the same OS Version/uname output @matthewbauer posted

m-idler commented Sep 29, 2017

@matthewbauer my device is a MacBook Pro, Early 2015 with SSD, APFS with encryption enabled.

I got the same OS Version/uname output @matthewbauer posted

@bjtitus

This comment has been minimized.

Show comment
Hide comment
@bjtitus

bjtitus Sep 29, 2017

I've had the exact same issue for a while now. I also pulled several logs, some of which seem to include errors about running out of memory but that may be a red herring.

Console[25514]: Console(25514,0x7000010b9000) malloc: malloc_memory_event_handler: approaching memory limit. Starting stack-logging.
Console[25514]: Console(25514,0x7000010b9000) malloc: recording malloc (and VM allocation) stacks using lite mode

Some system info (10.13 GM Seed 17A362a on late 2016 MacBook Pro with APFS + FileVault):

17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 22:01:05 PDT 2017; root:xnu-4570.1.46~3/RELEASE_X86_64 x86_64

bjtitus commented Sep 29, 2017

I've had the exact same issue for a while now. I also pulled several logs, some of which seem to include errors about running out of memory but that may be a red herring.

Console[25514]: Console(25514,0x7000010b9000) malloc: malloc_memory_event_handler: approaching memory limit. Starting stack-logging.
Console[25514]: Console(25514,0x7000010b9000) malloc: recording malloc (and VM allocation) stacks using lite mode

Some system info (10.13 GM Seed 17A362a on late 2016 MacBook Pro with APFS + FileVault):

17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 22:01:05 PDT 2017; root:xnu-4570.1.46~3/RELEASE_X86_64 x86_64

@bjtitus

This comment has been minimized.

Show comment
Hide comment
@bjtitus

bjtitus Sep 29, 2017

@shlevy Not sure if you saw yet but the new xnu source code for the same version listed in the comments here was released yesterday https://opensource.apple.com/source/xnu/xnu-4570.1.46/

bjtitus commented Sep 29, 2017

@shlevy Not sure if you saw yet but the new xnu source code for the same version listed in the comments here was released yesterday https://opensource.apple.com/source/xnu/xnu-4570.1.46/

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Sep 29, 2017

Member

@bjtitus Ah, didn't realize it was just released yesterday! Thanks.

Member

shlevy commented Sep 29, 2017

@bjtitus Ah, didn't realize it was just released yesterday! Thanks.

@kirelagin

This comment has been minimized.

Show comment
Hide comment
@kirelagin

kirelagin Sep 29, 2017

Contributor

@shlevy

Do you by chance have access to a machine with 10.12.6 you can run your test on?

I tried this program on 10.12.6 for 30 times. It blanks the screen, but the system does not freeze.

Contributor

kirelagin commented Sep 29, 2017

@shlevy

Do you by chance have access to a machine with 10.12.6 you can run your test on?

I tried this program on 10.12.6 for 30 times. It blanks the screen, but the system does not freeze.

@Balletie

This comment has been minimized.

Show comment
Hide comment
@Balletie

Balletie Sep 30, 2017

Macbook Pro Early 2011, I'm having the same issue here after upgrading to High Sierra (wanted to upgrade to Sierra but they removed the downloads for that...).

Balletie commented Sep 30, 2017

Macbook Pro Early 2011, I'm having the same issue here after upgrading to High Sierra (wanted to upgrade to Sierra but they removed the downloads for that...).

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Sep 30, 2017

Member

As a workaround for the time being, single user nix mode should work.

Member

shlevy commented Sep 30, 2017

As a workaround for the time being, single user nix mode should work.

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Oct 1, 2017

Member

If anyone has NOT updated to High Sierra, they should try building Nix before updating at this commit:

3cc1b57

to see if it fixes this issue on updating to High Sierra (if you are already on High Sierra most likely you can't even build Nix without getting the hanging issue). Sadly, I can't test it right now, so not sure if it actually avoids the issue.

Member

matthewbauer commented Oct 1, 2017

If anyone has NOT updated to High Sierra, they should try building Nix before updating at this commit:

3cc1b57

to see if it fixes this issue on updating to High Sierra (if you are already on High Sierra most likely you can't even build Nix without getting the hanging issue). Sadly, I can't test it right now, so not sure if it actually avoids the issue.

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Oct 1, 2017

Member

@matthewbauer See my comment.

Member

shlevy commented Oct 1, 2017

@matthewbauer See my comment.

matthewbauer added a commit to matthewbauer/nix that referenced this issue Oct 1, 2017

@ktf

This comment has been minimized.

Show comment
Hide comment
@ktf

ktf Oct 2, 2017

@shlevy Can you point to instructions on how to install single user on mac? The installer seems to force me in multiuser by default.

ktf commented Oct 2, 2017

@shlevy Can you point to instructions on how to install single user on mac? The installer seems to force me in multiuser by default.

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Oct 2, 2017

Member

@ktf: @grahamc may be able to help with an installer that does this properly from the get-go, but I believe just chown -R ktf /nix and then unsetting NIX_REMOTE (also in your ~/.profile probably) should do the trick after installation.

Member

shlevy commented Oct 2, 2017

@ktf: @grahamc may be able to help with an installer that does this properly from the get-go, but I believe just chown -R ktf /nix and then unsetting NIX_REMOTE (also in your ~/.profile probably) should do the trick after installation.

@shlevy

This comment has been minimized.

Show comment
Hide comment
@ktf

This comment has been minimized.

Show comment
Hide comment
@ktf

ktf Oct 2, 2017

So I managed to build and install (and hopefully switch to) nix 1.11.15 + @matthewbauer patch (3cc1b57). However my mac still freezes. To update I did:

$ sudo su - # root builds in non-multiuser mode, apparently
$ git clone https://github.com/NixOS/nix
$ cd nix
$ git fetch https://github.com/matthewbauer
$ git reset --hard 1.11.15
$ git cherry-pick 3cc1b57
$ nix-build release.nix -A build.x86_64-darwin

which resulted in /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef . I then went on and made it the current nix for root with:

$ nix-env -i /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef
$ launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
$ launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist
$ sudo launchctl start org.nixos.nix-daemon

and checked it actually picked it up:

$ nix-env --version
nix-env (Nix) 1.11.15pre1234_abcdef
$ ps auxwww | grep nix
root             13554   0.0  0.0  4275264   1904   ??  Ss    2:31PM   0:00.01 /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef/bin/nix-daemon

I then opened a new user shell and changed it to use the new nix as well:

$ nix-env -i /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef

Finally I started building my top-level package once again:

$ nix-env -i all

but this still fails when doing "patching interpreter path" of some vim plugin. Am I doing anything wrong?

ktf commented Oct 2, 2017

So I managed to build and install (and hopefully switch to) nix 1.11.15 + @matthewbauer patch (3cc1b57). However my mac still freezes. To update I did:

$ sudo su - # root builds in non-multiuser mode, apparently
$ git clone https://github.com/NixOS/nix
$ cd nix
$ git fetch https://github.com/matthewbauer
$ git reset --hard 1.11.15
$ git cherry-pick 3cc1b57
$ nix-build release.nix -A build.x86_64-darwin

which resulted in /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef . I then went on and made it the current nix for root with:

$ nix-env -i /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef
$ launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
$ launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist
$ sudo launchctl start org.nixos.nix-daemon

and checked it actually picked it up:

$ nix-env --version
nix-env (Nix) 1.11.15pre1234_abcdef
$ ps auxwww | grep nix
root             13554   0.0  0.0  4275264   1904   ??  Ss    2:31PM   0:00.01 /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef/bin/nix-daemon

I then opened a new user shell and changed it to use the new nix as well:

$ nix-env -i /nix/store/2i38s6h7jfx39lfkd4srlv859vkbs7zj-nix-1.11.15pre1234_abcdef

Finally I started building my top-level package once again:

$ nix-env -i all

but this still fails when doing "patching interpreter path" of some vim plugin. Am I doing anything wrong?

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Oct 2, 2017

Member

@ktf try running Nix-daemon on its own with sudo nix-daemon to make sure it’s the right version (don’t use launchd)

Member

matthewbauer commented Oct 2, 2017

@ktf try running Nix-daemon on its own with sudo nix-daemon to make sure it’s the right version (don’t use launchd)

@jbaum98

This comment has been minimized.

Show comment
Hide comment
@jbaum98

jbaum98 Oct 2, 2017

I built nix with the new commit and ran the daemon using sudo nix-daemon, and now it seems to be building!

jbaum98 commented Oct 2, 2017

I built nix with the new commit and ran the daemon using sudo nix-daemon, and now it seems to be building!

@jbaum98

This comment has been minimized.

Show comment
Hide comment
@jbaum98

jbaum98 Oct 2, 2017

However, it still freezes if I exit a build early with Ctl-C

jbaum98 commented Oct 2, 2017

However, it still freezes if I exit a build early with Ctl-C

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Oct 21, 2017

Member

For the people who switched to single-user mode, have there been any weird issues? This could be unrelated but I've also gotten builds that seem to be stuck but not really doing anything. Other weirdness afterwards like Activity Monitor not working:

screen shot 2017-10-20 at 11 02 26 pm

It's certainly better than the kernel panic thing... Anyway if anyone has had similar issues please give feedback! (I'm still not 100% this is caused by Nix but can't think of anything else I've been doing.

Edit
Yeah, this is happening on latest High Sierra available.

Member

matthewbauer commented Oct 21, 2017

For the people who switched to single-user mode, have there been any weird issues? This could be unrelated but I've also gotten builds that seem to be stuck but not really doing anything. Other weirdness afterwards like Activity Monitor not working:

screen shot 2017-10-20 at 11 02 26 pm

It's certainly better than the kernel panic thing... Anyway if anyone has had similar issues please give feedback! (I'm still not 100% this is caused by Nix but can't think of anything else I've been doing.

Edit
Yeah, this is happening on latest High Sierra available.

@peterromfeldhk

This comment has been minimized.

Show comment
Hide comment
@peterromfeldhk

peterromfeldhk Oct 21, 2017

peterromfeldhk commented Oct 21, 2017

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Oct 25, 2017

Member

So the new issue I'm getting (in single-user mode) looks like it's the same as hishamhm/htop#682. It only happens after intensive CPU usage in Nix... Probably not related to Nix (more High Sierra bugs).

Member

matthewbauer commented Oct 25, 2017

So the new issue I'm getting (in single-user mode) looks like it's the same as hishamhm/htop#682. It only happens after intensive CPU usage in Nix... Probably not related to Nix (more High Sierra bugs).

@diclophis

This comment has been minimized.

Show comment
Hide comment
@diclophis

diclophis Oct 26, 2017

I am very interested in what details of the crash overlap between this bug, and the htop issue

diclophis commented Oct 26, 2017

I am very interested in what details of the crash overlap between this bug, and the htop issue

@whiteley

This comment has been minimized.

Show comment
Hide comment
@whiteley

whiteley Oct 31, 2017

Running the script @matthewbauer posted no longer causes a kernel panic on my machine after applying the just released 10.13.1 update.

$ uname -v
Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64

whiteley commented Oct 31, 2017

Running the script @matthewbauer posted no longer causes a kernel panic on my machine after applying the just released 10.13.1 update.

$ uname -v
Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64
@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Oct 31, 2017

Member

@whiteley

Sadly I'm still having the nix-build freeze issue on 10.13.1 when running multi-user Nix. Going to switch back to single-user and see if any issues come up.

EDIT
But I can confirm that the issue reported by @shlevy and tested for in kernel-panic.sh isn't happening.

Member

matthewbauer commented Oct 31, 2017

@whiteley

Sadly I'm still having the nix-build freeze issue on 10.13.1 when running multi-user Nix. Going to switch back to single-user and see if any issues come up.

EDIT
But I can confirm that the issue reported by @shlevy and tested for in kernel-panic.sh isn't happening.

@whiteley

This comment has been minimized.

Show comment
Hide comment
@whiteley

whiteley Oct 31, 2017

@matthewbauer that's unfortunate. I've run the script a few times without a panic. I'll modify it to run longer and try that to see if it changes. I've run a few builds (multi-user) as well without the immediate panic. As a reminder, I'm not using APFS though it would be very odd if we were talking about two different bugs here.

EDIT
I've now gotten more freezes as well though I was able to bootstrap darwin-nix which I couldn't do on 10.13.0. I guess I'll go back to single user for now as well.

EDIT2
After more testing, I've found that I seem to be able to use multi-user mode with nix.maxJobs = 1; and I've run a number of large builds without freezes now. I'm not familiar enough with the environment to know if that information helps identifying the underlying issue.

whiteley commented Oct 31, 2017

@matthewbauer that's unfortunate. I've run the script a few times without a panic. I'll modify it to run longer and try that to see if it changes. I've run a few builds (multi-user) as well without the immediate panic. As a reminder, I'm not using APFS though it would be very odd if we were talking about two different bugs here.

EDIT
I've now gotten more freezes as well though I was able to bootstrap darwin-nix which I couldn't do on 10.13.0. I guess I'll go back to single user for now as well.

EDIT2
After more testing, I've found that I seem to be able to use multi-user mode with nix.maxJobs = 1; and I've run a number of large builds without freezes now. I'm not familiar enough with the environment to know if that information helps identifying the underlying issue.

@pagzamaphone

This comment has been minimized.

Show comment
Hide comment
@pagzamaphone

pagzamaphone Nov 10, 2017

Just a note, I was having this issue, I have since updated to OSX 10.13.2 Beta (17C60c) and nix-1.11.15 and no longer have the freezing system issue.

pagzamaphone commented Nov 10, 2017

Just a note, I was having this issue, I have since updated to OSX 10.13.2 Beta (17C60c) and nix-1.11.15 and no longer have the freezing system issue.

@copumpkin

This comment has been minimized.

Show comment
Hide comment
@copumpkin

copumpkin Nov 10, 2017

Member

Awesome!

Member

copumpkin commented Nov 10, 2017

Awesome!

@grahamc

This comment has been minimized.

Show comment
Hide comment
@grahamc

grahamc Nov 11, 2017

Member

I've started a build of several hundred drvs on 10.13.2 beta. About 30min in and no freezes. Could this be it? :)

Member

grahamc commented Nov 11, 2017

I've started a build of several hundred drvs on 10.13.2 beta. About 30min in and no freezes. Could this be it? :)

@periklis

This comment has been minimized.

Show comment
Hide comment
@periklis

periklis Nov 12, 2017

great news.

periklis commented Nov 12, 2017

great news.

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Nov 13, 2017

Member

Awesome! 10.13.2 works for me so far. I can close this issue as soon as it is released!

Member

matthewbauer commented Nov 13, 2017

Awesome! 10.13.2 works for me so far. I can close this issue as soon as it is released!

@ryantrinkle

This comment has been minimized.

Show comment
Hide comment
@ryantrinkle

ryantrinkle Nov 15, 2017

Contributor

@grahamc How did those builds go?

Contributor

ryantrinkle commented Nov 15, 2017

@grahamc How did those builds go?

@grahamc

This comment has been minimized.

Show comment
Hide comment
@grahamc

grahamc Nov 15, 2017

Member
Member

grahamc commented Nov 15, 2017

@grahamc

This comment has been minimized.

Show comment
Hide comment
@grahamc

grahamc Nov 15, 2017

Member

FWIW I consider this a success. Nix isn't causing horrific crashes anymore.

Member

grahamc commented Nov 15, 2017

FWIW I consider this a success. Nix isn't causing horrific crashes anymore.

@ryantrinkle

This comment has been minimized.

Show comment
Hide comment
@ryantrinkle

ryantrinkle Nov 15, 2017

Contributor

Awesome! Sounds like, once the 10.13.2 drops, we're in the clear :)

Contributor

ryantrinkle commented Nov 15, 2017

Awesome! Sounds like, once the 10.13.2 drops, we're in the clear :)

@shlevy

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Nov 18, 2017

Member

@grahamc Of course, by any reasonable definition it was never Nix causing the crashes 😉

Member

shlevy commented Nov 18, 2017

@grahamc Of course, by any reasonable definition it was never Nix causing the crashes 😉

@onetom

This comment has been minimized.

Show comment
Hide comment
@onetom

onetom Nov 28, 2017

A nix-env -iA dapphub.{dapp,seth,hevm,evmdis} just hung my macOS 10.13.1 using Nix 1.11.15, but after upgrading to macOS 10.13.2 Beta (17C79a), the installation has succeeded (in about 30minutes, so it put quite a strain on the system).

onetom commented Nov 28, 2017

A nix-env -iA dapphub.{dapp,seth,hevm,evmdis} just hung my macOS 10.13.1 using Nix 1.11.15, but after upgrading to macOS 10.13.2 Beta (17C79a), the installation has succeeded (in about 30minutes, so it put quite a strain on the system).

@puppe

This comment has been minimized.

Show comment
Hide comment
@puppe

puppe Dec 4, 2017

nix-channel --update freezes my Mac as well most of the time. Could that be related? I have switched to "single-user mode" as suggested above. That seems to fix it. (I cannot tell for certain because it used to work sometimes without freezing.)

puppe commented Dec 4, 2017

nix-channel --update freezes my Mac as well most of the time. Could that be related? I have switched to "single-user mode" as suggested above. That seems to fix it. (I cannot tell for certain because it used to work sometimes without freezing.)

@matthewbauer

This comment has been minimized.

Show comment
Hide comment
@matthewbauer

matthewbauer Dec 6, 2017

Member

Looks like 10.13.2 is released! So far so good.

Member

matthewbauer commented Dec 6, 2017

Looks like 10.13.2 is released! So far so good.

@alexvorobiev

This comment has been minimized.

Show comment
Hide comment
@alexvorobiev

alexvorobiev Feb 9, 2018

@shlevy It is actually very easy to install in single user mode since the code is still in the install script. Just comment the if statement which calls the multiuser setup for Darwin and run the script.

I wonder can't we have the single user setup back as an option? In enterprise environments users normally don't have administrator's rights to their laptops. One top level directory (/nix) could be ok but extensive system changes (additional local users, services) are usually out of question.

alexvorobiev commented Feb 9, 2018

@shlevy It is actually very easy to install in single user mode since the code is still in the install script. Just comment the if statement which calls the multiuser setup for Darwin and run the script.

I wonder can't we have the single user setup back as an option? In enterprise environments users normally don't have administrator's rights to their laptops. One top level directory (/nix) could be ok but extensive system changes (additional local users, services) are usually out of question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment