Skip to content
New issue

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

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

Already on GitHub? # to your account

dcc dual sanitizer desynchronization when printing pointers #80

Open
XavierCooney opened this issue Aug 14, 2022 · 1 comment
Open

dcc dual sanitizer desynchronization when printing pointers #80

XavierCooney opened this issue Aug 14, 2022 · 1 comment

Comments

@XavierCooney
Copy link
Contributor

XavierCooney commented Aug 14, 2022

Compiling the following code with dcc --leak-check results in a loss of sanitizer synchronization (and so loss of leak checking):

#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv) {
	void *p = malloc(1);
	printf("%p\n", p);
}

Some output from when using DCC_DEBUG=3:

sanitizer2:     __dcc_start debug_level=3
sanitizer2:     setenv DCC_SANITIZER=VALGRIND
sanitizer2:     setenv DCC_PATH=/home/xav/dcc_test/dcc/dcc
sanitizer2:     setenv DCC_PID=26657
sanitizer2:     initialized 0x1ffec18260 to 0x1fff000260
sanitizer2:     initialized 0x1ffec182e0 to 0x1fff0002e0
sanitizer2:     synchronize_system_call(write, 10)
sanitizer1: synchronize_system_call error(write, 15) n == 10
sanitizer1: warning: sanitizer synchronization lost
sanitizer1: disconnect_sanitizers()
sanitizer1: killing sanitizer2 pid=26657 and unlinking executable

When using valgrind, malloc returns pointers with smaller addresses, and so the output of %p is shorter when using valgrind, so the write syscalls end up with different sizes from the two sanitizers, causing a desync. One workaround is to just use %14p instead.

@Dylan-Brotherston
Copy link
Contributor

--leak-check doesn't benefit from dual sanitizers.

@andrew-taylor Possibly better to just disable this from the start.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants