Bug 492125 - Warnings when running DTrace testsuite under Valgrind (WARNING: unhandled eBPF command 23)
Summary: Warnings when running DTrace testsuite under Valgrind (WARNING: unhandled eBP...
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.24 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-24 10:10 UTC by Sam James
Modified: 2024-08-24 13:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James 2024-08-24 10:10:03 UTC
When running the DTrace [0] testsuite, I get a lot of 'WARNING: unhandled eBPF command 23':
```
$ sudo valgrind dtrace -DARCH_x86_64 -I/usr/lib64/dtrace/include -xerrtags -s test/unittest/multiaggs/err.D_PRINTA_AGGKEY.d
==1222270== Memcheck, a memory error detector
==1222270== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1222270== Using Valgrind-3.24.0.GIT and LibVEX; rerun with -h for copyright info
==1222270== Command: dtrace -DARCH_x86_64 -I/usr/lib64/dtrace/include -xerrtags -s test/unittest/multiaggs/err.D_PRINTA_AGGKEY.d
==1222270==
--1222270-- WARNING: unhandled eBPF command 23
--1222270-- WARNING: unhandled eBPF command 23
==1222270== Conditional jump or move depends on uninitialised value(s)
==1222270==    at 0x4852415: strlen (vg_replace_strmem.c:505)
==1222270==    by 0x48E5164: dt_module_lookup_by_name (dt_module.c:173)
==1222270==    by 0x48AADDC: dt_btf_get_module_ids (dt_btf.c:944)                                                                                                                         ==1222270==    by 0x48E95E6: dt_vopen (dt_open.c:1160)
==1222270==    by 0x1098F7: main (dtrace.c:1102)
[...]
```

Note that I've reported the uninit use to DTrace separately.

I actually wasn't aware at all that Valgrind understood BPF until I came across https://bugs.kde.org/show_bug.cgi?id=426148#c4 :)

[0] https://github.com/oracle/dtrace-utils
Comment 1 Sam James 2024-08-24 10:12:35 UTC
From looking at /usr/include/linux/bpf.h's bpf_cmd in linux-headers-6.10, it might be BPF_MAP_FREEZE?
Comment 2 Sam James 2024-08-24 10:14:16 UTC
I'm not yet sure how to produce a standalone testcase as I'm not familiar enough with BPF yet.
Comment 3 Sam James 2024-08-24 13:01:31 UTC
Mark, I think you're right and it's actually https://bugs.kde.org/show_bug.cgi?id=478774, because I investigated the uninit var warning and it turns out to be the same thing (Valgrind didn't know it was init'd).

Let me try the patch from https://bugs.kde.org/show_bug.cgi?id=478774#c4...
Comment 4 Sam James 2024-08-24 13:11:57 UTC
I'm surprised but it *didn't* help:
```
$ sudo valgrind --error-exitcode=1 --exit-on-first-error=yes -q --track-origins=yes dtrace -DARCH_x86_64 -I/usr/lib64/dtrace/include -xerrtags -s test/unittest/multiaggs/err.D_PRINTA_AGGKEY.d
--2155-- WARNING: unhandled eBPF command 23
--2155-- WARNING: unhandled eBPF command 23
==2155== Conditional jump or move depends on uninitialised value(s)
==2155==    at 0x4852415: strlen (vg_replace_strmem.c:505)
==2155==    by 0x48E5164: dt_module_lookup_by_name (dt_module.c:173)
==2155==    by 0x48AADDC: dt_btf_get_module_ids (dt_btf.c:944)
==2155==    by 0x48E95E6: dt_vopen (dt_open.c:1160)
==2155==    by 0x1098F7: main (dtrace.c:1102)
==2155==  Uninitialised value was created by a stack allocation
==2155==    at 0x48AACEA: dt_btf_get_module_ids (dt_btf.c:908)
==2155==
==2155==
==2155== Exit program on first error (--exit-on-first-error=yes)
```

(From my primitive knowledge of BPF, I think we do need that patch though.)