[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

I closed the issue. test_gdb now ignores stderr in all branches.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

For the record, examples of ignored patterns:

ignore_patterns = (
'Function "%s" not defined.' % breakpoint,
'Do you need "set solib-search-path" or '
'"set sysroot"?',
# BFD: /usr/lib/debug/(...): unable to initialize decompress
# status for section .debug_aranges
'BFD: ',
# ignore all warnings
'warning: ',
)

Enjoy the older list before I chose to ignore "warning: " :-)

# Ignore some benign messages on stderr.
ignore_patterns = (
'Function "%s" not defined.' % breakpoint,
"warning: no loadable sections found in added symbol-file"
" system-supplied DSO",
"warning: Unable to find libthread_db matching"
" inferior's thread library, thread debugging will"
" not be available.",
"warning: Cannot initialize thread debugging"
" library: Debugger service failed",
'warning: Could not load shared library symbols for '
'linux-vdso.so',
'warning: Could not load shared library symbols for '
'linux-gate.so',
'warning: Could not load shared library symbols for '
'linux-vdso64.so',
'Do you need "set solib-search-path" or '
'"set sysroot"?',
'warning: Source file is more recent than executable.',
# Issue #19753: missing symbols on System Z
'Missing separate debuginfo for ',
'Try: zypper install -C ',
)

Oh strange, "Missing separate debuginfo for " message was ignored!

commit f4a4898c18c9cc5ca6d2747789c6586524daf461
Author: Victor Stinner 
Date:   Sun Nov 24 18:55:25 2013 +0100

Issue #19753: Try to fix test_gdb on SystemZ buildbot

But I removed it in:

commit 904f5def5cc6da106a1e2e9feb0830cdb1433519
Author: Victor Stinner 
Date:   Wed Mar 23 18:32:54 2016 +0100

Try to fix test_gdb on s390x buildbots

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset adcdb1e4f5eb3c63e4e40242737be9c00a26764c by Victor Stinner in 
branch '2.7':
bpo-37362: test_gdb now ignores stderr (GH-14287) (GH-14297)
https://github.com/python/cpython/commit/adcdb1e4f5eb3c63e4e40242737be9c00a26764c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread miss-islington


miss-islington  added the comment:


New changeset 3523e0c47be372477e990df7435a0f45be80fd50 by Miss Islington (bot) 
in branch '3.8':
bpo-37362: test_gdb now ignores stderr (GH-14287)
https://github.com/python/cpython/commit/3523e0c47be372477e990df7435a0f45be80fd50


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread miss-islington


miss-islington  added the comment:


New changeset 16ec95bb191e4136630de7437f75636d4b6a450f by Miss Islington (bot) 
in branch '3.7':
bpo-37362: test_gdb now ignores stderr (GH-14287)
https://github.com/python/cpython/commit/16ec95bb191e4136630de7437f75636d4b6a450f


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14121
pull_request: https://github.com/python/cpython/pull/14297

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

> I think when I wrote this I was over-optimistically thinking that we could 
> just add more patterns, but if it's becoming a pain, then your approach looks 
> good to me.

Well, I tried hard to fit into this approach: over the years, I added more and 
more patterns... but it's a painful work: first a CI break, I add more patterns 
and then I have to backport the change to all branches. As I wrote, I'm not 
convinced of the purpose of getting a failure in this case. Python doesn't get 
any benefit from this.

Anyway, I merged my change. Thanks for your approval ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14119
pull_request: https://github.com/python/cpython/pull/14295

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14120
pull_request: https://github.com/python/cpython/pull/14296

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e56a123fd0acaa295a28b98d2e46d956b97d1263 by Victor Stinner in 
branch 'master':
bpo-37362: test_gdb now ignores stderr (GH-14287)
https://github.com/python/cpython/commit/e56a123fd0acaa295a28b98d2e46d956b97d1263


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread Dave Malcolm


Dave Malcolm  added the comment:

I think when I wrote this I was over-optimistically thinking that we could just 
add more patterns, but if it's becoming a pain, then your approach looks good 
to me.

--
nosy: +dmalcolm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

> In the past, I was lazy and just added more and more patterns to ignore on 
> stderr, but this approach doesn't work in the long term: gdb evolves 
> frequently, and there are always new messages.

A recent example: test_gdb fails on Fedora because a warning which should not 
prevent to test python-gdb.py commands:

"Missing separate debuginfo for /lib/ld-linux-aarch64.so.1"

Moreover, Fedora also suggests a command to install missing package in this 
case:

"Try: dnf --enablerepo='*debug*' install ..."

https://bugzilla.redhat.com/show_bug.cgi?id=1721483

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14109
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14287

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37362] test_gdb must not fail on "unexpected" messages written into stderr

2019-06-21 Thread STINNER Victor


New submission from STINNER Victor :

Currently, test_gdb fails if gdb logs messages on stderr which are 
"unexpected". I don't understand the rationale for that: Python is not supposed 
to test gdb. It's only supposed to check that python-gdb.py commands work as 
expected: stderr should be ignored.

In the past, I was lazy and just added more and more patterns to ignore on 
stderr, but this approach doesn't work in the long term: gdb evolves 
frequently, and there are always new messages.

Attached PR modify test_gdb to ignore stderr, except of "PC not saved" pattern 
used to skip test_gdb on a special case: bpo-34007.

# bpo34007: Sometimes some versions of the shared libraries that
# are part of the traceback are compiled in optimised mode and the
# Program Counter (PC) is not present, not allowing gdb to walk the
# frames back. When this happens, the Python bindings of gdb raise
# an exception, making the test impossible to succeed.
if "PC not saved" in err:
raise unittest.SkipTest("gdb cannot walk the frame object"
" because the Program Counter is"
" not present")

--
components: Tests
messages: 346211
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_gdb must not fail on "unexpected" messages written into stderr
versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com