Bug 1325795
Summary: | GObject's Frame filter causes GDB to raise RuntimeError - "Cannot locate object file for block." | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jakub Filak <jfilak> |
Component: | gdb | Assignee: | Jan Kratochvil <jan.kratochvil> |
Status: | CLOSED ERRATA | QA Contact: | Martin Cermak <mcermak> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.2 | CC: | gdb-bugs, jan.kratochvil, jberan, mcermak, mpetlan, ohudlick, sergiodj |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | gdb-7.6.1-88.el7 | Doc Type: | No Doc Update |
Doc Text: |
undefined
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-04 03:51:00 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jakub Filak
2016-04-11 08:39:03 UTC
Jakub, BTW cannot ABRT use DTS GDB if available? It should always provide better results and it should be fully compatible with the target RHEL (modulo unexpected regressions). On a retrace server we could make DTS GDB even a requirement but I guess this Bug needs to be fixed even for non-retrace server use cases. Both GDBs call PyErr_SetString (PyExc_RuntimeError, ...) but Python then returns a different result. The same Python on the same OS, just with different GDB. There is some Python magic context I do not understand. 7.6.1-87.el7 gdb -ex 'set width 0' -ex 'set pagination off' -ex 'b py-frame.c:255' -ex r -ex bt -ex 'frame 12' -ex 'fini' --args ./gdb -batch glade-3 -ex 'set env DISPLAY=host2s:0' -ex start -ex 'b start_thread' -ex c -ex 't a a bt' 317 PyObject *result = PyObject_CallMethod (filter, func, NULL); Value returned is $1 = 0x0 7.11-69.el7 gdb -ex 'set width 0' -ex 'set pagination off' -ex 'b py-frame.c:317' -ex r -ex bt -ex 'frame 12' -ex 'fini' --args ./gdb -batch glade-3 -ex 'set env DISPLAY=host2s:0' -ex start -ex 'b start_thread' -ex c -ex 't a a bt' 324 PyObject *result = PyObject_CallMethod (filter, func, NULL); Value returned is $1 = [] in detail: python-2.7.5-34.el7.x86_64 7.6.1-87.el7 Breakpoint 1, frapy_block (self=<gdb.Frame at remote 0x556aab0>, args=0x0) at ../../gdb/python/py-frame.c:255 255 PyErr_SetString (PyExc_RuntimeError, #0 frapy_block (self=<gdb.Frame at remote 0x556aab0>, args=0x0) at ../../gdb/python/py-frame.c:255 #1 0x00007ffff66fe8e0 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffc980) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4082 #2 PyEval_EvalFrameEx (f=f@entry=Frame 0x5779c40, for file /usr/share/gdb/python/gdb/FrameDecorator.py, line 273, in fetch_frame_args (self=<FrameVars(frame=<gdb.Frame at remote 0x556aab0>, symbol_class={2: True, 3: True, 4: True, 5: True, 6: True, 7: True, 14: True}) at remote 0x556ab10>, args=[]), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:2740 #3 0x00007ffff66fe860 in fast_function (nk=<optimized out>, na=1, n=1, pp_stack=0x7fffffffcae0, func=<function at remote 0x7ffff7e8c398>) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4184 #4 call_function (oparg=<optimized out>, pp_stack=0x7fffffffcae0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4119 #5 PyEval_EvalFrameEx (f=f@entry=Frame 0x5232ce0, for file /usr/share/gdb/python/gdb/FrameDecorator.py, line 152, in frame_args (self=<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>, frame=<gdb.Frame at remote 0x556aab0>, args=<FrameVars(frame=<gdb.Frame at remote 0x556aab0>, symbol_class={2: True, 3: True, 4: True, 5: True, 6: True, 7: True, 14: True}) at remote 0x556ab10>), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:2740 #6 0x00007ffff67000bd in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, locals=locals@entry=0x0, args=args@entry=0x7ffff7e62e68, argcount=1, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=0x0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:3330 #7 0x00007ffff668cf68 in function_call (func=<function at remote 0x7ffff7e7ce60>, arg=(<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>,), kw=0x0) at /usr/src/debug/Python-2.7.5/Objects/funcobject.c:526 #8 0x00007ffff66680b3 in PyObject_Call (func=func@entry=<function at remote 0x7ffff7e7ce60>, arg=arg@entry=(<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>,), kw=kw@entry=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529 #9 0x00007ffff66770a5 in instancemethod_call (func=<function at remote 0x7ffff7e7ce60>, arg=(<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>,), kw=0x0) at /usr/src/debug/Python-2.7.5/Objects/classobject.c:2602 #10 0x00007ffff66680b3 in PyObject_Call (func=func@entry=<instancemethod at remote 0x7ffff7f23280>, arg=arg@entry=(), kw=kw@entry=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529 #11 0x00007ffff6668195 in call_function_tail (callable=<instancemethod at remote 0x7ffff7f23280>, args=()) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2561 #12 0x00007ffff666867b in _PyObject_CallMethod_SizeT (o=<optimized out>, name=0x922ab2 "frame_args", format=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2677 #13 0x000000000056783b in get_py_iter_from_func (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>, func=0x922ab2 "frame_args") at ../../gdb/python/py-framefilter.c:317 #14 0x0000000000568bfc in py_print_args (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>, out=0x105def0, args_type=CLI_SCALAR_VALUES, frame=0x5125e58) at ../../gdb/python/py-framefilter.c:948 #15 0x000000000056972d in py_print_frame (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>, flags=7, args_type=CLI_SCALAR_VALUES, out=0x105def0, indent=0, levels_printed=0x15f75c0) at ../../gdb/python/py-framefilter.c:1232 #16 0x000000000056a119 in apply_frame_filter (frame=0x5124ff8, flags=7, args_type=CLI_SCALAR_VALUES, out=0x105def0, frame_low=0, frame_high=-1) at ../../gdb/python/py-framefilter.c:1509 #17 0x0000000000642e75 in backtrace_command_1 (count_exp=0x0, show_locals=0, no_filters=0, from_tty=0) at ../../gdb/stack.c:1774 #18 0x00000000006432e1 in backtrace_command (arg=0x0, from_tty=0) at ../../gdb/stack.c:1888 #19 0x0000000000535093 in do_cfunc (c=0xf18f40, args=0x0, from_tty=0) at ../../gdb/cli/cli-decode.c:113 #20 0x0000000000538380 in cmd_func (cmd=0xf18f40, args=0x0, from_tty=0) at ../../gdb/cli/cli-decode.c:1859 #21 0x0000000000754aa7 in execute_command (p=0x7fffffffdda3 "", from_tty=0) at ../../gdb/top.c:487 #22 0x00000000006471f1 in thread_apply_all_command (cmd=0x7fffffffdda1 "bt", from_tty=0) at ../../gdb/thread.c:1205 #23 0x0000000000535093 in do_cfunc (c=0xf1a8b0, args=0x7fffffffdda1 "bt", from_tty=0) at ../../gdb/cli/cli-decode.c:113 #24 0x0000000000538380 in cmd_func (cmd=0xf1a8b0, args=0x7fffffffdda1 "bt", from_tty=0) at ../../gdb/cli/cli-decode.c:1859 #25 0x0000000000754aa7 in execute_command (p=0x7fffffffdda2 "t", from_tty=0) at ../../gdb/top.c:487 #26 0x0000000000648ade in catch_command_errors (command=0x754832 <execute_command>, arg=0x7fffffffdd9b "t a a bt", from_tty=0, mask=6) at ../../gdb/exceptions.c:573 #27 0x000000000064c5a8 in captured_main (data=0x7fffffffd890) at ../../gdb/main.c:1098 #28 0x00000000006489e3 in catch_errors (func=0x64b310 <captured_main>, func_args=0x7fffffffd890, errstring=0x969e00 "", mask=6) at ../../gdb/exceptions.c:546 #29 0x000000000064c6c3 in gdb_main (args=0x7fffffffd890) at ../../gdb/main.c:1144 #30 0x00000000004565ad in main (argc=13, argv=0x7fffffffd9a8) at ../../gdb/gdb.c:34 #12 0x00007ffff666867b in _PyObject_CallMethod_SizeT (o=<optimized out>, name=0x922ab2 "frame_args", format=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2677 2677 retval = call_function_tail(func, args); Run till exit from #12 0x00007ffff666867b in _PyObject_CallMethod_SizeT (o=<optimized out>, name=0x922ab2 "frame_args", format=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2677 0x000000000056783b in get_py_iter_from_func (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x556aab0>) at remote 0x556ab50>, func=0x922ab2 "frame_args") at ../../gdb/python/py-framefilter.c:317 317 PyObject *result = PyObject_CallMethod (filter, func, NULL); Value returned is $1 = 0x0 7.11-69.el7 Breakpoint 1, frapy_block (self=<gdb.Frame at remote 0x53baef0>, args=0x0) at ../../gdb/python/py-frame.c:317 317 PyErr_SetString (PyExc_RuntimeError, #0 frapy_block (self=<gdb.Frame at remote 0x53baef0>, args=0x0) at ../../gdb/python/py-frame.c:317 #1 0x00007ffff66ed8e0 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffc8d0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4082 #2 PyEval_EvalFrameEx (f=f@entry=Frame 0x56372d0, for file /opt/rh/devtoolset-4/root/usr/share/gdb/python/gdb/FrameDecorator.py, line 287, in fetch_frame_args (self=<FrameVars(frame=<gdb.Frame at remote 0x53baef0>, symbol_class={2: True, 3: True, 4: True, 5: True, 6: True, 7: True, 14: True}) at remote 0x53ba4d0>, args=[]), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:2740 #3 0x00007ffff66ed860 in fast_function (nk=<optimized out>, na=1, n=1, pp_stack=0x7fffffffca30, func=<function at remote 0x7ffff7e92050>) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4184 #4 call_function (oparg=<optimized out>, pp_stack=0x7fffffffca30) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4119 #5 PyEval_EvalFrameEx (f=f@entry=Frame 0x563c840, for file /opt/rh/devtoolset-4/root/usr/share/gdb/python/gdb/FrameDecorator.py, line 161, in frame_args (self=<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>, frame=<gdb.Frame at remote 0x53baef0>, args=<FrameVars(frame=<gdb.Frame at remote 0x53baef0>, symbol_class={2: True, 3: True, 4: True, 5: True, 6: True, 7: True, 14: True}) at remote 0x53ba4d0>), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:2740 #6 0x00007ffff66ef0bd in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, locals=locals@entry=0x0, args=args@entry=0x7ffff7e3f328, argcount=1, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=0x0) at /usr/src/debug/Python-2.7.5/Python/ceval.c:3330 #7 0x00007ffff667bf68 in function_call (func=<function at remote 0x7ffff7e85b18>, arg=(<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>,), kw=0x0) at /usr/src/debug/Python-2.7.5/Objects/funcobject.c:526 #8 0x00007ffff66570b3 in PyObject_Call (func=func@entry=<function at remote 0x7ffff7e85b18>, arg=arg@entry=(<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>,), kw=kw@entry=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529 #9 0x00007ffff66660a5 in instancemethod_call (func=<function at remote 0x7ffff7e85b18>, arg=(<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>,), kw=0x0) at /usr/src/debug/Python-2.7.5/Objects/classobject.c:2602 #10 0x00007ffff66570b3 in PyObject_Call (func=func@entry=<instancemethod at remote 0x7ffff7f23280>, arg=arg@entry=(), kw=kw@entry=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529 #11 0x00007ffff6657195 in call_function_tail (callable=<instancemethod at remote 0x7ffff7f23280>, args=()) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2561 #12 0x00007ffff665767b in _PyObject_CallMethod_SizeT (o=<optimized out>, name=0xa80ad2 "frame_args", format=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2677 #13 0x00000000005d3a81 in get_py_iter_from_func (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>, func=0xa80ad2 "frame_args") at ../../gdb/python/py-framefilter.c:324 #14 0x00000000005d4d40 in py_print_args (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>, out=0x12e46b0, args_type=CLI_SCALAR_VALUES, frame=0x5883810) at ../../gdb/python/py-framefilter.c:968 #15 0x00000000005d57cc in py_print_frame (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>, flags=7, args_type=CLI_SCALAR_VALUES, out=0x12e46b0, indent=0, levels_printed=0x5619970) at ../../gdb/python/py-framefilter.c:1269 #16 0x00000000005d6120 in gdbpy_apply_frame_filter (extlang=0xa7cda0 <extension_language_python>, frame=0x5822ca0, flags=7, args_type=CLI_SCALAR_VALUES, out=0x12e46b0, frame_low=0, frame_high=-1) at ../../gdb/python/py-framefilter.c:1580 #17 0x00000000006d72b3 in apply_ext_lang_frame_filter (frame=0x5822ca0, flags=7, args_type=CLI_SCALAR_VALUES, out=0x12e46b0, frame_low=0, frame_high=-1) at ../../gdb/extension.c:570 #18 0x00000000006cecaa in backtrace_command_1 (count_exp=0x0, show_locals=0, no_filters=0, from_tty=0) at ../../gdb/stack.c:1817 #19 0x00000000006cf104 in backtrace_command (arg=0x0, from_tty=0) at ../../gdb/stack.c:1932 #20 0x000000000059bb1a in do_cfunc (c=0x119fed0, args=0x0, from_tty=0) at ../../gdb/cli/cli-decode.c:105 #21 0x000000000059eff5 in cmd_func (cmd=0x119fed0, args=0x0, from_tty=0) at ../../gdb/cli/cli-decode.c:1885 #22 0x0000000000806029 in execute_command (p=0x7fffffffdda5 "", from_tty=0) at ../../gdb/top.c:475 #23 0x00000000006d4ff6 in thread_apply_all_command (cmd=0x7fffffffdda3 "bt", from_tty=0) at ../../gdb/thread.c:1814 #24 0x000000000059bb1a in do_cfunc (c=0x11a1a00, args=0x7fffffffdda3 "bt", from_tty=0) at ../../gdb/cli/cli-decode.c:105 #25 0x000000000059eff5 in cmd_func (cmd=0x11a1a00, args=0x7fffffffdda3 "bt", from_tty=0) at ../../gdb/cli/cli-decode.c:1885 #26 0x0000000000806029 in execute_command (p=0x7fffffffdda4 "t", from_tty=0) at ../../gdb/top.c:475 #27 0x00000000006daf72 in catch_command_errors (command=0x805d9e <execute_command>, arg=0x7fffffffdd9d "t a a bt", from_tty=0) at ../../gdb/main.c:369 #28 0x00000000006dc640 in captured_main (data=0x7fffffffd8b0) at ../../gdb/main.c:1218 #29 0x00000000006d65f4 in catch_errors (func=0x6db426 <captured_main>, func_args=0x7fffffffd8b0, errstring=0xad2679 "", mask=RETURN_MASK_ALL) at ../../gdb/exceptions.c:240 #30 0x00000000006dc74e in gdb_main (args=0x7fffffffd8b0) at ../../gdb/main.c:1263 #31 0x0000000000464446 in main (argc=13, argv=0x7fffffffd9b8) at ../../gdb/gdb.c:32 #12 0x00007ffff665767b in _PyObject_CallMethod_SizeT (o=<optimized out>, name=0xa80ad2 "frame_args", format=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2677 2677 retval = call_function_tail(func, args); Run till exit from #12 0x00007ffff665767b in _PyObject_CallMethod_SizeT (o=<optimized out>, name=0xa80ad2 "frame_args", format=0x0) at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2677 0x00000000005d3a81 in get_py_iter_from_func (filter=<FrameDecorator(_base=<gdb.Frame at remote 0x53baef0>) at remote 0x53bae90>, func=0xa80ad2 "frame_args") at ../../gdb/python/py-framefilter.c:324 324 PyObject *result = PyObject_CallMethod (filter, func, NULL); Value returned is $1 = [] This is not a Python Bug. Asking for a Python advice why PyObject_CallMethod() does return a different result in Comment 2, thanks. Removing python-maint, the bug was in a *.py code, not in *.c. QA: New testcase: PASS: gdb.python/py-framefilter-thread.exp: bt with filters #2 0x00007ffff75f228d in 941595343737041 () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M vs. #2 0x00007ffff75f228d in 941595343737041Traceback (most recent call last): File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 145, in frame_args return self._base.frame_args() File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 152, in frame_args return args.fetch_frame_args() File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 276, in fetch_frame_args block = self.frame.block() RuntimeError: Cannot locate object file for block. QA: Beware that testing /usr/bin/gdb binary in a different GDB tree does not work as this Bug modifies also files in /usr/share/gdb/ stored in GDB sourcetree in gdb/data-directory/ - not in the gdb binary itself. I made a mistake myself now. Another topic is that the testcase does not FAIL on unfixed GDB for all archs as apparently some of the archs have full debug info for all parts of the clone() function (which may be a bug on its own but I find that offtopic here). I could create a special binary for that but I somehow found that good enough as it is, fixed GDB does PASS for all archs: aarch64: PASS->PASS ppc64 : PASS->PASS ppc64le: FAIL->PASS x86_64 : FAIL->PASS s390x : PASS->PASS *** Bug 1348209 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2328.html |