Skip to content

test_gdb fails for Python 2.7.15 #78095

Closed

Description

@Vibhuti18
mannequin
BPO 33914
Nosy @vstinner, @tirkarthi, @Vibhuti18

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 = None
closed_at = <Date 2018-06-29.12:44:34.568>
created_at = <Date 2018-06-20.10:39:13.939>
labels = ['build', 'invalid']
title = 'test_gdb fails for Python 2.7.15'
updated_at = <Date 2018-06-29.12:44:43.939>
user = 'https://github.com/Vibhuti18'

bugs.python.org fields:

activity = <Date 2018-06-29.12:44:43.939>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2018-06-29.12:44:34.568>
closer = 'vstinner'
components = ['Build']
creation = <Date 2018-06-20.10:39:13.939>
creator = 'vibhutisawant'
dependencies = []
files = []
hgrepos = []
issue_num = 33914
keywords = []
message_count = 8.0
messages = ['320060', '320144', '320161', '320420', '320421', '320630', '320705', '320716']
nosy_count = 3.0
nosy_names = ['vstinner', 'xtreak', 'vibhutisawant']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue33914'
versions = ['Python 2.7']

Activity

  1. Vibhuti18 commented on Jun 20, 2018

    Vibhuti18mannequin
    MannequinAuthor

    ======================================================================
    FAIL: test_down_at_bottom (test.test_gdb.StackNavigationTests)
    Verify handling of "py-down" at the bottom of the stack
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 708, in test_down_at_bottom
        cmds_after_breakpoint=['py-down'])
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 221, in get_stack_trace
        self.assertEqual(unexpected_errlines, [])
    AssertionError: Lists differ: ['Cannot create process: Opera... != []

    First list contains 4 additional elements.
    First extra element 0:
    'Cannot create process: Operation not permitted'

    + []
    - ['Cannot create process: Operation not permitted',
    -  'During startup program exited with code 127.',
    -  "Python Exception <class 'gdb.error'> No frame is currently selected.: ",
    -  'Error occurred in Python command: No frame is currently selected.']

    Ran 49 tests in 0.170s

    FAILED (failures=1, skipped=48)
    test test_gdb failed -- Traceback (most recent call last):
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 708, in test_down_at_bottom
        cmds_after_breakpoint=['py-down'])
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 221, in get_stack_trace
        self.assertEqual(unexpected_errlines, [])
    AssertionError: Lists differ: ['Cannot create process: Opera... != []

    First list contains 4 additional elements.
    First extra element 0:
    'Cannot create process: Operation not permitted'

    + []
    - ['Cannot create process: Operation not permitted',
    -  'During startup program exited with code 127.',
    -  "Python Exception <class 'gdb.error'> No frame is currently selected.: ",
    -  'Error occurred in Python command: No frame is currently selected.']

    1 test failed:
    test_gdb

  2. tirkarthi commented on Jun 21, 2018

    @tirkarthi
    Member

    I think it's a problem with user-level permission error not being able to create a process (Wild guess to try sudo?). The tests run without error for me. Please add in information regarding you environment, gdb version and perhaps the whole output of ./python -Werror -m test -v test_gdb

    # Test log

    karthi@ubuntu-s-1vcpu-1gb-blr1-01:~/python-build/cpython$ ./python -Werror -m test -v test_gdb
    == CPython 2.7.15+ (remotes/upstream/2.7:f291888, Jun 21 2018, 09:13:04) [GCC 5.4.0 20160609]
    == Linux-4.4.0-127-generic-x86_64-with-debian-stretch-sid little-endian
    == /home/karthi/python-build/cpython/build/test_python_13424
    == CPU count: 1
    Run tests sequentially
    0:00:00 load avg: 1.53 [1/1] test_gdb
    GDB version 7.11:
    GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
    Copyright (C) 2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html\>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/\>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/\>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    test_NULL_instance_dict (test.test_gdb.PrettyPrintTests)
    Ensure that a PyInstanceObject with with a NULL in_dict is handled ... ok
    test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with NULL ob_type is handled gracefully ... ok
    test_NULL_ptr (test.test_gdb.PrettyPrintTests)
    Ensure that a NULL PyObject* is handled gracefully ... ok
    test_builtin_function (test.test_gdb.PrettyPrintTests) ... ok
    test_builtin_method (test.test_gdb.PrettyPrintTests) ... ok
    test_builtins_help (test.test_gdb.PrettyPrintTests)
    Ensure that the new-style class _Helper in site.py can be handled ... ok
    test_classic_class (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of classic class instances ... ok
    test_corrupt_ob_type (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with a corrupt ob_type is handled gracefully ... ok
    test_corrupt_tp_flags (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with a type with corrupt tp_flags is handled ... ok
    test_corrupt_tp_name (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with a type with corrupt tp_name is handled ... ok
    test_dicts (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of dictionaries ... ok
    test_exceptions (test.test_gdb.PrettyPrintTests) ... ok
    test_frames (test.test_gdb.PrettyPrintTests) ... ok
    test_frozensets (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of frozensets ... ok
    test_getting_backtrace (test.test_gdb.PrettyPrintTests) ... ok
    test_int (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of various "int" values ... ok
    test_lists (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of lists ... ok
    test_long (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of various "long" values ... ok
    test_modern_class (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of new-style class instances ... ok
    test_selfreferential_dict (test.test_gdb.PrettyPrintTests)
    Ensure that a reference loop involving a dict doesn't lead proxyval ... ok
    test_selfreferential_list (test.test_gdb.PrettyPrintTests)
    Ensure that a reference loop involving a list doesn't lead proxyval ... ok
    test_selfreferential_new_style_instance (test.test_gdb.PrettyPrintTests) ... ok
    test_selfreferential_old_style_instance (test.test_gdb.PrettyPrintTests) ... ok
    test_sets (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of sets ... ok
    test_singletons (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of True, False and None ... ok
    test_strings (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of strings ... ok
    test_subclassing_list (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of an instance of a list subclass ... ok
    test_subclassing_tuple (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of an instance of a tuple subclass ... ok
    test_truncation (test.test_gdb.PrettyPrintTests)
    Verify that very long output is truncated ... ok
    test_tuples (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of tuples ... ok
    test_unicode (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of unicode values ... ok
    test_basic_command (test.test_gdb.PyListTests)
    Verify that the "py-list" command works ... ok
    test_one_abs_arg (test.test_gdb.PyListTests)
    Verify the "py-list" command with one absolute argument ... ok
    test_two_abs_args (test.test_gdb.PyListTests)
    Verify the "py-list" command with two absolute arguments ... ok
    test_down_at_bottom (test.test_gdb.StackNavigationTests)
    Verify handling of "py-down" at the bottom of the stack ... ok
    test_pyup_command (test.test_gdb.StackNavigationTests)
    Verify that the "py-up" command works ... ok
    test_up_at_top (test.test_gdb.StackNavigationTests)
    Verify handling of "py-up" at the top of the stack ... ok
    test_up_then_down (test.test_gdb.StackNavigationTests)
    Verify "py-up" followed by "py-down" ... ok
    test_bt (test.test_gdb.PyBtTests)
    Verify that the "py-bt" command works ... ok
    test_bt_full (test.test_gdb.PyBtTests)
    Verify that the "py-bt-full" command works ... ok
    test_gc (test.test_gdb.PyBtTests)
    Verify that "py-bt" indicates if a thread is garbage-collecting ... ok
    test_pycfunction (test.test_gdb.PyBtTests)
    Verify that "py-bt" displays invocations of PyCFunction instances ... ok
    test_threads (test.test_gdb.PyBtTests)
    Verify that "py-bt" indicates threads that are waiting for the GIL ... ok
    test_wrapper_call (test.test_gdb.PyBtTests) ... ok
    test_basic_command (test.test_gdb.PyPrintTests)
    Verify that the "py-print" command works ... ok
    test_print_after_up (test.test_gdb.PyPrintTests) ... ok
    test_printing_builtin (test.test_gdb.PyPrintTests) ... ok
    test_printing_global (test.test_gdb.PyPrintTests) ... ok
    test_basic_command (test.test_gdb.PyLocalsTests) ... ok
    test_locals_after_up (test.test_gdb.PyLocalsTests) ... ok

    ----------------------------------------------------------------------
    Ran 50 tests in 35.304s

    OK

    == Tests result: SUCCESS ==

    1 test OK.

    Total duration: 36 sec
    Tests result: SUCCESS

    Thanks

  3. vstinner commented on Jun 21, 2018

    @vstinner
    Member

    Vibhuti: Hi! Would you mind to describe your environment? What is your operating system (name, version)? Are you running test_gdb as root or as your normal user? How did you install Python?

    Note: I recently backported python-gdb.py a few enhancements from master to 2.7: commit e36f94f.

  4. Vibhuti18 commented on Jun 25, 2018

    Vibhuti18mannequin
    MannequinAuthor

    Hi ,sorry for the delayed reply
    The architecture is s390x and the OS is SLES 12 SP3
    (however test_gdb fails on SLES 11 SP4 too)
    Python was installed using https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
    The whole output of ./python -Werror -m test -v test_gdb is as below:

    test@4e227cf6c7ae:~/Python-2.7.15> sudo ./python -Werror -m test -v test_gdb
    == CPython 2.7.15 (default, Jun 25 2018, 05:10:18) [GCC 4.8.5]
    == Linux-4.15.0-22-generic-s390x-with-SuSE-12-s390x big-endian
    == /home/test/Python-2.7.15/build/test_python_21830
    == CPU count: 2
    Run tests sequentially
    0:00:00 load avg: 4.32 [1/1] test_gdb
    GDB version 8.0:
    GNU gdb (GDB; SUSE Linux Enterprise 12) 8.0.1
    Copyright (C) 2017 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html\>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "s390x-suse-linux".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://bugs.opensuse.org/\>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/\>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    test_NULL_instance_dict (test.test_gdb.PrettyPrintTests)
    Ensure that a PyInstanceObject with with a NULL in_dict is handled ... skipped 'Python was compiled with optimizations'
    test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with NULL ob_type is handled gracefully ... skipped 'Python was compiled with optimizations'
    test_NULL_ptr (test.test_gdb.PrettyPrintTests)
    Ensure that a NULL PyObject* is handled gracefully ... skipped 'Python was compiled with optimizations'
    test_builtin_function (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_builtin_method (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_builtins_help (test.test_gdb.PrettyPrintTests)
    Ensure that the new-style class _Helper in site.py can be handled ... skipped 'Python was compiled with optimizations'
    test_classic_class (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of classic class instances ... skipped 'Python was compiled with optimizations'
    test_corrupt_ob_type (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with a corrupt ob_type is handled gracefully ... skipped 'Python was compiled with optimizations'
    test_corrupt_tp_flags (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with a type with corrupt tp_flags is handled ... skipped 'Python was compiled with optimizations'
    test_corrupt_tp_name (test.test_gdb.PrettyPrintTests)
    Ensure that a PyObject* with a type with corrupt tp_name is handled ... skipped 'Python was compiled with optimizations'
    test_dicts (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of dictionaries ... skipped 'Python was compiled with optimizations'
    test_exceptions (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_frames (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_frozensets (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of frozensets ... skipped 'Python was compiled with optimizations'
    test_getting_backtrace (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_int (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of various "int" values ... skipped 'Python was compiled with optimizations'
    test_lists (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of lists ... skipped 'Python was compiled with optimizations'
    test_long (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of various "long" values ... skipped 'Python was compiled with optimizations'
    test_modern_class (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of new-style class instances ... skipped 'Python was compiled with optimizations'
    test_selfreferential_dict (test.test_gdb.PrettyPrintTests)
    Ensure that a reference loop involving a dict doesn't lead proxyval ... skipped 'Python was compiled with optimizations'
    test_selfreferential_list (test.test_gdb.PrettyPrintTests)
    Ensure that a reference loop involving a list doesn't lead proxyval ... skipped 'Python was compiled with optimizations'
    test_selfreferential_new_style_instance (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_selfreferential_old_style_instance (test.test_gdb.PrettyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_sets (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of sets ... skipped 'Python was compiled with optimizations'
    test_singletons (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of True, False and None ... skipped 'Python was compiled with optimizations'
    test_strings (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of strings ... skipped 'Python was compiled with optimizations'
    test_subclassing_list (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of an instance of a list subclass ... skipped 'Python was compiled with optimizations'
    test_subclassing_tuple (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of an instance of a tuple subclass ... skipped 'Python was compiled with optimizations'
    test_truncation (test.test_gdb.PrettyPrintTests)
    Verify that very long output is truncated ... skipped 'Python was compiled with optimizations'
    test_tuples (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of tuples ... skipped 'Python was compiled with optimizations'
    test_unicode (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of unicode values ... skipped 'Python was compiled with optimizations'
    test_basic_command (test.test_gdb.PyListTests)
    Verify that the "py-list" command works ... skipped 'Python was compiled with optimizations'
    test_one_abs_arg (test.test_gdb.PyListTests)
    Verify the "py-list" command with one absolute argument ... skipped 'Python was compiled with optimizations'
    test_two_abs_args (test.test_gdb.PyListTests)
    Verify the "py-list" command with two absolute arguments ... skipped 'Python was compiled with optimizations'
    test_down_at_bottom (test.test_gdb.StackNavigationTests)
    Verify handling of "py-down" at the bottom of the stack ... FAIL
    test_pyup_command (test.test_gdb.StackNavigationTests)
    Verify that the "py-up" command works ... skipped 'Python was compiled with optimizations'
    test_up_at_top (test.test_gdb.StackNavigationTests)
    Verify handling of "py-up" at the top of the stack ... skipped 'Python was compiled with optimizations'
    test_up_then_down (test.test_gdb.StackNavigationTests)
    Verify "py-up" followed by "py-down" ... skipped 'Python was compiled with optimizations'
    test_bt (test.test_gdb.PyBtTests)
    Verify that the "py-bt" command works ... skipped 'Python was compiled with optimizations'
    test_bt_full (test.test_gdb.PyBtTests)
    Verify that the "py-bt-full" command works ... skipped 'Python was compiled with optimizations'
    test_gc (test.test_gdb.PyBtTests)
    Verify that "py-bt" indicates if a thread is garbage-collecting ... skipped 'Python was compiled with optimizations'
    test_pycfunction (test.test_gdb.PyBtTests)
    Verify that "py-bt" displays invocations of PyCFunction instances ... skipped 'Python was compiled with optimizations'
    test_threads (test.test_gdb.PyBtTests)
    Verify that "py-bt" indicates threads that are waiting for the GIL ... skipped 'Python was compiled with optimizations'
    test_basic_command (test.test_gdb.PyPrintTests)
    Verify that the "py-print" command works ... skipped 'Python was compiled with optimizations'
    test_print_after_up (test.test_gdb.PyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_printing_builtin (test.test_gdb.PyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_printing_global (test.test_gdb.PyPrintTests) ... skipped 'Python was compiled with optimizations'
    test_basic_command (test.test_gdb.PyLocalsTests) ... skipped 'Python was compiled with optimizations'
    test_locals_after_up (test.test_gdb.PyLocalsTests) ... skipped 'Python was compiled with optimizations'

    ======================================================================
    FAIL: test_down_at_bottom (test.test_gdb.StackNavigationTests)
    Verify handling of "py-down" at the bottom of the stack
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 708, in test_down_at_bottom
        cmds_after_breakpoint=['py-down'])
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 221, in get_stack_trace
        self.assertEqual(unexpected_errlines, [])
    AssertionError: Lists differ: ['Could not trace the inferior... != []

    First list contains 4 additional elements.
    First extra element 0:
    'Could not trace the inferior process.'

    + []
    - ['Could not trace the inferior process.',
    -  'Error: ptrace: Operation not permittedDuring startup program exited with code 127.',
    -  "Python Exception <class 'gdb.error'> No frame is currently selected.: ",
    -  'Error occurred in Python command: No frame is currently selected.']

    Ran 49 tests in 0.455s

    FAILED (failures=1, skipped=48)
    test test_gdb failed -- Traceback (most recent call last):
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 708, in test_down_at_bottom
        cmds_after_breakpoint=['py-down'])
      File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 221, in get_stack_trace
        self.assertEqual(unexpected_errlines, [])
    AssertionError: Lists differ: ['Could not trace the inferior... != []

    First list contains 4 additional elements.
    First extra element 0:
    'Could not trace the inferior process.'

    + []
    - ['Could not trace the inferior process.',
    -  'Error: ptrace: Operation not permittedDuring startup program exited with code 127.',
    -  "Python Exception <class 'gdb.error'> No frame is currently selected.: ",
    -  'Error occurred in Python command: No frame is currently selected.']

    1 test failed:
    test_gdb

    Total duration: 2 sec
    Tests result: FAILURE

  5. Vibhuti18 commented on Jun 25, 2018

    Vibhuti18mannequin
    MannequinAuthor

    STINNER Hi
    I tried the commit but it did not work.The same failure is observed.

  6. vstinner commented on Jun 27, 2018

    @vstinner
    Member

    Could not trace the inferior process.

    Your issue doesn't seem to be related to Python, but more to gdb in general.

    Can you try very basic commands like:

    $ gdb -args python3 -c pass
    (gdb) run
    Starting program: /usr/bin/python3 -c pass
    [Inferior 1 (process 20811) exited normally]
    (gdb) quit

    Or more advanced cases like:

    vstinner@apu$ gdb -args ./python Lib/test/gdb_sample.py
    (gdb) b builtin_id
    Breakpoint 1 at 0x4dd7d0: file Python/bltinmodule.c, line 1205.
    (gdb) run
    Starting program: /home/vstinner/prog/python/master/python Lib/test/gdb_sample.py

    Breakpoint 1, builtin_id (self=0x7ffff7fc0c28, v=42)
        at Python/bltinmodule.c:1205
    1205	    return PyLong_FromVoidPtr(v);
    (gdb) py-bt
    Traceback (most recent call first):
      <built-in method id of module object at remote 0x7ffff7fc0c28>
      File "Lib/test/gdb_sample.py", line 10, in baz
        id(42)
      File "Lib/test/gdb_sample.py", line 7, in bar
        baz(a, b, c)
      File "Lib/test/gdb_sample.py", line 4, in foo
        bar(a, b, c)
      File "Lib/test/gdb_sample.py", line 12, in <module>
        foo(1, 2, 3)
    (gdb) quit
    A debugging session is active.
    Quit anyway? (y or n) y
  7. Vibhuti18 commented on Jun 29, 2018

    Vibhuti18mannequin
    MannequinAuthor

    Thanks STINNER for your help.The issue has been resolved.It was related to gdb itself and not Python.

  8. vstinner commented on Jun 29, 2018

    @vstinner
    Member

    Thanks STINNER for your help.The issue has been resolved.It was related to gdb itself and not Python.

    Oh good! Happy to see that you solved your issue!

  9. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-build

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions