Hotfix: rustc 1.80.0 fatal runtime error #404
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of rustc 1.80.0 running tapasco runtime with debug enabled will crash with
fatal runtime error: IO Safety violation: owned file descriptor already closedThis is due to a change in rust PR 124210, which aborts a process when fd ownership is violated (as is the case when e.g. double closing an fd).
Tapasco closes each interrupt fd twice:
interrupt.rs:let _ = close(self.interrupt.as_raw_fd());in the Tapasco-Interrupt Drop implementation.nix::eventfd::EventFd: Tapasco uses EventFd to wrap the underlying fd safely, i.e. it closes the fd automatically when going out of scope.This PR removes the call to
close(eventfd)ininterrupt.rsfor Interrupt (tested) and SimInterrupt (untested).Since there is no
impl Drop for EventFdin the nix-rust Repository, I verified that it nonetheless closes the fd by listing open fds usingls -l /proc/<proc_id>/fd/at different points during runtime.