Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Plan for investigating `test_thread_names` failure on Python 3.14
1. Re-run `cargo test test_thread_names -- --nocapture` under the Python 3.14 virtualenv to confirm the failure and capture full output.
2. Inspect the thread name resolution path in `src/python_threading.rs` and related data access for version-specific logic covering Python 3.14.
3. Compare thread state and dictionary layouts for Python 3.14 (bindings in `src/python_bindings/v3_14_0.rs`) against the versions currently handled to spot missing fields or offsets.
4. Instrument or log (via targeted debug assertions or temporary prints) the thread name lookup to see what data is returned for Python 3.14 during the failing test.
5. Identify the root cause and sketch the minimal code change needed to restore thread name collection on 3.14.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ py-spy is extremely low overhead: it is written in Rust for speed and doesn't ru
in the same process as the profiled Python program. This means py-spy is safe to use against production Python code.

py-spy works on Linux, OSX, Windows and FreeBSD, and supports profiling all recent versions of the CPython
interpreter (versions 2.3-2.7 and 3.3-3.13).
interpreter (versions 2.3-2.7 and 3.3-3.14).

## Installation

Expand Down
13 changes: 13 additions & 0 deletions TEST_RESULTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cargo test results with Python 3.14

Environment: Python 3.14.0 virtualenv (`.venv`) via pyenv. Installing `numpy` with `pip install numpy` failed because the proxy blocked package downloads (403 Forbidden).

Command: `cargo test`

Failures observed:
- `test_local_vars` (integration_test): missing `numpy` in test script led to `ModuleNotFoundError`, followed by failure to read process executable name (`No such file or directory`).
- `test_delayed_subprocess` (integration_test): expected Python subprocesses were not found for the target PID.
- `test_thread_names` (integration_test): panicked on `None` unwrap when reading thread names.
- `test_subprocesses` (integration_test): subprocess count assertion failed (left: 1, right: 3).

Other tests passed (all unit tests and remaining integration tests).
35 changes: 20 additions & 15 deletions generate_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@
import tempfile


# Keep supported CPython tags in one place so --all stays current.
SUPPORTED_VERSIONS = [
"v3.14.0",
"v3.13.0",
"v3.12.0",
"v3.11.0",
"v3.10.0",
"v3.9.0",
"v3.8.0",
"v3.7.0",
"v3.6.6",
"v3.5.5",
"v3.4.8",
"v3.3.7",
"v3.2.6",
"v2.7.15",
]


def build_python(cpython_path, version):
# TODO: probably easier to use pyenv for this?
print("Compiling python %s from repo at %s" % (version, cpython_path))
Expand Down Expand Up @@ -203,21 +222,7 @@ def extract_bindings(cpython_path, version, configure=False):
sys.exit(1)

if args.all:
versions = [
"v3.13.0",
"v3.12.0",
"v3.11.0",
"v3.10.0",
"v3.9.0",
"v3.8.0",
"v3.7.0",
"v3.6.6",
"v3.5.5",
"v3.4.8",
"v3.3.7",
"v3.2.6",
"v2.7.15",
]
versions = SUPPORTED_VERSIONS
else:
versions = args.versions
if not versions:
Expand Down
8 changes: 7 additions & 1 deletion src/coredump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ use crate::binary_parser::{parse_binary, BinaryInfo};
use crate::config::Config;
use crate::dump::print_trace;
use crate::python_bindings::{
v2_7_15, v3_10_0, v3_11_0, v3_12_0, v3_13_0, v3_3_7, v3_5_5, v3_6_6, v3_7_0, v3_8_0, v3_9_5,
v2_7_15, v3_10_0, v3_11_0, v3_12_0, v3_13_0, v3_14_0, v3_3_7, v3_5_5, v3_6_6, v3_7_0, v3_8_0,
v3_9_5,
};
use crate::python_data_access::format_variable;
use crate::python_interpreters::InterpreterState;
Expand Down Expand Up @@ -318,6 +319,11 @@ impl PythonCoreDump {
minor: 13,
..
} => self._get_stack::<v3_13_0::_is>(config),
Version {
major: 3,
minor: 14,
..
} => self._get_stack::<v3_14_0::_is>(config),
_ => Err(format_err!(
"Unsupported version of Python: {}",
self.version
Expand Down
1 change: 1 addition & 0 deletions src/python_bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod v3_10_0;
pub mod v3_11_0;
pub mod v3_12_0;
pub mod v3_13_0;
pub mod v3_14_0;
pub mod v3_3_7;
pub mod v3_5_5;
pub mod v3_6_6;
Expand Down
Loading