From b09ccf57763280c5ad747d8223908e9a55fc05d6 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 11 Dec 2020 07:48:41 +0000 Subject: AppVeyor: make ASAN build actually build with ASAN Also add ASAN flags to CXXFLAGS --- .appveyor.yml | 3 ++- build-aux/appveyor-build.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e09fe5c..571fbf2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -6,9 +6,9 @@ environment: CONFIGURE_FLAGS: --with-hunspell-dir=/mingw64/share/hunspell VERBOSE: 1 # Get test logs in output matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu ASAN: 'yes' + - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu - APPVEYOR_BUILD_WORKER_IMAGE: macos # MSYS does not have hunspell packages # - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 @@ -27,6 +27,7 @@ for: - sudo add-apt-repository -y ppa:nuspell/ppa - sudo apt-get -y install libglib2.0-dev libaspell-dev hspell libhunspell-dev libvoikko-dev voikko-fi aspell-en libunittest++-dev hunspell-fr libnuspell-dev build_script: + - export ASAN - ./build-aux/appveyor-build.sh - matrix: diff --git a/build-aux/appveyor-build.sh b/build-aux/appveyor-build.sh index 6472d91..db42400 100755 --- a/build-aux/appveyor-build.sh +++ b/build-aux/appveyor-build.sh @@ -8,9 +8,9 @@ set -e ./bootstrap CONFIGURE_ARGS=(--enable-relocatable --with-zemberek=check) if [[ "$ASAN" == "yes" ]]; then - CONFIGURE_ARGS+=(CFLAGS="-g3 -fsanitize=address -fsanitize=undefined" LDFLAGS="-fsanitize=address -fsanitize=undefined") + CONFIGURE_ARGS+=(CFLAGS="-g3 -fsanitize=address -fsanitize=undefined" CXXFLAGS="-g3 -fsanitize=address -fsanitize=undefined" LDFLAGS="-fsanitize=address -fsanitize=undefined") fi -./configure --enable-silent-rules "${CONFIGURE_ARGS[@]}" +./configure "${CONFIGURE_ARGS[@]}" make make distcheck -- cgit v1.2.1 From 78e98c63904081b7a65209cd75e4335c4150ce03 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 11 Dec 2020 22:46:58 +0000 Subject: tests: fix some space leaks Accidentally trying to build with an unreleased git version of automake (post 1.16.3) led to a problem with libtool configuration that, I think, led to the test providers being built statically, and thereby revealed more leaks, though a lot of the reported leaks seemed to be bogus (leaks of C++ auto variables that should have been destroyed automatically). Also configure ASAN to report leak backtraces in full. --- tests/EnchantDictionaryTestFixture.h | 10 +++++++++- tests/Makefile.am | 2 +- tests/dictionary/enchant_dict_suggest_tests.cpp | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/EnchantDictionaryTestFixture.h b/tests/EnchantDictionaryTestFixture.h index cf820cf..368ad5a 100644 --- a/tests/EnchantDictionaryTestFixture.h +++ b/tests/EnchantDictionaryTestFixture.h @@ -214,6 +214,14 @@ struct EnchantDictionaryTestFixture : EnchantBrokerTestFixture } } + void FreePwlStringList(char** list) + { + if(list) + { + enchant_dict_free_string_list(_pwl, list); + } + } + bool IsWordInSession(const std::string& word){ return enchant_dict_is_added(_dict, word.c_str(), word.size())!=0; } @@ -309,7 +317,7 @@ struct EnchantDictionaryTestFixture : EnchantBrokerTestFixture std::vector result; if(expectedSuggestions != NULL && begin < cSuggestions){ result.insert(result.begin(), expectedSuggestions+begin, expectedSuggestions+cSuggestions); - FreeStringList(expectedSuggestions); + g_strfreev(expectedSuggestions); } return result; diff --git a/tests/Makefile.am b/tests/Makefile.am index 62adfc5..606159f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,7 +19,7 @@ AM_TESTS_ENVIRONMENT = \ cp $(srcdir)/test.pwl.orig $(builddir)/test.pwl; \ cp $(builddir)/@objdir@/*@shlibext@ .; \ chmod +w $(builddir)/test.pwl; \ - export LSAN_OPTIONS=suppressions=$(srcdir)/asan-suppressions.txt; + export LSAN_OPTIONS=suppressions=$(srcdir)/asan-suppressions.txt:fast_unwind_on_malloc=0; DISTCLEANFILES = test.pwl *@shlibext@ diff --git a/tests/dictionary/enchant_dict_suggest_tests.cpp b/tests/dictionary/enchant_dict_suggest_tests.cpp index cebd88e..99f2100 100644 --- a/tests/dictionary/enchant_dict_suggest_tests.cpp +++ b/tests/dictionary/enchant_dict_suggest_tests.cpp @@ -45,6 +45,7 @@ struct EnchantDictionarySuggestTestFixtureBase : EnchantDictionaryTestFixture { dictSuggestCalled = false; _suggestions = NULL; + _pwl_suggestions = NULL; suggestWord = std::string(); suggestBehavior = returnFour; } @@ -52,9 +53,11 @@ struct EnchantDictionarySuggestTestFixtureBase : EnchantDictionaryTestFixture ~EnchantDictionarySuggestTestFixtureBase() { FreeStringList(_suggestions); + FreePwlStringList(_pwl_suggestions); } char** _suggestions; + char** _pwl_suggestions; }; static char ** @@ -210,8 +213,8 @@ TEST_FIXTURE(EnchantDictionarySuggest_TestFixture, EnchantDictionarySuggest_InBrokerPwlSession) { enchant_dict_add(_pwl, "hello", -1); - _suggestions = enchant_dict_suggest(_pwl, "helo", -1, NULL); - CHECK(_suggestions); + _pwl_suggestions = enchant_dict_suggest(_pwl, "helo", -1, NULL); + CHECK(_pwl_suggestions); CHECK(!dictSuggestCalled); } -- cgit v1.2.1 From b7b6f21fefb4e3b2288bbe19c5276626fa2a66e5 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 22 Dec 2020 13:56:29 +0000 Subject: configure.ac: require nuspell >= 4.1.0 (fixes #267) --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3b1962e..5091d79 100644 --- a/configure.ac +++ b/configure.ac @@ -171,7 +171,7 @@ AC_DEFUN([ENCHANT_CHECK_PROVIDER_SETUP], AC_DEFUN([ENCHANT_CHECK_PKG_CONFIG_PROVIDER], [ENCHANT_CHECK_PROVIDER_SETUP([$1], [$4]) AS_IF([test "x$with_[]$1" != xno], - [PKG_CHECK_MODULES([$2], [m4_default([$3], [$1])], + [PKG_CHECK_MODULES([$2], [m4_default([$3], [$1])], [$2[]_CFLAGS="$[]$2[]_CFLAGS -DENCHANT_[]$2[]_DICT_DIR='\"$[]$1_dir\"'" with_$1=yes build_providers="$build_providers $1"], @@ -209,7 +209,7 @@ build_providers= dnl Standard providers ENCHANT_CHECK_PKG_CONFIG_PROVIDER([hunspell], [HUNSPELL]) -ENCHANT_CHECK_PKG_CONFIG_PROVIDER([nuspell], [NUSPELL]) +ENCHANT_CHECK_PKG_CONFIG_PROVIDER([nuspell], [NUSPELL], [nuspell >= 4.1.0]) ENCHANT_CHECK_LIB_PROVIDER([aspell], [ASPELL], [get_aspell_dict_info_list]) ENCHANT_CHECK_LIB_PROVIDER([hspell], [HSPELL], [hspell_get_dictionary_path],, [-lz]) ENCHANT_CHECK_PKG_CONFIG_PROVIDER([voikko], [VOIKKO], [libvoikko]) -- cgit v1.2.1 From 985879159879d30edf4a979b00ac8dc479076939 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 22 Dec 2020 14:00:49 +0000 Subject: Bump version to 2.2.15, and add NEWS --- NEWS | 8 ++++++++ configure.ac | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 084021b..dc0808d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +2.2.15 (December 22, 2020) +-------------------------- + +Specify that nuspell >= 4.1.0 is required. + +Fix some space leaks in the tests. + + 2.2.14 (December 10, 2020) -------------------------- diff --git a/configure.ac b/configure.ac index 5091d79..4877edc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([enchant],[2.2.14]) +AC_INIT([enchant],[2.2.15]) AC_CONFIG_SRCDIR(src/enchant.h) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([subdir-objects]) -- cgit v1.2.1