teak-llvm/lldb/packages/Python/lldbsuite/test
Pavel Labath 38c2059aec Fix segfault resulting from empty print prompt
Summary:
I have found a way to segfault lldb in 7 keystrokes! Steps to reproduce:
1) Launch lldb
2) Type `print` and hit enter. lldb will now prompt you to type a list of
    expressions, followed by an empty line.
3) Hit enter, indicating the end of your input.
4) Segfault!

After some investigation, I've found the issue in Host/common/Editline.cpp.
Editline::MoveCursor() relies on m_input_lines not being empty when the `to`
argument is CursorPosition::BlockEnd. This scenario, as far as I can tell,
occurs in one specific instance: In Editline::EndOrAddLineCommand() when the
list of lines being processed contains exactly one string (""). Meeting this
condition is fairly simple, I have posted steps to reproduce above.

Reviewers: krytarowski, zturner, labath

Reviewed By: labath

Subscribers: scott.smith, lldb-commits

Differential Revision: https://reviews.llvm.org/D32421
Patch by Alex Langford.

llvm-svn: 302225
2017-05-05 11:51:21 +00:00
..
android/platform *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
api Mark this as skipped for now. There is a race condition with 2017-03-10 05:33:27 +00:00
arm_emulation *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
attic *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
benchmarks *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
driver/batch_mode *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
example *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
expression_command Fix segfault resulting from empty print prompt 2017-05-05 11:51:21 +00:00
functionalities ABISysV_arm64: compute return value for large vectors correctly 2017-05-05 10:50:02 +00:00
help One more cleanup to lldb version printing 2016-11-14 22:43:08 +00:00
issue_verification test infra: clear file-charged issues on rerun of file 2016-10-01 00:17:08 +00:00
lang Windows fix for TestConflictingDefinition makefile 2017-05-03 11:27:35 +00:00
linux NPL: Fix one more bug in the single step workaround 2017-02-17 11:48:34 +00:00
logging *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
macosx Back to xfailing this. For some reason on our buildbots 2017-03-08 06:45:34 +00:00
make Android.rules: set "ar" path correctly 2017-05-02 13:14:45 +00:00
plugins *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
python_api Switch SBBreakpointLocation to use a weak_ptr 2017-03-01 10:08:48 +00:00
sample_test Make it clear what you should modify when you copy any of these sample 2017-03-01 22:23:30 +00:00
settings add stop column highlighting support 2016-09-21 20:13:14 +00:00
source-manager add stop column highlighting support 2016-09-21 20:13:14 +00:00
terminal *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
test_runner added Linux support for test timeout sampling 2016-09-26 20:25:47 +00:00
tools [LLDB][MIPS] Forgot to add check in commit rl301530 2017-04-27 12:27:42 +00:00
types *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
warnings/uuid *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
__init__.py Get rid of global variables in dotest.py 2015-12-08 01:15:30 +00:00
.categories
bench-history
bench.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
concurrent_base.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
configuration.py The darwin_log tests are very fragile and currently do not properly assess the state of that functionality. 2017-04-05 20:33:39 +00:00
crashinfo.c
darwin_log.py add availability check to DarwinLog event tests 2016-09-16 03:07:14 +00:00
decorators.py skip android in @skipIfHostIncompatibleWithRemote 2016-11-28 12:15:19 +00:00
dosep.py dotest.py: remove the ability to specify different architectures/compilers in a single invocation 2017-03-15 08:51:59 +00:00
dotest_args.py dotest.py: remove the ability to specify different architectures/compilers in a single invocation 2017-03-15 08:51:59 +00:00
dotest.py Centralize libc++ test skipping logic 2017-03-29 21:01:14 +00:00
lldb_pylint_helper.py Updated lldb_pylint_helper to work with recent Python package changes. 2015-11-10 20:01:33 +00:00
lldbbench.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldbcurses.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldbdwarf.py [LLDB][MIPS] Fix TestLldbGdbServer failure for MIPS 2017-01-10 09:33:43 +00:00
lldbinline.py dotest.py: remove the ability to specify different architectures/compilers in a single invocation 2017-03-15 08:51:59 +00:00
lldbpexpect.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldbplatform.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldbplatformutil.py Centralize libc++ test skipping logic 2017-03-29 21:01:14 +00:00
lldbtest_config.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldbtest.py Fix remote test suite directory creation 2017-03-20 16:07:17 +00:00
lldbutil.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lock.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
Makefile
README-TestSuite Add a sample_test directory with simple starter 2017-03-01 20:25:48 +00:00
redo.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
test_categories.py The darwin_log tests are very fragile and currently do not properly assess the state of that functionality. 2017-04-05 20:33:39 +00:00
test_result.py Improvements to testing blacklist 2016-10-04 18:48:00 +00:00