-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
BoehmGCStackAllocator: ignore stack protection page #4264
BoehmGCStackAllocator: ignore stack protection page #4264
Conversation
Update: Boehm GC seems to be incompatible with coroutines. I haven't gotten to the bottom of this, but disabling GC during source addition seems like an acceptable workaround. |
Eh. That seems super ugly. It's probably better to go back to the old situation (i.e. not having GC roots on coroutine stacks). |
I agree. I wish it was simple.
What would that old situation be? I know #4030 introduced a case of evaluation in coroutines but #3931 predates that. It seems likely that the mere existence of a coroutine can crash the collector. The gdb stack traces all point to the collector code that finds roots in the stacks of all threads. These seem to be the options to move forward:
I hope this can be fixed soon. 1 and 6 seem to be the shortest paths to a Nix that doesn't crash. |
Honestly, we might consider replacing coroutines with plain old threads? |
Yesterday I debugged a nixops deployment where the evaluation resulted in a segfault (that was hidden by {
minimal_segfault_example = { pkgs, lib, config, ... }: {
environment.etc."foo".text = "${builtins.path {
path = pkgs.path;
filter = pkgs.lib.cleanSourceFilter;
name = "nixpkgs-${pkgs.lib.version}";
}}";
};
} Long story short, this PR appears to solve the problem. In case anybody else stumbles upon this issue as well, the workaround is quite easy, just do Unfortunately I didn't closely follow the changes related to that, so I don't have an actual opinion on how to proceed here. cc @lheckemann |
For others who land on this page. Until there's a proper fix, you may try adding
this seems to allow IFD to complete successfully for me |
I marked this as stale due to inactivity. → More info |
I suspect this is still a problem. |
We might have learned something more if we'd merged the first commit. We can still do that. At least that's a proper fix for the problem where GC causes an apparent "stack overflow". Crashes should be top priority, right? For me they are, but the lack of action from the maintainers of the project on this issue has made me follow their example. I regret that, but I'm glad I could avoid an alternative that would have been worse. If someone could make a decision, that would be nice. |
My example from above still segfaults on 2.4 and evaluates fine on 2.3, so this is still a problem. That said I'm starting to wonder if it was a good idea to "disband the Nix core team" (RFC0044) in favor of the steering committee. The first team was solely "responsible" for the development of Nix itself, the second one is responsible for the development of the entire ecosystem. Having an unfixed crash on a - well - unstable, but heavily & officially used version of Nix for months - even though there's a working fix - is IMHO a symptom of that, just as a rather non-transparent roadmap is. Don't get me wrong - I use nixUnstable myself and I'm fairly grateful for the work that has been done here, but I'm starting to ask myself if such a team that used to bring in a certain kind of structure is what's missing in the ongoing Nix 2.4 development. But anways, cc @edolstra for the actual problem. |
Done in #4944 |
Fix potential cause of #4178 (comment)