[PR #652] [MERGED] fix: avoid closing pty master fd twice #560

Closed
opened 2026-02-25 20:34:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/652
Author: @kxxt
Created: 10/5/2024
Status: Merged
Merged: 10/5/2024
Merged by: @ku1ik

Base: developHead: fix-double-close


📝 Commits (1)

  • 848ab8e fix: avoid closing pty master fd twice

📊 Changes

1 file changed (+8 additions, -8 deletions)

View changed files

📝 src/pty.rs (+8 -8)

📄 Description

The pty master fd is closed twice, once when dropping OwnedFd in fn exec and once when dropping File constructed with unsafe code in fn copy.

This causes IO Safety violation1 and should be avoided. It becomes a crash in debug build2.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/652 **Author:** [@kxxt](https://github.com/kxxt) **Created:** 10/5/2024 **Status:** ✅ Merged **Merged:** 10/5/2024 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `fix-double-close` --- ### 📝 Commits (1) - [`848ab8e`](https://github.com/asciinema/asciinema/commit/848ab8e74443dce7a7d45a5ea03e50996b058785) fix: avoid closing pty master fd twice ### 📊 Changes **1 file changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/pty.rs` (+8 -8) </details> ### 📄 Description The pty master fd is closed twice, once when dropping OwnedFd in `fn exec` and once when dropping File constructed with unsafe code in `fn copy`. This causes IO Safety violation[^1] and should be avoided. It becomes a crash in debug build[^2]. [^1]: https://github.com/rust-lang/rust/commit/1ba00d9cb2fcfef464b6a188fa3a7543c66eecaa [^2]: https://github.com/zed-industries/zed/issues/12114 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:34:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#560
No description provided.