New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect stacktrace from pdb #61897
Comments
Give the attached file execute permission and run it. At the first breakpoint, the backtrace will be correct. Continue. At the second breakpoint, a backtrace will show the foo('first call') on the stack when, in fact, the call came from foo('second call'), as verified by the printed message. I am running this on an up-to-date 64-bit Arch Linux system. Python 3.3.1. |
The bug also occurs using 32-bit Python 3.3.1 on Windows 7. |
On python-list, Robert Kern used "where" to demonstrate the problem: $ python pdbbug.py
first call
--Return--
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) where
/Users/rkern/scratch/pdbbug.py(5)<module>()
-> foo('first call')
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) c
second call
--Return--
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) where
/Users/rkern/scratch/pdbbug.py(5)<module>()
-> foo('first call')
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) Searching other open pdb issues, applying the suggested fix from bpo-16482 seems to correct the problem here. |
The call to set_trace() installs a local trace function on all the Next, the 'continue' command sets the global trace function to None On printing the stack with the 'where' command, the bdb get_stack() The root cause is that PyFrame_GetLineNumber assumes incorrectly that |
This is already fixed somewhere along the way. Not reproducible in Python 3.13. Close for done. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: