On platforms where .attach_pid file is used to initate the attach it may remain in the process cwd after the attach attempt is finished.
Consider the sequence:
- attach process is started, VirtualMachineImpl.createAttachFile creates a file `"/proc/" + pid + "/cwd/" + ".attach_pid" + pid`
- process (pid) dies before we actually attached (and /proc/pid/cwd link is removed)
- after timeout it tries to delete .attach_pid file in the finally block and fail because cwd link from proc is no longer available
And the file remain in the real cwd folder (where /proc/pid/cwd link was pointing).