Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Waterworld random freezes #840

Closed
jjshoots opened this issue Oct 29, 2022 · 0 comments
Closed

[Bug Report] Waterworld random freezes #840

jjshoots opened this issue Oct 29, 2022 · 0 comments

Comments

@jjshoots
Copy link
Member

jjshoots commented Oct 29, 2022

Describe the bug
Not quite sure what it is yet, but when waterworld is continuously stepped and reset, sometimes it just freezes.

Code example

from pettingzoo.sisl import waterworld_v4

env = waterworld_v4.parallel_env(
    render_mode="rgb_array",
    n_obestacles=2,
    obstacle_coord=None,
)

iters = 0
while True:
    env.reset()
    terms = [False]
    truncs = [False]
    print(iters)
    while not (any(terms) or any(truncs)):
        iters += 1

        # sample_actions
        action_dict = {
            a: env.action_space(a).sample() for a in env.possible_agents
        }

        # step env
        next_obs, rew, terms, truncs, _ = env.step(action_dict)

        terms = terms.values()
        truncs = truncs.values()

Managed to replicate it on 3 different machines, my guess is that there's a rogue while loop somewhere according to the diagnosis below.

The logs of the run are here

Notice by the 2 hour mark everything grinds to a halt. It's not a memory leak AFAICT.

What's weird is that when running the above script, when it freezes and you ctrl-c, it continues running after that. Here's the stack trace:

0
500
1000
1500
2000
2500
3000
3500
4000
^CException ignored from cffi callback <function CollisionHandler._set_separate.<local
s>.cf at 0x7f060d4d52d0>:
Traceback (most recent call last):
  File "/home/jet/Sandboxes/waterworld_sweep/venv/lib/python3.10/site-packages/pymunk/
collision_handler.py", line 199, in cf
    func(Arbiter(_arb, self._space), self._space, self._data)
  File "/home/jet/Sandboxes/waterworld_sweep/venv/lib/python3.10/site-packages/petting
zoo/sisl/waterworld/waterworld_base.py", line 697, in pursuer_evader_separate_callback
    x, y = self._generate_coord(evader_shape.radius)
  File "/home/jet/Sandboxes/waterworld_sweep/venv/lib/python3.10/site-packages/petting
zoo/sisl/waterworld/waterworld_base.py", line 250, in _generate_coord
    while (
KeyboardInterrupt:
4500
5000
5500
6000
6500
7000
7500

WillDudley pushed a commit that referenced this issue Oct 29, 2022
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

No branches or pull requests

2 participants