Discussion:
[Bug python/19107] New: valgrind invalid memory detected in GDB/Python
kevin.pouget at gmail dot com
2015-10-09 13:31:07 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19107

Bug ID: 19107
Summary: valgrind invalid memory detected in GDB/Python
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: kevin.pouget at gmail dot com
Target Milestone: ---

Hello,

when running GDB with valgrind, I get the following error messages:

==11657== Use of uninitialised value of size 8
==11657== by 0x4EE141: finalize_python (python.c:1619)
==11657== by 0x54EA75: do_my_cleanups (cleanups.c:155)
==11657== by 0x677DAD: quit_force (top.c:1516)
==11657== by 0x676B95: execute_command (top.c:476)
==11657== by 0x5B4329: command_handler (event-top.c:489)

==11657== Invalid read of size 4
==11657== by 0x4EE141: finalize_python (python.c:1619)
==11657== by 0x54EA75: do_my_cleanups (cleanups.c:155)
==11657== by 0x677DAD: quit_force (top.c:1516)
==11657== by 0x676B95: execute_command (top.c:476)
==11657== by 0x5B4329: command_handler (event-top.c:489)
==11657== by 0x5B496E: command_line_handler (event-top.c:564)
==11657== by 0x6C40C2: rl_callback_read_char (callback.c:220)
==11657== by 0x5B4348: rl_callback_read_char_wrapper (event-top.c:171)
==11657== by 0x5B4392: stdin_event_handler (event-top.c:432)
==11657== Address 0x6632020 is 3,504 bytes inside a block of size 4,064 free'd
==11657== by 0x5BA7FB7: obstack_free (in /usr/lib/libc-2.22.so)
==11657== by 0x54EA75: do_my_cleanups (cleanups.c:155)
==11657== by 0x6A8C6D: throw_exception (common-exceptions.c:273)
==11657== by 0x6A8DAA: throw_it (common-exceptions.c:355)
==11657== by 0x6A8E45: throw_verror (common-exceptions.c:361)
==11657== by 0x6A8EF6: throw_error (common-exceptions.c:376)
==11657== by 0x5746ED: call_site_for_pc (block.c:241)
==11657== by 0x62CFEC: call_site_find_chain_1 (dwarf2loc.c:880)
==11657== by 0x62CFEC: call_site_find_chain (dwarf2loc.c:990)
==11657== by 0x632C70: dwarf2_tailcall_sniffer_first
(dwarf2-frame-tailcall.c:389)
==11657== by 0x632226: dwarf2_frame_prev_register (dwarf2-frame.c:1294)
==11657== by 0x67FF37: frame_unwind_register_value (frame.c:1114)
==11657== Block was alloc'd at
==11657== by 0x6A0C37: xmalloc (common-utils.c:41)
==11657== by 0x5BA7C9D: _obstack_begin (in /usr/lib/libc-2.22.so)
==11657== by 0x62CF87: call_site_find_chain_1 (dwarf2loc.c:867)
==11657== by 0x62CF87: call_site_find_chain (dwarf2loc.c:990)
==11657== by 0x632C70: dwarf2_tailcall_sniffer_first
(dwarf2-frame-tailcall.c:389)
==11657== by 0x632226: dwarf2_frame_prev_register (dwarf2-frame.c:1294)
==11657== by 0x67FF37: frame_unwind_register_value (frame.c:1114)
==11657== by 0x6801BE: frame_register_unwind (frame.c:1019)
==11657== by 0x680609: frame_register_unwind_location (frame.c:1731)
==11657== by 0x680FAB: get_prev_frame_always_1 (frame.c:1934)
==11657== by 0x680FAB: get_prev_frame_always (frame.c:1973)
==11657== by 0x6815F0: get_prev_frame (frame.c:2215)
==11657== by 0x4F6CF4: frame_info_to_frame_object (py-frame.c:377)

and also:

==11657== Invalid read of size 4
==11657== by 0x5046A1: gdb_Py_DECREF (python-internal.h:187)
==11657== by 0x5046A1: unicode_to_encoded_string (py-utils.c:127)
==11657== by 0x504851: python_string_to_host_string (py-utils.c:219)
==11657== by 0x4FD407: get_doc_string (py-param.c:315)
==11657== by 0x4FD901: parmpy_init (py-param.c:722)
==11657== Address 0x7a86020 is 32 bytes before a block of size 3,136 in arena
"client"
or
==11657== Invalid read of size 4
==11657== by 0x5046A1: gdb_Py_DECREF (python-internal.h:187)
==11657== by 0x5046A1: unicode_to_encoded_string (py-utils.c:127)
==11657== by 0x504851: python_string_to_host_string (py-utils.c:219)
==11657== by 0x4F3B1F: cmdpy_init (py-cmd.c:607)
or
==11657== by 0x50486F: gdb_Py_DECREF (python-internal.h:187)
==11657== by 0x50486F: python_string_to_host_string (py-utils.c:220)
==11657== by 0x4F9B17: fnpy_init (py-function.c:181)

I suspect these faults often lead to segfault when using Python code inside
GDB, but I cannot yet get a reproducible example...

Line number refer to git #837a17b36c9e297f4bf33727e25dfa9f38360c17 (May 5,
2015)
--
You are receiving this mail because:
You are on the CC list for the bug.
kevin.pouget at gmail dot com
2015-10-09 13:38:12 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19107

Kevin Pouget <kevin.pouget at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |kevin.pouget at gmail dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-04-21 21:57:58 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19107

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Do you know how you ran gdb or what you did to get these traces?
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-15 07:59:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19107

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...