From 810969053073b01c948f6566cc1a5b013de3fa32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Thu, 15 Aug 2019 19:47:02 +0200 Subject: [PATCH 1/2] TUI: do not use "starting" global mutated by main thread --- src/nvim/tui/tui.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 519ef1cccd..267a06d318 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -103,6 +103,7 @@ typedef struct { bool busy, is_invisible; bool cork, overflow; bool cursor_color_changed; + bool is_starting; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; HlAttrs clear_attrs; kvec_t(HlAttrs) attrs; @@ -396,6 +397,7 @@ static void tui_main(UIBridgeData *bridge, UI *ui) ui->data = data; data->bridge = bridge; data->loop = &tui_loop; + data->is_starting = true; kv_init(data->invalid_regions); signal_watcher_init(data->loop, &data->winch_handle, ui); signal_watcher_init(data->loop, &data->cont_handle, data); @@ -888,7 +890,7 @@ static void tui_grid_resize(UI *ui, Integer g, Integer width, Integer height) r->right = MIN(r->right, grid->width); } - if (!got_winch && (!starting || did_user_set_dimensions)) { + if (!got_winch && (!data->is_starting || did_user_set_dimensions)) { // Resize the _host_ terminal. UNIBI_SET_NUM_VAR(data->params[0], (int)height); UNIBI_SET_NUM_VAR(data->params[1], (int)width); @@ -1051,6 +1053,7 @@ static void tui_mode_change(UI *ui, String mode, Integer mode_idx) { TUIData *data = ui->data; tui_set_mode(ui, (ModeShape)mode_idx); + data->is_starting = false; // mode entered, no longer starting data->showing_mode = (ModeShape)mode_idx; } @@ -1355,7 +1358,7 @@ static void tui_guess_size(UI *ui) int width = 0, height = 0; // 1 - look for non-default 'columns' and 'lines' options during startup - if (starting && (Columns != DFLT_COLS || Rows != DFLT_ROWS)) { + if (data->is_starting && (Columns != DFLT_COLS || Rows != DFLT_ROWS)) { did_user_set_dimensions = true; assert(Columns >= INT_MIN && Columns <= INT_MAX); assert(Rows >= INT_MIN && Rows <= INT_MAX); From e79ea696a2e73e155c3232babafd4a87742b49e2 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 15 Aug 2019 21:58:22 +0200 Subject: [PATCH 2/2] Remove TSan suppression config [skip appveyor] --- .travis.yml | 2 +- src/.tsan-suppressions | 2 -- src/nvim/README.md | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 src/.tsan-suppressions diff --git a/.travis.yml b/.travis.yml index 534cff86fa..325b5e7b56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ env: -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" # Environment variables for Clang sanitizers. - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan" - - TSAN_OPTIONS="log_path=$LOG_DIR/tsan:suppressions=$TRAVIS_BUILD_DIR/src/.tsan-suppressions" + - TSAN_OPTIONS="log_path=$LOG_DIR/tsan" - UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" # Environment variables for Valgrind. - VALGRIND_LOG="$LOG_DIR/valgrind-%p.log" diff --git a/src/.tsan-suppressions b/src/.tsan-suppressions deleted file mode 100644 index c004a468a6..0000000000 --- a/src/.tsan-suppressions +++ /dev/null @@ -1,2 +0,0 @@ -# Ref: https://github.com/neovim/neovim/pull/10591#issuecomment-521248233 -race:starting diff --git a/src/nvim/README.md b/src/nvim/README.md index 64d729cc8b..b5f3634fef 100644 --- a/src/nvim/README.md +++ b/src/nvim/README.md @@ -63,7 +63,7 @@ Enable the sanitizer(s) via these environment variables: export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer export MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer - export TSAN_OPTIONS="log_path=${HOME}/logs/tsan:suppressions=${NVIM_PATH}/src/.tsan-suppressions" + export TSAN_OPTIONS="log_path=${HOME}/logs/tsan" Logs will be written to `${HOME}/logs/*san.PID`.