Skip to content

Conversation

@StaCu
Copy link
Contributor

@StaCu StaCu commented May 14, 2025

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 closed

This 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:

  1. interrupt.rs: let _ = close(self.interrupt.as_raw_fd()); in the Tapasco-Interrupt Drop implementation.
  2. 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) in interrupt.rs for Interrupt (tested) and SimInterrupt (untested).

Since there is no impl Drop for EventFd in the nix-rust Repository, I verified that it nonetheless closes the fd by listing open fds using ls -l /proc/<proc_id>/fd/ at different points during runtime.

@tsmk94 tsmk94 self-requested a review May 14, 2025 11:38
Copy link
Contributor

@tsmk94 tsmk94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for investigating!

@tsmk94 tsmk94 merged commit e07f978 into develop May 14, 2025
@tsmk94 tsmk94 deleted the feature/hotfix-rustc-1.80 branch May 14, 2025 11:41
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.

3 participants