Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Some DTrace probes are broken in 3.11 #98894

Labels
3.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump
@Elias-elastisys

Description

@Elias-elastisys

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 thefunction__entry andline markers are broken in 3.11.

Thefunction__entry probe simply does not fire into the eBPF program.
Theline probe crashes the interpreter.

I'm using BCC to load the eBPF program like this:

#!/usr/bin/python3import argparsefrom bcc import BPF, USDTparser = 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 theline probe this is the output:

❯ sudo ./ebpf-test.py 80715b'          python-80715   [001] d...1  6539.145626: bpf_trace_printk: Return:'

The entry message is never printed.

Error messages

With theline probe enabled, this is the crash error:

❯ ./pythonPython 3.11.0+ (heads/3.11:57dd11038f, Oct 31 2022, 10:30:28) [GCC 11.3.0] on linuxType "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)  ./python

Expected 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 linuxType "help", "copyright", "credits" or "license" for more information.>>> print("Hello world!")Hello world!
❯ sudo ./ebpf-test.py 81962b'         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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp