This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: gdb test fails when packaging Python 3.10 for openSUSE/Linux
Type: behavior Stage: resolved
Components: Demos and Tools Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, iritkatriel, mcepl
Priority: normal Keywords: patch

Created on 2021-12-02 13:50 by mcepl, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pdb_adjust_breakpoints.patch mcepl, 2021-12-02 13:50 suggested patch fixing this issue
Messages (7)
msg407527 - (view) Author: Matej Cepl (mcepl) * Date: 2021-12-02 13:50
When running tests with 3.10.0 test_pdb_breakpoints_preserved_across_interactive_sessions test fails:

[  842s] ======================================================================
[  842s] FAIL: test_pdb_breakpoints_preserved_across_interactive_sessions (test.test_pdb)
[  842s] Doctest: test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s] ----------------------------------------------------------------------
[  842s] Traceback (most recent call last):
[  842s]   File "/home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/doctest.py", line 2216, in runTest
[  842s]     raise self.failureException(self.format_failure(new.getvalue()))
[  842s] AssertionError: Failed doctest test for test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s]   File "/home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py", line 327, in test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s] 
[  842s] ----------------------------------------------------------------------
[  842s] File "/home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py", line 351, in test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s] Failed example:
[  842s]     with PdbTestInput([  # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
[  842s]        'break',
[  842s]        'break pdb.find_function',
[  842s]        'break',
[  842s]        'clear 1',
[  842s]        'continue',
[  842s]     ]):
[  842s]        pdb.run('print()')
[  842s] Expected:
[  842s]     > <string>(1)<module>()...
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     2   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     (Pdb) break pdb.find_function
[  842s]     Breakpoint 3 at ...pdb.py:94
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     2   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     3   breakpoint   keep yes   at ...pdb.py:...
[  842s]     (Pdb) clear 1
[  842s]     Deleted breakpoint 1 at ...test_pdb.py:...
[  842s]     (Pdb) continue
[  842s] Got:
[  842s]     > <string>(1)<module>()
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:425
[  842s]     2   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:422
[  842s]     (Pdb) break pdb.find_function
[  842s]     Breakpoint 3 at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/pdb.py:93
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:425
[  842s]     2   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:422
[  842s]     3   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/pdb.py:93
[  842s]     (Pdb) clear 1
[  842s]     Deleted breakpoint 1 at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:425
[  842s]     (Pdb) continue
[  842s]     <BLANKLINE>
[  842s] 
[  842s] 
[  842s] ----------------------------------------------------------------------
[  842s] Ran 1 test in 0.005s
[  842s] 
[  842s] FAILED (failures=1)
[  842s] 1 test failed again:
[  842s]     test_pdb
[  842s] 
[  842s] == Tests result: FAILURE then FAILURE ==

The problem is completely trivial and the attached patch fixes it (wrong line number in one expected result).
msg407530 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-02 15:26
This is not failing on our buildbots, so the fix is probably not right. 

Which system are you running on?
msg407533 - (view) Author: Matej Cepl (mcepl) * Date: 2021-12-02 15:46
> Which system are you running on?

Happens when packaging Python 3.10 for openSUSE/Linux.
msg407535 - (view) Author: Matej Cepl (mcepl) * Date: 2021-12-02 15:47
And no there is no other patch touching pdb (or pdb tests).
msg407588 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-03 14:01
> Happens when packaging Python 3.10 for openSUSE/Linux.

Can you give full details of what you're doing?
msg407593 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-12-03 15:37
This looks like a problem on your side. Line 94 is the correct line for the function in 3.10.0 release.

$ git checkout v3.10.0
$ sed -n '94p' Lib/pdb.py 
def find_function(funcname, filename):

Matej, does your build system perhaps strip off the shebang of Lib/pdb.py? That would explain why you are getting the function on line 93.
msg407678 - (view) Author: Matej Cepl (mcepl) * Date: 2021-12-04 17:35
> Matej, does your build system perhaps strip off the shebang of Lib/pdb.py? That would explain why you are getting the function on line 93.

Yes, that’s it. Thank you.
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90122
2021-12-04 17:35:54mceplsetstatus: open -> closed
resolution: not a bug
messages: + msg407678

stage: resolved
2021-12-03 15:37:53christian.heimessetnosy: + christian.heimes
messages: + msg407593
2021-12-03 14:02:29iritkatrielsettitle: 3.10.0 tests fail in test_pdb_breakpoints_preserved_across_interactive_sessions -> gdb test fails when packaging Python 3.10 for openSUSE/Linux
2021-12-03 14:01:20iritkatrielsetmessages: + msg407588
2021-12-03 13:48:21AlexWaygoodsettype: behavior
2021-12-02 15:47:19mceplsetmessages: + msg407535
2021-12-02 15:46:47mceplsetmessages: + msg407533
2021-12-02 15:26:28iritkatrielsetnosy: + iritkatriel
messages: + msg407530
2021-12-02 13:50:38mceplcreate