ptrace method bug fixing