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

Fix "unexpected EOF" errors on macOS #8049

Merged
merged 5 commits into from
Mar 16, 2023
Merged

Conversation

edolstra
Copy link
Member

Motivation

Hopefully fixes #3137, #3605, #7242, #7702.

Context

See c536e00 for detailed explanation.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.

Hopefully this fixes "unexpected EOF" failures on macOS
(NixOS#3137, NixOS#3605, NixOS#7242, NixOS#7702).

The problem appears to be that under some circumstances, macOS
discards the output written to the slave side of the
pseudoterminal. Hence the parent never sees the "sandbox initialized"
message from the child, even though it succeeded. The conditions are:

* The child finishes very quickly. That's why this bug is likely to
  trigger in nix-env tests, since that uses a builtin builder. Adding
  a short sleep before the child exits makes the problem go away.

* The parent has closed its duplicate of the slave file
  descriptor. This shouldn't matter, since the child has a duplicate
  as well, but it does. E.g. moving the close to the bottom of
  startBuilder() makes the problem go away. However, that's not a
  solution because it would make Nix hang if the child dies before
  sending the "sandbox initialized" message.

* The system is under high load. E.g. "make installcheck -j16" makes
  the issue pretty reproducible, while it's very rare under "make
  installcheck -j1".

As a fix/workaround, we now open the pseudoterminal slave in the
child, rather than the parent. This removes the second condition
(i.e. the parent no longer needs to close the slave fd) and I haven't
been able to reproduce the "unexpected EOF" with this.
@Ericson2314
Copy link
Member

@edolstra This seems pretty close to #8023. Perhaps we should do both?

@edolstra
Copy link
Member Author

We should do #8023 as well, but I think the only overlap is the removal of writing usingUserNamespace to the parent.

@thufschmitt
Copy link
Member

This seems to have broken the daemon installer tests which now time out (https://hydra.nixos.org/build/213036858 and following). @edolstra any idea what might be going on?

@edolstra
Copy link
Member Author

That's fixed by #8077.

goodlyrottenapple added a commit to runtimeverification/evm-semantics that referenced this pull request Mar 5, 2024
A newer version of nix should incorporate these fixes NixOS/nix#8049
rv-jenkins added a commit to runtimeverification/evm-semantics that referenced this pull request Mar 6, 2024
* deps/pyk_release: Set Version v0.1.676

* kevm-pyk/: sync poetry files pyk version v0.1.676

* deps/k_release: sync release file version 6.3.25

* flake.{nix,lock}: update Nix derivations

* Set Version: 1.0.478

* deps/pyk_release: Set Version v0.1.678

* kevm-pyk/: sync poetry files pyk version v0.1.678

* flake.{nix,lock}: update Nix derivations

* deps/pyk_release: Set Version v0.1.679

* kevm-pyk/: sync poetry files pyk version v0.1.679

* flake.{nix,lock}: update Nix derivations

* deps/pyk_release: Set Version v0.1.680

* kevm-pyk/: sync poetry files pyk version v0.1.680

* flake.{nix,lock}: update Nix derivations

* Set Version: 1.0.479

* Set Version: 1.0.479

* deps/pyk_release: Set Version v0.1.681

* kevm-pyk/: sync poetry files pyk version v0.1.681

* flake.{nix,lock}: update Nix derivations

* Try newer version of nix

A newer version of nix should incorporate these fixes NixOS/nix#8049

* bump cachix action

* Update install-nix-action

* Set Version: 1.0.481

* kevm-pyk/: sync poetry files pyk version v0.1.681

* Set Version: 1.0.482

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Andrei Văcaru <[email protected]>
Co-authored-by: Samuel Balco <[email protected]>
Co-authored-by: Everett Hildenbrandt <[email protected]>
runeksvendsen added a commit to runeksvendsen/dump-decls that referenced this pull request Apr 14, 2024
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

Successfully merging this pull request may close these issues.

while installing nix - 'nss-cacert-3.46' error: unexpected EOF reading a line
3 participants