Repository navigation
Open
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Crash report
I've been using eBPF with the static markers in Python 3.10 and wanted to try out 3.11 now that it is released.
But it seems that the function__entry and line markers are broken in 3.11.
The function__entry probe simply does not fire into the eBPF program.
The line probe crashes the interpreter.
I'm using BCC to load the eBPF program like this:
#!/usr/bin/python3
import argparse
from bcc import BPF, USDT
parser = argparse.ArgumentParser()
parser.add_argument("pid", type=int)
args = parser.parse_args()
program = """
int trace_entry(struct pt_regs *ctx) {
bpf_trace_printk("Entry:");
return 0;
}
int trace_return(struct pt_regs *ctx) {
bpf_trace_printk("Return:");
return 0;
}
int trace_line(struct pt_regs *ctx) {
bpf_trace_printk("Line:");
return 0;
}
"""
usdt = USDT(pid=args.pid)
usdt.enable_probe_or_bail("python:function__entry", 'trace_entry')
usdt.enable_probe_or_bail("python:function__return", 'trace_return')
usdt.enable_probe_or_bail("python:line", 'trace_line')
bpf = BPF(text=program, usdt_contexts=[usdt] if usdt else [], debug=0)
try:
bpf.trace_print()
except KeyboardInterrupt:
exit()If I don't enable the line probe this is the output:
❯ sudo ./ebpf-test.py 80715
b' python-80715 [001] d...1 6539.145626: bpf_trace_printk: Return:'The entry message is never printed.
Error messages
With the line probe enabled, this is the crash error:
❯ ./python
Python 3.11.0+ (heads/3.11:57dd11038f, Oct 31 2022, 10:30:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello world!")
python: Python/ceval.c:5620: _PyEval_EvalFrameDefault: Assertion `cframe.use_tracing' failed.
[1] 80398 IOT instruction (core dumped) ./pythonExpected result
Running the same test in 3.10.6 I get this result, as expected:
❯ python3
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello world!")
Hello world!❯ sudo ./ebpf-test.py 81962
b' python3-81962 [003] d...1 6907.857690: bpf_trace_printk: Entry:'
b' python3-81962 [003] d...1 6907.857710: bpf_trace_printk: Line:'
b' python3-81962 [003] d...1 6907.857765: bpf_trace_printk: Return:'Your environment
I used the head of the 3.11 branch with ./configure --with-dtrace --with-pydebug
On Ubuntu 22.04.
Linked PRs
- GH-98894: Fix
function__returnandfunction__entrydTrace probe missing afterGH-103083#125019 - gh-98894: Update DTrace Docs in instrumentation.rst #139334
- gh-98894: Restore function entry/exit DTrace probes #142397
- gh-98894: Fix DTrace test_check_probes for shared builds #151122
- [3.15] gh-98894: Fix DTrace test_check_probes for shared builds (GH-151122) #151235
- gh-98894: Skip dtrace tests when building without dtrace #152239
- [3.15] gh-98894: Skip test_dtrace when building without dtrace (GH-152239) #152300
- [3.14] gh-98894: Skip test_dtrace when building without dtrace (GH-152239) #152301
- [3.13] gh-98894: Skip test_dtrace when building without dtrace (GH-152239) #152302
- gh-98894: Check readelf failures in test_dtrace #152345
- [3.15] gh-98894: Check readelf failures in test_dtrace (GH-152345) #152891
- gh-98894: Check tracer exit status in test_dtrace #152893
- [3.15] gh-98894: Check tracer exit status in test_dtrace (GH-152893) #152900
- gh-98894: Quote test_dtrace tracer subcommands #152901
- gh-98894: Fix dtrace tests in shared builds #153372
- [3.15] gh-98894: Quote test_dtrace tracer subcommands (GH-152901) #153459
- gh-98894: fix
CheckDtraceProbestests on Solaris #154803 - [3.15] gh-98894: Fix dtrace tests in shared builds (GH-153372) #155803
- gh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands #156424
- [3.15] gh-98894: Fix test_dtrace on Solaris (GH-154803) #159602
- [3.14] gh-98894: Fix test_dtrace on Solaris (#154803) #159605
Reacted by xzvf
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Activity
pythongh-98894: Restore function entry/exit DTrace probes
pythongh-98894: fix rebased DTrace follow-ups
harishn1408 commentedon May 1, 2026
💎 Sovereign AI: Superior Solution Suggestion
[ELEVATED SOLUTION]
🚀 Conway Syndicate: Engineering Advantage
This solution was autonomously generated to optimize repository performance.
Need repo-scale engineering or custom agents?
View Syndicate Services | Hire an Agent
pythongh-98894: Restore function entry/exit DTrace probes
pythongh-98894: fix rebased DTrace follow-ups
pythongh-98894: fix rebased DTrace follow-ups
Merge branch 'main' into pythongh-98894
gh-98894: Restore function entry/exit DTrace probes (#142397)
gh-98894: Fix DTrace test_check_probes for shared builds (#151122)
[3.15] gh-98894: Fix DTrace test_check_probes for shared builds (GH-1…
pythongh-98894: Fix DTrace test_check_probes for shared builds (pytho…
pythongh-98894: Skip dtrace tests when building without dtrace
gh-98894: Skip test_dtrace when building without dtrace (#152239)
[3.14] gh-98894: Skip test_dtrace when building without dtrace (GH-15…
[3.15] gh-98894: Skip test_dtrace when building without dtrace (GH-15…
[3.13] gh-98894: Skip test_dtrace when building without dtrace (GH-15…
pythongh-98894: Check readelf failures in test_dtrace
gh-98894: Check readelf failures in test_dtrace (#152345)
[3.15] gh-98894: Check readelf failures in test_dtrace (GH-152345) (#…
gh-98894: Check tracer exit status in test_dtrace (#152893)
pythongh-98894: Quote test_dtrace tracer subcommands
pythongh-98894: Quote test_dtrace tracer subcommands
[3.15] gh-98894: Check tracer exit status in test_dtrace (GH-152893) (#…
gh-98894: Quote test_dtrace tracer subcommands (#152901)
[3.15] gh-98894: Quote test_dtrace tracer subcommands (GH-152901) (#1…
pythongh-98894: Fix dtrace tests in shared builds
gh-98894: Fix dtrace tests in shared builds (#153372)
pythongh-98894: Fix dtrace tests in shared builds (python#153372)
[3.15] gh-98894: Fix dtrace tests in shared builds (GH-153372) (#155803)
[3.14] gh-156701: Backport test_dtrace from main (#159596)
vstinner commentedon Oct 16, 2026
test_dtrace has been patched by multiple issues:
test_dtracecan hang indefinitely when bpftrace usability check times out #151496vstinner commentedon Oct 16, 2026
I tried to reproduce the initial reproducer #98894 (comment) on the main branch, but I got this error:
I cannot find the "line" probe in readelf output:
In Python 3.11, I see that
OR_DTRACE_LINEmacro is used byPython/ceval.c. But the macro is no longer used in Python 3.12 and newer. It seems likeOR_DTRACE_LINEis broken on 3.12 and newer.gh-98894: Fix test_dtrace on Solaris (#154803)
[3.15] gh-98894: Fix test_dtrace on Solaris (GH-154803) (#159602)
pythongh-98894: Fix test_dtrace on Solaris (python#154803)
[3.14] gh-98894: Fix test_dtrace on Solaris (#154803) (#159605)