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

libbpf-tools/klockstat: Memory sanitizer workarounds #4382

Closed
wants to merge 0 commits into from

Conversation

captain5050
Copy link
Contributor

Disable memory sanitizer for the parse_arg libc callback. Ensure stack_stat appears initialized with calloc.

Replaces badly sync-ed PR #4359.

@yonghong-song
Copy link
Collaborator

@captain5050 could you explain the issue again in the commit message? If malloc is changed to calloc, does asan issue fixed or not? We should try to fix the asan-triggered issue, rather than adding sanitization attribute.

@captain5050
Copy link
Contributor Author

BPF system calls are not understood by memory sanitizer, as such memory passed to them is considered uninitialized even though we know the system call should initialize it. Using calloc rather than malloc is a workaround for this and ideally wouldn't be necessary. These changes are sufficient to make klockstat run cleanly with memory sanitizer but the issues raised by memory sanitizer were more issues with it than klockstat.

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