Farama-Foundation / Farama-Foundation/Arcade-Learning-Environment

Closing environment causes a crash

Open
#499 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
477
Avg merge
11h 11m
Merged PRs (30d)
3

Description

```py
import gymnasium as gym

game_name = 'ALE/MontezumaRevenge-v5'
env = gym.make(game_name, render_mode="human")
obs, _ = env.reset()
env.close()

import time

print("sleeping")
time.sleep(5)
```

What's expected is that the game would open and close, you'd see text "sleeping", and after 5s, the program exits. What actually happens is that the game window stays up for 5s, after which the program exits. The actual game renders properly until you try to close it, this example does not demonstrate that part since it is working as expected.

This bug is made worse in Jupyter, where this causes the Python kernel to crash if you try to render the game.

Using version 0.8.1 on Ubuntu 22.04.

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by running the supplied Python reproduction on Ubuntu 22.04, then trace the environment close and rendering lifecycle; done means the game window closes before the 5-second sleep, the process exits normally, and rendering does not crash a Jupyter kernel.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.