legacy_tracing.c: Unchecked PyLong_AsInt in tracing callbacks
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
Original gist: https://gist.github.com/devdanzin/d1a6ab9f62970be0cae139366ce3c482
Summary
sys_trace_jump_func(line 382-384) andsys_trace_line_func(line 355):PyLong_AsInterror return -1 not checked. Proceeds with wrong values and pending exception.Fix
Add
if (result == -1 && PyErr_Occurred()) return NULL;checks.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-153623
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read legacy_tracing.c at sys_trace_line_func and sys_trace_jump_func, focusing on the PyLong_AsInt calls noted at lines 355 and 382-384. Confirm both callbacks handle conversion errors without continuing with invalid values or a pending exception. The issue is already linked to PR gh-153623, so check that work before starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100