binutils-gdb/gdb/python
Jan Kratochvil c75bd3a239 Fix crash on Python frame filters with unreadable arg
https://bugzilla.redhat.com/show_bug.cgi?id=1126177

ERROR: AddressSanitizer: SEGV on unknown address 0x000000000050 (pc 0x000000992bef sp 0x7ffff9039530 bp 0x7ffff9039540
T0)
    #0 0x992bee in value_type .../gdb/value.c:925
    #1 0x87c951 in py_print_single_arg python/py-framefilter.c:445
    #2 0x87cfae in enumerate_args python/py-framefilter.c:596
    #3 0x87e0b0 in py_print_args python/py-framefilter.c:968

It crashes because frame_arg::val is documented it may contain NULL
(frame_arg::error is then non-NULL) but the code does not handle it.

Another bug is that py_print_single_arg() calls goto out of its TRY_CATCH
which messes up GDB cleanup chain crashing GDB later.

It is probably 7.7 regression (I have not verified it) due to the introduction
of Python frame filters.

gdb/ChangeLog

	PR python/17355
	* python/py-framefilter.c (py_print_single_arg): Handle NULL FA->VAL.
	Fix goto out of TRY_CATCH.

gdb/testsuite/ChangeLog

	PR python/17355
	* gdb.python/amd64-py-framefilter-invalidarg.S: New file.
	* gdb.python/py-framefilter-invalidarg-gdb.py.in: New file.
	* gdb.python/py-framefilter-invalidarg.exp: New file.
	* gdb.python/py-framefilter-invalidarg.py: New file.
2014-09-07 14:09:59 +02:00
..
lib/gdb PR 15276: Add $_caller_is, $_caller_matches, $_any_caller_is, $_any_caller_matches 2014-09-06 09:15:44 -07:00
py-arch.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-auto-load.c Include string.h in common-defs.h 2014-08-07 09:06:47 +01:00
py-block.c constify struct block in some places 2014-06-18 08:16:52 -06:00
py-bpevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-breakpoint.c Extension Language API 2014-02-05 19:27:58 -08:00
py-cmd.c PR python/16699: GDB Python command completion with overriden complete vs. completer class 2014-09-03 16:30:28 -04:00
py-continueevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-event.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-event.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-events.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evtregistry.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-evts.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-exitedevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-finishbreakpoint.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-frame.c Add support for reading frame registers to Python API. 2014-09-03 16:34:47 -07:00
py-framefilter.c Fix crash on Python frame filters with unreadable arg 2014-09-07 14:09:59 +02:00
py-function.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-gdb-readline.c Include string.h in common-defs.h 2014-08-07 09:06:47 +01:00
py-inferior.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-infthread.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-lazy-string.c Include gdb_assert.h in common-defs.h 2014-08-07 09:06:45 +01:00
py-linetable.c Fix Python stack corruption 2014-02-09 18:47:40 +01:00
py-newobjfileevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-objfile.c Xmethod support in Python. 2014-06-03 10:03:07 -07:00
py-param.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-prettyprint.c Extension Language API 2014-02-05 19:27:58 -08:00
py-progspace.c Xmethod support in Python. 2014-06-03 10:03:07 -07:00
py-signalevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-stopevent.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-stopevent.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-symbol.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-symtab.c constify some blockvector APIs 2014-06-18 08:16:59 -06:00
py-threadevent.c Add new infrun.h header. 2014-05-22 12:29:11 +01:00
py-type.c Add missing empty line after declarations in "if" block (py-type.c). 2014-01-15 16:32:05 +04:00
py-utils.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py-value.c Include gdb_assert.h in common-defs.h 2014-08-07 09:06:45 +01:00
py-varobj.c Iterate over 'struct varobj_item' instead of PyObject 2014-06-12 15:27:19 +08:00
py-xmethods.c Xmethod support in Python. 2014-06-03 10:03:07 -07:00
python-config.py
python-internal.h Move stdio.h to common-defs.h 2014-08-07 09:06:37 +01:00
python.c Move libiberty.h to common-defs.h 2014-08-07 09:06:41 +01:00
python.h Extension Language API 2014-02-05 19:27:58 -08:00