Navigation Menu

Skip to content
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

test_gdb failed on AMD64 Debian PGO 3.x #81204

Closed
vstinner opened this issue May 23, 2019 · 8 comments
Closed

test_gdb failed on AMD64 Debian PGO 3.x #81204

vstinner opened this issue May 23, 2019 · 8 comments
Assignees
Labels
3.8 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 37023
Nosy @vstinner, @zooba
PRs
  • bpo-37023: Skip test_gdb under PGO #13555
  • 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:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2019-05-24.20:00:46.234>
    created_at = <Date 2019-05-23.17:16:38.261>
    labels = ['3.8', 'tests']
    title = 'test_gdb failed on AMD64 Debian PGO 3.x'
    updated_at = <Date 2019-05-24.20:00:46.233>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-05-24.20:00:46.233>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2019-05-24.20:00:46.234>
    closer = 'steve.dower'
    components = ['Tests']
    creation = <Date 2019-05-23.17:16:38.261>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37023
    keywords = ['patch']
    message_count = 8.0
    messages = ['343314', '343316', '343318', '343319', '343343', '343416', '343422', '343423']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'steve.dower']
    pr_nums = ['13555']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37023'
    versions = ['Python 3.8']

    @vstinner
    Copy link
    Member Author

    It's likely a regression caused by bpo-36842.

    https://buildbot.python.org/all/#/builders/47/builds/2854

    Example of failure:

    ======================================================================
    FAIL: test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with NULL ob_type is handled gracefully
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_gdb.py", line 533, in test_NULL_ob_type
        self.assertSane('id(42)',
      File "/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_gdb.py", line 504, in assertSane
        self.get_gdb_repr(source,
      File "/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_gdb.py", line 278, in get_gdb_repr
        self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
    AssertionError: Unexpected gdb output: 'Breakpoint 1 at 0x201df0: file Python/bltinmodule.c, line 1217.\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 () at Python/bltinmodule.c:1217\n1217\t{\n#0  builtin_id () at Python/bltinmodule.c:1217\n#1  _PyMethodDef_RawFastCallKeywords () at Objects/call.c:650\n#2  _PyCFunction_FastCallKeywords (func=<built-in method id of module object at remote 0x7ffff6ea7180>, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:736\n#3  call_function (kwnames=0x0, oparg=1, pp_stack=<synthetic pointer>, tstate=<optimized out>) at Python/ceval.c:4831\n#4  _PyEval_EvalFrameDefault () at Python/ceval.c:3347\n#5  PyEval_EvalFrameEx (throwflag=0, f=Frame 0x7ffff6e94800, for file <string>, line 1, in <module> ()) at Python/ceval.c:685\n#6  _PyEval_EvalCodeWithName () at Python/ceval.c:4173\n#7  PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=, kwcount=0, kws=, argcount=0, args=, locals={\'__name__\': \'__main__\', \'__doc__\': None, \'__package__\': None, \'__loader__\': <type at remote 0x555555b0eed0>, \'__spec__\': None, \'__annotations__\': {}, \'__builtins__\': <module at remote 0x7ffff6ea7180>}, globals={\'__name__\': \'__main__\', \'__doc__\': None, \'__package__\': None, \'__loader__\': <type at remote 0x555555b0eed0>, \'__spec__\': None, \'__annotations__\': {}, \'__builtins__\': <module at remote 0x7ffff6ea7180>}, _co=<code at remote 0x7ffff6e3e5d0>) at Python/ceval.c:4202\n#8  PyEval_EvalCode (co=<code at remote 0x7ffff6e3e5d0>, globals={\'__name__\': \'__main__\', \'__doc__\': None, \'__package__\': None, \'__loader__\': <type at remote 0x555555b0eed0>, \'__spec__\': None, \'__annotations__\': {}, \'__builtins__\': <module at remote 0x7ffff6ea7180>}, locals={\'__name__\': \'__main__\', \'__doc__\': None, \'__package__\': None, \'__loader__\': <type at remote 0x555555b0eed0>, \'__spec__\': None, \'__annotations__\': {}, \'__builtins__\': <module at remote 0x7ffff6ea7180>}) at Python/ceval.c:662\n#9  run_eval_code_obj () at Python/pythonrun.c:1078\n#10 run_mod () at Python/pythonrun.c:1100\n#11 PyRun_StringFlags () at Python/pythonrun.c:987\n#12 PyRun_SimpleStringFlags () at Python/pythonrun.c:461\n#13 pymain_run_command (cf=, command=<optimized out>) at Modules/main.c:241\n#14 pymain_run_python (exitcode=) at Modules/main.c:522\n#15 _Py_RunMain () at Modules/main.c:610\n#16 pymain_main () at Modules/main.c:640\n#17 _Py_UnixMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:664\n#18 __libc_start_main (main=<main>, argc=7, argv=, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=) at ../csu/libc-start.c:291\n#19 _start ()\n'
    Breakpoint 1 at 0x201df0: file Python/bltinmodule.c, line 1217.
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

    Breakpoint 1, builtin_id () at Python/bltinmodule.c:1217
    1217 {
    #0 builtin_id () at Python/bltinmodule.c:1217
    #1 _PyMethodDef_RawFastCallKeywords () at Objects/call.c:650
    #2 _PyCFunction_FastCallKeywords (func=<built-in method id of module object at remote 0x7ffff6ea7180>, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:736
    #3 call_function (kwnames=0x0, oparg=1, pp_stack=<synthetic pointer>, tstate=<optimized out>) at Python/ceval.c:4831
    #4 _PyEval_EvalFrameDefault () at Python/ceval.c:3347
    #5 PyEval_EvalFrameEx (throwflag=0, f=Frame 0x7ffff6e94800, for file <string>, line 1, in <module> ()) at Python/ceval.c:685
    #6 _PyEval_EvalCodeWithName () at Python/ceval.c:4173
    #7 PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=, kwcount=0, kws=, argcount=0, args=, locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x555555b0eed0>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff6ea7180>}, globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x555555b0eed0>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff6ea7180>}, _co=<code at remote 0x7ffff6e3e5d0>) at Python/ceval.c:4202
    #8 PyEval_EvalCode (co=<code at remote 0x7ffff6e3e5d0>, globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x555555b0eed0>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff6ea7180>}, locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x555555b0eed0>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff6ea7180>}) at Python/ceval.c:662
    #9 run_eval_code_obj () at Python/pythonrun.c:1078
    #10 run_mod () at Python/pythonrun.c:1100
    #11 PyRun_StringFlags () at Python/pythonrun.c:987
    #12 PyRun_SimpleStringFlags () at Python/pythonrun.c:461
    #13 pymain_run_command (cf=, command=<optimized out>) at Modules/main.c:241
    #14 pymain_run_python (exitcode=) at Modules/main.c:522
    #15 _Py_RunMain () at Modules/main.c:610
    #16 pymain_main () at Modules/main.c:640
    #17 _Py_UnixMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:664
    #18 __libc_start_main (main=<main>, argc=7, argv=, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=) at ../csu/libc-start.c:291
    #19 _start ()

    @vstinner vstinner added 3.8 only security fixes tests Tests in the Lib/test dir labels May 23, 2019
    @zooba
    Copy link
    Member

    zooba commented May 23, 2019

    Is it just expecting builtin_id() to have been inlined? That seems risky.

    @zooba
    Copy link
    Member

    zooba commented May 23, 2019

    Ah no, it's expecting builtin_id (self=..., v=...) but getting builtin_id () instead.

    @zooba
    Copy link
    Member

    zooba commented May 23, 2019

    Well, the good news is I can repro it on a PGO build in WSL. So now I just need to go learn all about gcc's PGO build, debug info, and how gdb renders it!

    @zooba
    Copy link
    Member

    zooba commented May 24, 2019

    I confirmed earlier that removing the new code from builtins_id fixes this issue, which I suspect means that PGO is deciding to make different optimizations and produce different output.

    Other functions in the same stack also do not show their arguments, so I think the best thing to do here is fix the test to not care about arguments being in the display. The result of gcc's PGO on debug symbols should not affect how we make Python work.

    I'll update the regex in the test tomorrow.

    @zooba zooba self-assigned this May 24, 2019
    @zooba
    Copy link
    Member

    zooba commented May 24, 2019

    Okay, fixing the regex isn't an option, as most of the tests (just not the one copy-pasted above) rely on verifying the parameter value.

    I'll figure out how to skip the test on PGO build instead.

    @zooba
    Copy link
    Member

    zooba commented May 24, 2019

    New changeset 6de4574 by Steve Dower in branch 'master':
    bpo-37023: Skip test_gdb under PGO (GH-13555)
    6de4574

    @zooba
    Copy link
    Member

    zooba commented May 24, 2019

    Test is now skipped if PGO was used.

    @zooba zooba closed this as completed May 24, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants