Closed jamesborg46 closed 3 years ago
The following code results in double free or corruption (!prev) error using: atari-py 0.2.9 garage 2021.3.0 gym 0.15.7
double free or corruption (!prev)
from garage.envs import GymEnv import gym import gym.wrappers import gym.envs.atari import copy env = gym.envs.atari.AtariEnv('breakout') env.spec = gym.envs.registration.EnvSpec('NoFrameskip-v0') env = gym.wrappers.AtariPreprocessing(env) env = GymEnv(env, max_episode_length=1000) copy.deepcopy(env) copy.deepcopy(env)
The issue only occurs on the second deepcopy.
https://github.com/rlworkgroup/garage/blob/2c5410e65680baf2d62d53eea42cfc4344e090a7/src/garage/envs/gym_env.py#L349 Editing the above line to if 'viewer' in env.__dict__ and env.__dict__['viewer'] is not None: fixed this for me, but I did not look deeply into the issue so this might not be the most appropriate fix.
if 'viewer' in env.__dict__ and env.__dict__['viewer'] is not None:
The following code results in
double free or corruption (!prev)
error using: atari-py 0.2.9 garage 2021.3.0 gym 0.15.7The issue only occurs on the second deepcopy.
https://github.com/rlworkgroup/garage/blob/2c5410e65680baf2d62d53eea42cfc4344e090a7/src/garage/envs/gym_env.py#L349 Editing the above line to
if 'viewer' in env.__dict__ and env.__dict__['viewer'] is not None:
fixed this for me, but I did not look deeply into the issue so this might not be the most appropriate fix.