Title: Creating a subinterpreter when Python is run with -X tracemalloc leads to segfault · Issue #134604 · python/cpython · GitHub
Open Graph Title: Creating a subinterpreter when Python is run with -X tracemalloc leads to segfault · Issue #134604 · python/cpython
X Title: Creating a subinterpreter when Python is run with -X tracemalloc leads to segfault · Issue #134604 · python/cpython
Description: Crash report What happened? Minimal reproducer: import _interpreters _interpreters.create() python -X tracemalloc subtest.py This also fails if one submits a task to concurrent.futures.InterpreterPoolExecutor. Example output when run wit...
Open Graph Description: Crash report What happened? Minimal reproducer: import _interpreters _interpreters.create() python -X tracemalloc subtest.py This also fails if one submits a task to concurrent.futures.InterpreterP...
X Description: Crash report What happened? Minimal reproducer: import _interpreters _interpreters.create() python -X tracemalloc subtest.py This also fails if one submits a task to concurrent.futures.InterpreterP...
Opengraph URL: https://github.com/python/cpython/issues/134604
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Creating a subinterpreter when Python is run with -X tracemalloc leads to segfault","articleBody":"# Crash report\n\n### What happened?\n\nMinimal reproducer:\n\n```python\nimport _interpreters\n\n_interpreters.create()\n```\n`python -X tracemalloc subtest.py`\n\nThis also fails if one submits a task to `concurrent.futures.InterpreterPoolExecutor`.\n\nExample output when run with `-X tracemalloc`:\n\n```\nPython/tracemalloc.c:705: _Py_NegativeRefcount: Assertion failed: object has negative ref count\n\u003cobject at 0x200041899d0 is freed>\nFatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed\nPython runtime state: finalizing (tstate=0x0000559f74721680)\n\nStack (most recent call first):\n \u003cno Python frame>\nAborted (core dumped)\n```\n\nThat points here:\nhttps://github.com/python/cpython/blob/f478331f98930d94f7efc741f3bed4b693d5cec1/Python/tracemalloc.c#L701-L706\n\nI presume the issue is that the filename is not populated for the subinterpreter?\n\nI'm on Ubuntu 24.04 on an x86_64 machine if that makes a difference. My latest configure command line is:\n```\n./configure --config-cache --with-pydebug --disable-gil CC=clang-20\n```\nNote that this also reproduces with the GIL enabled, (but it just outputs an unhelpful \"segmentation fault\").\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\nPython 3.15.0a0 experimental free-threading build (heads/main:f478331f989, May 23 2025, 16:17:11) [Clang 20.1.5 (++20250430014901+ebfae55af454-1~exp1~20250430014920.111)]\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-134667\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/emmatyping","@type":"Person","name":"emmatyping"},"datePublished":"2025-05-23T23:43:31Z","url":"https://github.com/python/cpython/issues/134604"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:f95d360c-136f-61f8-66cf-ed76942d8fbf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ECC:29FFA9:39011CA:482EBC2:6B01F0CD |
| html-safe-nonce | 6f6dfe9cc41ab867f5aa58d86fb6fbb162fa8a83618534d347a937d269ed4503 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUNDOjI5RkZBOTozOTAxMUNBOjQ4MkVCQzI6NkIwMUYwQ0QiLCJ2aXNpdG9yX2lkIjoiOTA3NTk4NjE3NzE0MzczMDM4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8e5399e0d1e0ff72b757afc8954250d20862e18c7ab5a6d9150c0702cce10ba9 |
| hovercard-subject-tag | issue:3087730221 |
| 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/134604/issue_layout |
| twitter:image | https://opengraph.githubassets.com/661959862c70098369e81a8bc9bc85566ece9833d4862d6426dc3fdf79d46698/python/cpython/issues/134604 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/661959862c70098369e81a8bc9bc85566ece9833d4862d6426dc3fdf79d46698/python/cpython/issues/134604 |
| og:image:alt | Crash report What happened? Minimal reproducer: import _interpreters _interpreters.create() python -X tracemalloc subtest.py This also fails if one submits a task to concurrent.futures.InterpreterP... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emmatyping |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width