investigating memory error in runtime shutdown