classification
Title: test_gdb fails all tests on a profile-opt build configured --with-lto
Type: Stage:
Components: Build Versions: Python 3.6, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: alecsandru.patrascu, gregory.p.smith, haypo, inada.naoki
Priority: normal Keywords: patch

Created on 2016-04-17 06:29 by gregory.p.smith, last changed 2017-02-17 16:52 by gregory.p.smith.

Files
File name Uploaded Description Edit
issue26788.patch alecsandru.patrascu, 2016-04-23 07:58 review
Messages (6)
msg263599 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2016-04-17 06:29
cpython/build35.lto$ ./python ../3.5/Lib/test/test_gdb.py
GDB version 7.10:
    GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
...
======================================================================
FAIL: test_tuples (__main__.PrettyPrintTests)
Verify the pretty-printing of tuples
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../3.5/Lib/test/test_gdb.py", line 359, in test_tuples
    self.assertGdbRepr(tuple(), '()')
  File "../3.5/Lib/test/test_gdb.py", line 279, in assertGdbRepr
    gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')')
  File "../3.5/Lib/test/test_gdb.py", line 255, in get_gdb_repr
    self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 at 0x4cc310\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".\n\nBreakpoint 1, builtin_id ()\n#0  builtin_id ()\n'
Breakpoint 1 at 0x4cc310
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, builtin_id ()
#0  builtin_id ()

I don't know the right thing to do here.  This might depend on compiler, linker, arch and gdb version?  Are it's LTO executables debuggable?  It's not clear to me that we can do anything about this.  We may just want to skip the test when configured --with-lto.  Or perhaps this is an indication that this specific toolchain's LTO build (x86_64, ubuntu wily gcc 5.2.1 and gdb 7.1.0) has issues and shouldn't be used?
msg263625 - (view) Author: Alecsandru Patrascu (alecsandru.patrascu) * Date: 2016-04-17 19:56
I will investigate this issue to understand what is happening there and submit a fix. Thank you for pointing out the exact OS and toolchain used.
msg264055 - (view) Author: Alecsandru Patrascu (alecsandru.patrascu) * Date: 2016-04-23 07:58
I uploaded a patch that skips these tests if optimizations are available.
msg287979 - (view) Author: INADA Naoki (inada.naoki) * (Python committer) Date: 2017-02-17 08:44
LGTM, but would you send pull request on Github?
msg287982 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-02-17 10:07
+@unittest.skipIf(python_is_optimized(),
+                 "Python was compiled with optimizations")
 class PrettyPrintTests(DebuggerTests):

I disagree with this skip. I just compiled Python with "./configure" and GCC: these tests pass. Except of one buildbot, PGO is not used on buildbots nor Travis CI. I would prefer to keep running these tests by default, but only skip on PGO build.

By the way, would it maybe possible to find the missing information "<optimized out>" from other variables?
msg288021 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-02-17 16:52
there may be something in sysconfig.get_config_vars() we could use or, better, we could add something specific to indicate both pgo and lto builds.
History
Date User Action Args
2017-02-17 16:52:26gregory.p.smithsetmessages: + msg288021
2017-02-17 10:07:29hayposetnosy: + haypo
messages: + msg287982
2017-02-17 08:44:44inada.naokisetnosy: + inada.naoki
messages: + msg287979
2016-04-23 07:58:14alecsandru.patrascusetfiles: + issue26788.patch
keywords: + patch
messages: + msg264055
2016-04-17 19:56:14alecsandru.patrascusetmessages: + msg263625
2016-04-17 06:30:12gregory.p.smithlinkissue25702 dependencies
2016-04-17 06:29:59gregory.p.smithcreate