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/memleak: mmap allocation failed, not added to pointer map #5138

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libbpf-tools/memleak.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int gen_alloc_exit2(void *ctx, u64 address)
info.size = *size;
bpf_map_delete_elem(&sizes, &tid);

if (address != 0) {
if (address != 0 && address != MAP_FAILED) {
info.timestamp_ns = bpf_ktime_get_ns();

info.stack_id = bpf_get_stackid(ctx, &stack_traces, stack_flags);
Expand Down
1 change: 1 addition & 0 deletions libbpf-tools/memleak.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#define ALLOCS_MAX_ENTRIES 1000000
#define COMBINED_ALLOCS_MAX_ENTRIES 10240
#define MAP_FAILED -1

struct alloc_info {
__u64 size;
Expand Down
Loading