Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#5054: Fix attach crash and other problems #5230

Merged
merged 2 commits into from
Nov 29, 2021
Merged

Conversation

derekbruening
Copy link
Contributor

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

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
Copy link
Contributor

@abhinav92003 abhinav92003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@derekbruening derekbruening merged commit 800ba1d into master Nov 29, 2021
@derekbruening derekbruening deleted the i5054-attach-bss branch November 29, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux PID attach feature causes application to segfault
2 participants