Title: Some DTrace probes are broken in 3.11 · Issue #98894 · python/cpython · GitHub
Open Graph Title: Some DTrace probes are broken in 3.11 · Issue #98894 · python/cpython
X Title: Some DTrace probes are broken in 3.11 · Issue #98894 · python/cpython
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...
Open Graph 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.1...
X 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...
Opengraph URL: https://github.com/python/cpython/issues/98894
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Some DTrace probes are broken in 3.11","articleBody":"\u003c!--\r\n Use this template for hard crashes of the interpreter, segmentation faults, failed C-level assertions, and similar.\r\n Do not submit this form if you encounter an exception being unexpectedly raised from a Python function.\r\n Most of the time, these should be filed as bugs, rather than crashes.\r\n\r\n The CPython interpreter is itself written in a different programming language, C.\r\n For CPython, a \"crash\" is when Python itself fails, leading to a traceback in the C stack.\r\n--\u003e\r\n\r\n# Crash report\r\nI've been using eBPF with the static markers in Python 3.10 and wanted to try out 3.11 now that it is released.\r\n\r\nBut it seems that the `function__entry` and `line` markers are broken in 3.11.\r\n\r\nThe `function__entry` probe simply does not fire into the eBPF program.\r\nThe `line` probe crashes the interpreter. \r\n\r\nI'm using BCC to load the eBPF program like this:\r\n```\r\n#!/usr/bin/python3\r\n\r\nimport argparse\r\nfrom bcc import BPF, USDT\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument(\"pid\", type=int)\r\nargs = parser.parse_args()\r\n\r\nprogram = \"\"\"\r\nint trace_entry(struct pt_regs *ctx) {\r\n bpf_trace_printk(\"Entry:\");\r\n\r\n return 0;\r\n}\r\n\r\nint trace_return(struct pt_regs *ctx) {\r\n bpf_trace_printk(\"Return:\");\r\n\r\n return 0;\r\n}\r\n\r\nint trace_line(struct pt_regs *ctx) {\r\n bpf_trace_printk(\"Line:\");\r\n\r\n return 0;\r\n}\r\n\"\"\"\r\n\r\nusdt = USDT(pid=args.pid)\r\nusdt.enable_probe_or_bail(\"python:function__entry\", 'trace_entry')\r\nusdt.enable_probe_or_bail(\"python:function__return\", 'trace_return')\r\nusdt.enable_probe_or_bail(\"python:line\", 'trace_line')\r\n\r\nbpf = BPF(text=program, usdt_contexts=[usdt] if usdt else [], debug=0)\r\n\r\ntry:\r\n bpf.trace_print()\r\nexcept KeyboardInterrupt:\r\n exit()\r\n```\r\n\r\nIf I don't enable the `line` probe this is the output:\r\n\r\n```\r\n❯ sudo ./ebpf-test.py 80715\r\nb' python-80715 [001] d...1 6539.145626: bpf_trace_printk: Return:'\r\n```\r\nThe entry message is never printed.\r\n\r\n\r\n# Error messages\r\nWith the `line` probe enabled, this is the crash error:\r\n```\r\n❯ ./python\r\nPython 3.11.0+ (heads/3.11:57dd11038f, Oct 31 2022, 10:30:28) [GCC 11.3.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e print(\"Hello world!\")\r\npython: Python/ceval.c:5620: _PyEval_EvalFrameDefault: Assertion `cframe.use_tracing' failed.\r\n[1] 80398 IOT instruction (core dumped) ./python\r\n```\r\n# Expected result\r\nRunning the same test in 3.10.6 I get this result, as expected:\r\n```\r\n❯ python3 \r\nPython 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e print(\"Hello world!\")\r\nHello world!\r\n```\r\n```\r\n❯ sudo ./ebpf-test.py 81962\r\nb' python3-81962 [003] d...1 6907.857690: bpf_trace_printk: Entry:'\r\nb' python3-81962 [003] d...1 6907.857710: bpf_trace_printk: Line:'\r\nb' python3-81962 [003] d...1 6907.857765: bpf_trace_printk: Return:'\r\n```\r\n\r\n\r\n# Your environment\r\n\r\nI used the head of the 3.11 branch with `./configure --with-dtrace --with-pydebug`\r\nOn Ubuntu 22.04.\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-125019\n* gh-139334\n* gh-142397\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Elias-elastisys","@type":"Person","name":"Elias-elastisys"},"datePublished":"2022-10-31T09:50:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/98894/cpython/issues/98894"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4a95e041-cf2a-5442-a1aa-c30ba5704ec8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CFCA:27E9DD:148CF0:1D12DB:696A0E6B |
| html-safe-nonce | 44a7d5c9f52e0a3379fc494264cfa471a8171d455077bc66bb6296f4c153df43 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkNBOjI3RTlERDoxNDhDRjA6MUQxMkRCOjY5NkEwRTZCIiwidmlzaXRvcl9pZCI6Ijc4NTE3NzU3MTc0NDE1NzI5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cb57b1611ca6ad0d2894b880f6e5ef59676df2738b959489f167e21aa4d28062 |
| hovercard-subject-tag | issue:1429561873 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/98894/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7579efbc657c8c1f4527f1ded6e01c4843883d4f51f78b5b7ac988f67fba4565/python/cpython/issues/98894 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7579efbc657c8c1f4527f1ded6e01c4843883d4f51f78b5b7ac988f67fba4565/python/cpython/issues/98894 |
| og:image:alt | 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.1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Elias-elastisys |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width