i#5054: Fix attach crash and other problems #5230
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a number of issues with Linux attach:
Set xdi to zero for x86 _start relocation of libdynamorio.
Implement remote memset for .bss zeroing in elf_loader_map_phdrs(),
fixing a crash in some builds such as Ubuntu20 release build.
Don't kill target if attach fails.
Fix crash if no pid passed.
Adds a useful error message on failure to look at ptrace permissions.
Adds a warning to use -skip_syscall if attach hangs.
Adds a test by porting the Windows client.attach test to Linux.
Disables the mprotect syscall due to weird failures which need to be
examined.
Further tests of blocking syscalls and -skip_syscall are needed.
Re-enables the attach help message for drrun and the deployment docs.
Tested release build on Ubuntu20 where the .bss crash reproduced every
run and is now gone.
Tested "ctest --repeat-until-fail 100 -V -R client.attach" on Ubuntu20
and on a Debian-ish system: no failures.
Issue: #38, #5054
Fixes #5054