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

Avoid blind syslog during init #4729

Merged
merged 2 commits into from
Feb 11, 2021
Merged

Avoid blind syslog during init #4729

merged 2 commits into from
Feb 11, 2021

Conversation

derekbruening
Copy link
Contributor

Avoids printing of an internal warning during early initialization for
single-bitwidth setups regardless of -stderr_mask by moving options
init even earlier.

To avoid DR heap init messing up the app's brk setup, moves heap init
out of the options init and into the later half. This undoes the
early heap init from PR #4726, which is worked around by switching to
a stack buffer for -arch_init. This seems safer in any case, delaying
heap init and client lib loads until after the app's interpreter is
loaded.

Issue: #4719

Avoids printing of an internal warning during early initialization for
single-bitwidth setups regardless of -stderr_mask by moving options
init even earlier.

To avoid DR heap init messing up the app's brk setup, moves heap init
out of the options init and into the later half.  This undoes the
early heap init from PR #4726, which is worked around by switching to
a stack buffer for -arch_init.  This seems safer in any case, delaying
heap init and client lib loads until after the app's interpreter is
loaded.

Issue: #4719
@derekbruening
Copy link
Contributor Author

x86 failures is #4711 delay-global & co. yet again.
The Jenkins a64 failures: do not yet know what that is.

@derekbruening
Copy link
Contributor Author

The Jenkins failures I can reproduce on the tx1: it seems that DR is reloaded every time because !dynamorio_lib_gap_empty() and somehow the reload causes it to no longer parse the options with this PR's shift in option parsing: which makes no sense because it should start completely over. Still trying to figure it out (and why the gap is always non-empty).

@derekbruening
Copy link
Contributor Author

why the gap is always non-empty).

Here's why: the kernel always put vvar+vdso in between:

derek@tx1:~$ cat /proc/9442/maps
ffff82998000-ffff82d96000 r-xp 00000000 08:03 5374901                    /home/derek/dr/build/lib64/debug/libdynamorio.so
ffff82da4000-ffff82da5000 r--p 00000000 00:00 0                          [vvar]
ffff82da5000-ffff82da6000 r-xp 00000000 00:00 0                          [vdso]
ffff82da6000-ffff82dca000 rw-p 003fe000 08:03 5374901                    /home/derek/dr/build/lib64/debug/libdynamorio.so
ffff82dca000-ffff82e02000 rw-p 00000000 00:00 0 
ffffeee05000-ffffeee26000 rw-p 00000000 00:00 0                          [stack]

@derekbruening
Copy link
Contributor Author

d_r_config_init() deletes the 1config file is the culprit:

deleting config file /home/derek/.dynamorio/linux.mmap.9609.1config64
options_init: incoming |-code_api "-stderr_mask" "0"|
Reloading
options_init: incoming ||

@derekbruening derekbruening merged commit 6667641 into master Feb 11, 2021
@derekbruening derekbruening deleted the iX-avoid-blind-print branch February 11, 2021 17:38
derekbruening added a commit that referenced this pull request Feb 19, 2021
Fixes a bug introduced by PR #4729 which swapped a heap buffer for a
stack buffer but placed the buffer in a too-deep scope.

Manually tested via:
$ qemu-aarch64 -L /usr/aarch64-linux-gnu bin64/drrun -xarch_root /usr/aarch64-linux-gnu -- suite/tests/bin/simple_app
$ qemu-arm -L /usr/arm-linux-gnueabihf bin32/drrun -xarch_root /usr/arm-linux-gnueabihf -- suite/tests/bin/simple_app

Forthcoming test suite support for running under qemu will add CI
tests that will avoid such regressions in the future.

Issue: #4719
derekbruening added a commit that referenced this pull request Feb 19, 2021
Fixes a bug introduced by PR #4729 which swapped a heap buffer for a
stack buffer but placed the buffer in a too-deep scope.

Manually tested via:
$ qemu-aarch64 -L /usr/aarch64-linux-gnu bin64/drrun -xarch_root /usr/aarch64-linux-gnu -- suite/tests/bin/simple_app
$ qemu-arm -L /usr/arm-linux-gnueabihf bin32/drrun -xarch_root /usr/arm-linux-gnueabihf -- suite/tests/bin/simple_app

Forthcoming test suite support for running under qemu will add CI
tests that will avoid such regressions in the future.

Issue: #4719
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.

2 participants