old-cross-binutils/gdb/testsuite/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
..
amd64-py-framefilter-invalidarg.S Fix crash on Python frame filters with unreadable arg 2014-09-07 14:09:59 +02:00
lib-types.cc
lib-types.exp Fix and XFAIL test due to GCC PR55641, passes with clang 2014-04-24 13:22:10 -07:00
Makefile.in
py-arch.c
py-arch.exp Remove duplicated code on checking address 0x0 is accessiable 2014-08-09 08:46:32 +08:00
py-block.c
py-block.exp
py-breakpoint.c
py-breakpoint.exp Extension Language API 2014-02-05 19:27:58 -08:00
py-caller-is.c PR 15276: Add $_caller_is, $_caller_matches, $_any_caller_is, $_any_caller_matches 2014-09-06 09:15:44 -07:00
py-caller-is.exp PR 15276: Add $_caller_is, $_caller_matches, $_any_caller_is, $_any_caller_matches 2014-09-06 09:15:44 -07:00
py-cmd.c
py-cmd.exp Skip tests on completion and readline when readline lib isn't used 2014-03-26 21:11:08 +08:00
py-completion.exp PR python/16699: GDB Python command completion with overriden complete vs. completer class 2014-09-03 16:30:28 -04:00
py-completion.py PR python/16699: GDB Python command completion with overriden complete vs. completer class 2014-09-03 16:30:28 -04:00
py-error.exp
py-error.py
py-events-shlib.c
py-events.c
py-events.exp
py-events.py
py-evsignal.exp enable target async by default; separate MI and target notions of async 2014-05-29 14:38:02 +01:00
py-evthreads.c
py-evthreads.exp enable target async by default; separate MI and target notions of async 2014-05-29 14:38:02 +01:00
py-explore-cc.exp
py-explore.c
py-explore.cc
py-explore.exp
py-finish-breakpoint.c
py-finish-breakpoint.exp Copy .py files to remote host 2014-08-22 13:44:18 +08:00
py-finish-breakpoint.py
py-finish-breakpoint2.cc
py-finish-breakpoint2.exp Copy .py files to remote host 2014-08-22 13:44:18 +08:00
py-finish-breakpoint2.py
py-frame-args.c
py-frame-args.exp
py-frame-args.py
py-frame-inline.c Fix PR backtrace/15558 2014-04-18 10:34:09 +01:00
py-frame-inline.exp Fix PR backtrace/15558 2014-04-18 10:34:09 +01:00
py-frame.c
py-frame.exp Add support for reading frame registers to Python API. 2014-09-03 16:34:47 -07:00
py-framefilter-gdb.py.in
py-framefilter-invalidarg-gdb.py.in Fix crash on Python frame filters with unreadable arg 2014-09-07 14:09:59 +02:00
py-framefilter-invalidarg.exp Fix crash on Python frame filters with unreadable arg 2014-09-07 14:09:59 +02:00
py-framefilter-invalidarg.py Fix crash on Python frame filters with unreadable arg 2014-09-07 14:09:59 +02:00
py-framefilter-mi.c
py-framefilter-mi.exp
py-framefilter.c
py-framefilter.exp Fix typo in test name 2014-02-08 10:44:11 +01:00
py-framefilter.py
py-function.exp
py-inferior.c
py-inferior.exp
py-infthread.c
py-infthread.exp
py-linetable.c
py-linetable.exp
py-linetable.S
py-mi.exp
py-objfile-script-gdb.py.in
py-objfile-script.c
py-objfile-script.exp
py-objfile.c
py-objfile.exp
py-parameter.exp
py-pp-integral.c
py-pp-integral.exp
py-pp-integral.py
py-pp-maint.c
py-pp-maint.exp
py-pp-maint.py
py-pp-re-notag.c [Python] Make regexp collection printers work with typedefs as well. 2014-02-26 11:04:12 -08:00
py-pp-re-notag.exp [Python] Make regexp collection printers work with typedefs as well. 2014-02-26 11:04:12 -08:00
py-pp-re-notag.py [Python] Make regexp collection printers work with typedefs as well. 2014-02-26 11:04:12 -08:00
py-prettyprint.c Ensure unreferenced static symbols aren't omitted by clang (either marking them __attribute__((used)) or making them non-static) 2014-04-24 22:33:46 -07:00
py-prettyprint.exp Remove duplicated code on checking address 0x0 is accessiable 2014-08-09 08:46:32 +08:00
py-prettyprint.py
py-progspace.c
py-progspace.exp
py-prompt.c
py-prompt.exp enable target async by default; separate MI and target notions of async 2014-05-29 14:38:02 +01:00
py-section-script.c
py-section-script.exp
py-section-script.py
py-shared-sl.c
py-shared.c
py-shared.exp
py-strfns.c
py-strfns.exp
py-symbol.c
py-symbol.exp
py-symtab.exp
py-sync-interp.c
py-sync-interp.exp
py-template.cc
py-template.exp
py-type.c
py-type.exp
py-typeprint.cc
py-typeprint.exp
py-typeprint.py
py-value-cc.cc Call overloaded operators to perform operations on gdb.Value objects. 2014-02-19 15:47:45 -08:00
py-value-cc.exp Call overloaded operators to perform operations on gdb.Value objects. 2014-02-19 15:47:45 -08:00
py-value.c [python] Fix gdb.Value.dynamic_type for reference values. 2014-04-07 14:18:44 -07:00
py-value.exp set print symbol off in py-value.exp and scm-value.exp 2014-08-24 20:21:40 +08:00
py-xmethods.cc Make xmethods tests not to depend on inferior IO. 2014-06-18 04:31:47 -07:00
py-xmethods.exp Align behavior of xmethod commands with that of pretty-printer commands. 2014-06-23 04:57:51 -07:00
py-xmethods.py Fix xmethod Python so that it works with Python3. 2014-08-15 18:04:47 -07:00
python-1.c
python.c
python.exp Copy .py files to remote host 2014-08-22 13:44:18 +08:00
source1
source2.py