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

Sometimes syspolicyd completely freezes my Mac #1307

Open
wojciech-kulik opened this issue Jan 28, 2025 · 6 comments
Open

Sometimes syspolicyd completely freezes my Mac #1307

wojciech-kulik opened this issue Jan 28, 2025 · 6 comments

Comments

@wojciech-kulik
Copy link

wojciech-kulik commented Jan 28, 2025

Hi,

I experience a complete freeze on my macOS from time to time. It started happening when I installed nix-darwin, a couple of months ago.

I managed to pin down the issue (because sometimes I've got still time before the complete freeze) and it turns out that most likely syspolicyd process is causing that. It starts using a lot of CPU, I manged to show details and I see that it opens /nix/store/.links. When everything is normal, this file is not on the list.

Image

Any idea what could be causing that? And more important how to fix it?
As it happens from time to time, maybe it's related to garbage collecting/hard links optimization?

I have to hard reset my computer every time it happens (by holding the power button).

My config:
MacBook Pro M1 Pro, 2021, 16GB RAM
macOS Sequoia 15.3 (I experienced it on previous versions as well).

@Enzime
Copy link
Collaborator

Enzime commented Jan 29, 2025

Are you using any kernel extensions?

@wojciech-kulik
Copy link
Author

I don't even know what kernel extensions are :D But I'm not using anything crazy.
Just regular apps + nix, I didn't make any changes to macOS SIP or anything like that.

@Enzime
Copy link
Collaborator

Enzime commented Jan 29, 2025

Do you have nix.settings.auto-optimise-store or nix.optimise.automatic enabled?

@wojciech-kulik
Copy link
Author

Yes, here is my config:

 nix.gc = {
    automatic = true;
    interval = [
      {
        Hour = 10;
        Minute = 0;
        Weekday = 1;
      }
    ];
    options = "--delete-older-than 6d";
  };

  nix.optimise = {
    automatic = true;
    interval = [
      {
        Hour = 10;
        Minute = 0;
        Weekday = 2;
      }
    ];
  };

Thank you for helping with that!

@wojciech-kulik
Copy link
Author

So it seems like it matches nix.optiimise. The screenshot was taken on Tuesday at 10:43.

@wojciech-kulik
Copy link
Author

wojciech-kulik commented Jan 29, 2025

I found an old screenshot with the same problem that occurred on Nov 4, 2024 (Monday) at 10:21 and based on my config on Monday gc is scheduled and I also remember that sometimes it happened two days in a row, so I guess gc might be causing the same issue. I'm not sure about the internals, but maybe optimise is a part of gc steps?

Image

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

No branches or pull requests

2 participants