This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/17372] New: python hangs when displaying help()


https://sourceware.org/bugzilla/show_bug.cgi?id=17372

            Bug ID: 17372
           Summary: python hangs when displaying help()
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: serge.chatroux at st dot com

I use gdb 7.8 compiled on Linux (RedHat) with python 2.7.2 support.

When I type the following commands:

    (gdb)  python
    >help()
    >end

The first part of python help is displayed and a 'help>' prompt is displayed.
But I can no more enter commands to display the end of the help.
I need to suspend/restore gdb using CTRL-Z and fg to be able to enter new
commands.

See following dump:

    GNU gdb (GDB) 7.8
    Copyright (C) 2014 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-unknown-linux-gnu".
    ...
    (gdb) python
    >help()
    >end

    Welcome to Python 2.7!  This is the online help utility.

    If this is your first time using Python, you should definitely check out
    the tutorial on the Internet at http://docs.python.org/tutorial/.

    Enter the name of any module, keyword, or topic to get help on writing
    Python programs and using Python modules.  To quit this help utility and
    return to the interpreter, just type "quit".

    To get a list of available modules, keywords, or topics, type "modules",
    "keywords", or "topics".  Each module also comes with a one-line summary
    of what it does; to list the modules whose summaries contain a given word
    such as "spam", type "modules spam".

    help> 
    [1]+  Stopped                 gdb
    [gnx2544][~]fg
    gdb

    You are now leaving help and returning to the Python interpreter.
    If you want to ask for help on a particular object directly from the
    interpreter, you can type "help(object)".  Executing "help('string')"
    has the same effect as typing a particular string at the help> prompt.
    (gdb) 


I tried to debug this issue but I did not find the root cause.
When gdb is hanged, if gdb has the following call stack:


    help> 
    Program received signal SIGINT, Interrupt.
    0x0000003c136c6b70 in __read_nocancel () from /lib64/libc.so.6
    (gdb) bt
    #0  0x0000003c136c6b70 in __read_nocancel () from /lib64/libc.so.6
    #1  0x0000003c1366cd77 in _IO_new_file_underflow () from /lib64/libc.so.6
    #2  0x0000003c1366d73e in _IO_default_uflow_internal () from
/lib64/libc.so.6
    #3  0x00002aaaab139e9f in get_line (f=0x2aaaaf634150, n=-1) at
/usr/include/bits/stdio.h:62
    #4  0x00002aaaab13c307 in PyFile_GetLine (f=0x2aaaaf634150, n=-1) at
Objects/fileobject.c:1508
    #5  0x00002aaaab1b0268 in builtin_raw_input (self=<optimized out>,
args=0xe0f650) at Python/bltinmodule.c:2079
    #6  0x00002aaaab1bae4a in call_function (oparg=<optimized out>,
pp_stack=<optimized out>) at Python/ceval.c:4013
    #7  PyEval_EvalFrameEx (f=0x138c9e0, throwflag=<optimized out>) at
Python/ceval.c:2666
    #8  0x00002aaaab1bba3e in call_function (oparg=<optimized out>,
pp_stack=<optimized out>) at Python/ceval.c:4099
    #9  PyEval_EvalFrameEx (f=0x145d640, throwflag=<optimized out>) at
Python/ceval.c:2666
    #10 0x00002aaaab1bba3e in call_function (oparg=<optimized out>,
pp_stack=<optimized out>) at Python/ceval.c:4099
    #11 PyEval_EvalFrameEx (f=0x14126f0, throwflag=<optimized out>) at
Python/ceval.c:2666
    #12 0x00002aaaab1bcfd9 in PyEval_EvalCodeEx (co=0x13e8bb0,
globals=<optimized out>, locals=<optimized out>, args=0x2, argcount=1,
kws=0x2aaaaf61c068, kwcount=0, defs=0x1479ba8, defcount=1, closure=0x0) at
Python/ceval.c:3253
    #13 0x00002aaaab143b92 in function_call (func=0x1470e60, arg=0xe0f390,
kw=0xe60ff0) at Objects/funcobject.c:526
    #14 0x00002aaaab116c27 in PyObject_Call (func=0x1470e60, arg=0xe0f390,
kw=0xe60ff0) at Objects/abstract.c:2529
    #15 0x00002aaaab126f2f in instancemethod_call (func=<optimized out>,
arg=0xe0f390, kw=0xe60ff0) at Objects/classobject.c:2578
    #16 0x00002aaaab116c27 in PyObject_Call (func=0x2aaaaf702dc0,
arg=0x2aaaaf61c050, kw=0xe60ff0) at Objects/abstract.c:2529
    #17 0x00002aaaab1275da in instance_call (func=<optimized out>,
arg=0x2aaaaf61c050, kw=0xe60ff0) at Objects/classobject.c:2129
    #18 0x00002aaaab116c27 in PyObject_Call (func=0x15154d0,
arg=0x2aaaaf61c050, kw=0xe60ff0) at Objects/abstract.c:2529
    #19 0x00002aaaab1b5bf0 in ext_do_call (nk=<optimized out>, na=<optimized
out>, flags=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at
Python/ceval.c:4326
    #20 PyEval_EvalFrameEx (f=0xe5d0c0, throwflag=<optimized out>) at
Python/ceval.c:2705
    #21 0x00002aaaab1bcfd9 in PyEval_EvalCodeEx (co=0x2aaaaf68fc30,
globals=<optimized out>, locals=<optimized out>, args=0xe0f328, argcount=1,
kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
    #22 0x00002aaaab143b92 in function_call (func=0x2aaaaf6fd6e0, arg=0xe0f310,
kw=0x0) at Objects/funcobject.c:526
    #23 0x00002aaaab116c27 in PyObject_Call (func=0x2aaaaf6fd6e0, arg=0xe0f310,
kw=0x0) at Objects/abstract.c:2529
    #24 0x00002aaaab126f2f in instancemethod_call (func=<optimized out>,
arg=0xe0f310, kw=0x0) at Objects/classobject.c:2578
    #25 0x00002aaaab116c27 in PyObject_Call (func=0x2aaaaf685370,
arg=0x2aaaaf61c050, kw=0x0) at Objects/abstract.c:2529
    #26 0x00002aaaab176ada in slot_tp_call (self=<optimized out>,
args=0x2aaaaf61c050, kwds=0x0) at Objects/typeobject.c:5397
    #27 0x00002aaaab116c27 in PyObject_Call (func=0xd99bd0, arg=0x2aaaaf61c050,
kw=0x0) at Objects/abstract.c:2529
    #28 0x00002aaaab1b9481 in call_function (oparg=<optimized out>,
pp_stack=<optimized out>) at Python/ceval.c:4231
    #29 PyEval_EvalFrameEx (f=0x1444ba0, throwflag=<optimized out>) at
Python/ceval.c:2666
    #30 0x00002aaaab1bcfd9 in PyEval_EvalCodeEx (co=0xdaef30,
globals=<optimized out>, locals=<optimized out>, args=0x0, argcount=0, kws=0x0,
kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
    #31 0x00002aaaab1bd2d2 in PyEval_EvalCode (co=0x0, globals=0x2aaab06a4000,
locals=0x400) at Python/ceval.c:667
    #32 0x00002aaaab1de6b9 in run_mod (arena=<optimized out>, flags=<optimized
out>, locals=<optimized out>, globals=<optimized out>, filename=<optimized
out>, mod=<optimized out>) at Python/pythonrun.c:1346
    #33 PyRun_StringFlags (str=0x1416030 "help()\n", start=<optimized out>,
globals=0xd1d7d0, locals=0xd1d7d0, flags=0x0) at Python/pythonrun.c:1309
    #34 0x00002aaaab1df8b0 in PyRun_SimpleStringFlags (command=0x1416030
"help()\n", flags=0x0) at Python/pythonrun.c:962
    #35 0x00000000005032d0 in gdbpy_eval_from_control_command ()
    #36 0x00000000004e6147 in execute_control_command ()
    #37 0x00000000005031d4 in python_command ()
    #38 0x000000000068a52a in execute_command ()
    #39 0x00000000005d3d1c in command_handler ()
    #40 0x00000000005d4767 in command_line_handler ()
    #41 0x00000000006d3947 in rl_callback_read_char ()
    #42 0x00000000005d3d89 in rl_callback_read_char_wrapper ()
    #43 0x00000000005d30d0 in process_event ()
    #44 0x00000000005d393e in gdb_do_one_event ()
    #45 0x00000000005d3988 in start_event_loop ()
    #46 0x00000000005cd266 in captured_command_loop ()
    #47 0x00000000005ca50b in catch_errors ()
    #48 0x00000000005cdc6a in captured_main ()
    #49 0x00000000005ca50b in catch_errors ()
    #50 0x00000000005ccf5f in gdb_main ()
    #51 0x0000000000469478 in main ()

This bug does not exist on gdb 7.6.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]