granian icon indicating copy to clipboard operation
granian copied to clipboard

test_embed Fatal error for IO Safety violation

Open Noahnut opened this issue 3 months ago • 1 comments

Description

When running the unit test test_embed.py, the process aborts with the following error:

Fatal runtime error: IO Safety violation: owned file descriptor already closed, aborting
Fatal Python error: Aborted

The crash looks like it is triggered during shutdown / worker stopping logic in the Rust side. From debugging, it seems there may be a duplicate Stopping worker call, which could result in the same file descriptor being closed twice (violating Rust’s IO safety guarantees).

Steps to Reproduce

Create a virtual environment with Python 3.13

Install project dependencies

Run:

pytest -vv tests/test_embed.py

Observer

Crash with fatal runtime error: IO Safety violation: owned file descriptor already closed, aborting Fatal Python error: Aborted

Screenshot

Image

If possible, I would like to try fixing this issue. Thank you.

Noahnut avatar Sep 08 '25 15:09 Noahnut

If possible, I would like to try fixing this issue.

@Noahnut sure thing. Feel free to open a PR.

gi0baro avatar Sep 09 '25 09:09 gi0baro