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: Fixes for test_gdb (first frame address, entry values)
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: bkabrda, dmalcolm, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2014-10-30 11:51 by bkabrda, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_gdb-ppc64le-and-entry-values-fix.patch bkabrda, 2014-10-30 11:51 review
test_gdb_entry_values.patch serhiy.storchaka, 2015-02-05 12:07 review
Messages (9)
msg230265 - (view) Author: Bohuslav "Slavek" Kabrda (bkabrda) * Date: 2014-10-30 11:51
The attached patch fixes two test_gdb problems that can occur under some circumstances:

- With new GDB (I think version >= 7.4.0, but I'm not sure about the precise version), GDB sometimes prints "entry-values" for variables, which can lead to failures like: "AssertionError: 'v@entry=()' != '()'". The cure for that is using "set print entry-values no" in GDB. I think this is also the root cause of issue 17126.

- While building on ppc64 little endian for Fedora, we experienced GDB printing program counter for the first frame, which breaks regular expressions matching in tests, e.g. instead of

#0 in PyObject_Print

the lines can look like

#0 0x00003fffb7dd1798 in PyObject_Print

I've talked to Fedora's GDB maintainer and I've been told that this can happen and it's not a GDB bug - GDB does not guarantee this. Therefore the second part of the attached patch turns printing program counters for *all* frames using "set print address off" to achieve same GDB output everywhere.
msg232497 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-12-11 21:41
test_gdb is failed on my computer (gdb 7.7) and I confirm that the patch fixes it.
msg235095 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-01-31 09:51
New changeset 47a9cb7ec0cb by Serhiy Storchaka in branch '2.7':
Issue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
https://hg.python.org/cpython/rev/47a9cb7ec0cb

New changeset 5b5a581d91c8 by Serhiy Storchaka in branch '3.4':
Issue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
https://hg.python.org/cpython/rev/5b5a581d91c8

New changeset 3813a5282eac by Serhiy Storchaka in branch 'default':
Issue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
https://hg.python.org/cpython/rev/3813a5282eac
msg235119 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-01-31 16:35
Thank you for your contribution Bohuslav.
msg235430 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-02-05 11:21
> New changeset 5b5a581d91c8 by Serhiy Storchaka in branch '3.4':
> Issue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
> https://hg.python.org/cpython/rev/5b5a581d91c8

Since this change, test_gdb fails on "AMD64 OpenIndiana 3.x":
http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/9176/

See also issue #23381..
msg235431 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-02-05 11:25
A workaround is to check (once) that the command "set print entry-values no" and "set print address off" are supported.

Gdb provides its version in the Python API as a string: gdb.VERSION (ex: 'Fedora 7.8.2-38.fc21').
msg235432 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-05 12:07
Here is a patch which adds command 'set print entry-values no' only for gdb version >= 7.4.
msg235466 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-06 07:02
New changeset 30e6c8caa5b9 by Serhiy Storchaka in branch '3.4':
Issue #23881: Only use entry-values with gdb 7.4 in tests.
https://hg.python.org/cpython/rev/30e6c8caa5b9

New changeset 981e108039f1 by Serhiy Storchaka in branch 'default':
Issue #23881: Only use entry-values with gdb 7.4 in tests.
https://hg.python.org/cpython/rev/981e108039f1

New changeset cee39701b280 by Serhiy Storchaka in branch '2.7':
Issue #23881: Only use entry-values with gdb 7.4 in tests.
https://hg.python.org/cpython/rev/cee39701b280
msg235467 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-06 07:05
Actually this is #23381, not #23881.
History
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66954
2015-02-06 07:09:08serhiy.storchakasetstatus: open -> closed
resolution: fixed
2015-02-06 07:05:04serhiy.storchakasetmessages: + msg235467
2015-02-06 07:02:08python-devsetmessages: + msg235466
2015-02-05 12:07:28serhiy.storchakasetfiles: + test_gdb_entry_values.patch

messages: + msg235432
2015-02-05 11:25:58vstinnersetmessages: + msg235431
2015-02-05 11:21:43vstinnersetstatus: closed -> open

nosy: + vstinner
messages: + msg235430

resolution: fixed -> (no value)
2015-01-31 16:35:46serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg235119

stage: commit review -> resolved
2015-01-31 09:51:57python-devsetnosy: + python-dev
messages: + msg235095
2015-01-18 17:50:28serhiy.storchakasetassignee: serhiy.storchaka
2014-12-11 21:41:18serhiy.storchakasetmessages: + msg232497
stage: patch review -> commit review
2014-12-11 12:13:26serhiy.storchakasetnosy: + serhiy.storchaka
stage: patch review
type: behavior

versions: + Python 3.4
2014-10-30 18:57:38pitrousetnosy: + dmalcolm
2014-10-30 11:51:46bkabrdacreate