diff --git a/debian/changelog b/debian/changelog index 40b03c9e1..19cb314f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libgit2 (0.27.0+dfsg.1-0.9) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix random segfaults in threads::diff. + * Don't specifically use gcc-8 now that it's already the Debian default. + + -- Ximin Luo Sun, 05 Aug 2018 06:08:38 -0700 + libgit2 (0.27.0+dfsg.1-0.8) unstable; urgency=medium * Non-maintainer upload diff --git a/debian/control b/debian/control index 51b2175a1..cc34389b2 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Russell Sim Build-Depends: debhelper (>= 11~), python-minimal (>= 2.4.0), pkg-config, cmake, libz-dev, libmbedtls-dev, - libssh2-1-dev, libhttp-parser-dev, libkrb5-dev, gcc-8 + libssh2-1-dev, libhttp-parser-dev, libkrb5-dev Standards-Version: 4.1.4 Homepage: https://libgit2.github.com/ Vcs-Git: https://salsa.debian.org/debian/libgit2.git diff --git a/debian/patches/series b/debian/patches/series index cccba5bc2..73de064f3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ disable-online-tests.patch remove-mbedtls-from-pkgconfig.patch index-Fix-alignment-issues-in-write_disk_entry.patch fix-stack-smashing-error.patch +u-segfault-fix.patch diff --git a/debian/patches/u-segfault-fix.patch b/debian/patches/u-segfault-fix.patch new file mode 100644 index 000000000..0037a02a4 --- /dev/null +++ b/debian/patches/u-segfault-fix.patch @@ -0,0 +1,98 @@ +commit d1919485a5541fb3171d6fa835c7c0de41243dea +Author: Edward Thomson +Date: Sun Aug 5 11:01:14 2018 +0100 + + threads::diff: use separate git_repository objects + + Our thread policies state that we cannot re-use the `git_repository` + across threads. Our tests cannot deviate from that. + +diff --git a/tests/threads/diff.c b/tests/threads/diff.c +index 256040265..ab34b32a1 100644 +--- a/tests/threads/diff.c ++++ b/tests/threads/diff.c +@@ -76,26 +76,29 @@ static void free_trees(void) + static void *run_index_diffs(void *arg) + { + int thread = *(int *)arg; ++ git_repository *repo; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff = NULL; + size_t i; + int exp[4] = { 0, 0, 0, 0 }; + ++ cl_git_pass(git_repository_open(&repo, git_repository_path(_repo))); ++ + switch (thread & 0x03) { + case 0: /* diff index to workdir */; +- cl_git_pass(git_diff_index_to_workdir(&diff, _repo, NULL, &opts)); ++ cl_git_pass(git_diff_index_to_workdir(&diff, repo, NULL, &opts)); + break; + case 1: /* diff tree 'a' to index */; +- cl_git_pass(git_diff_tree_to_index(&diff, _repo, _a, NULL, &opts)); ++ cl_git_pass(git_diff_tree_to_index(&diff, repo, _a, NULL, &opts)); + break; + case 2: /* diff tree 'b' to index */; +- cl_git_pass(git_diff_tree_to_index(&diff, _repo, _b, NULL, &opts)); ++ cl_git_pass(git_diff_tree_to_index(&diff, repo, _b, NULL, &opts)); + break; + case 3: /* diff index to workdir (explicit index) */; + { + git_index *idx; +- cl_git_pass(git_repository_index(&idx, _repo)); +- cl_git_pass(git_diff_index_to_workdir(&diff, _repo, idx, &opts)); ++ cl_git_pass(git_repository_index(&idx, repo)); ++ cl_git_pass(git_diff_index_to_workdir(&diff, repo, idx, &opts)); + git_index_free(idx); + break; + } +@@ -132,6 +135,7 @@ static void *run_index_diffs(void *arg) + } + + git_diff_free(diff); ++ git_repository_free(repo); + giterr_clear(); + + return arg; +@@ -152,8 +156,10 @@ static void *run_index_diffs_with_modifier(void *arg) + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff = NULL; + git_index *idx = NULL; ++ git_repository *repo; + +- cl_git_pass(git_repository_index(&idx, _repo)); ++ cl_git_pass(git_repository_open(&repo, git_repository_path(_repo))); ++ cl_git_pass(git_repository_index(&idx, repo)); + + /* have first thread altering the index as we go */ + if (thread == 0) { +@@ -176,17 +182,17 @@ static void *run_index_diffs_with_modifier(void *arg) + + switch (thread & 0x03) { + case 0: /* diff index to workdir */; +- cl_git_pass(git_diff_index_to_workdir(&diff, _repo, idx, &opts)); ++ cl_git_pass(git_diff_index_to_workdir(&diff, repo, idx, &opts)); + break; + case 1: /* diff tree 'a' to index */; +- cl_git_pass(git_diff_tree_to_index(&diff, _repo, _a, idx, &opts)); ++ cl_git_pass(git_diff_tree_to_index(&diff, repo, _a, idx, &opts)); + break; + case 2: /* diff tree 'b' to index */; +- cl_git_pass(git_diff_tree_to_index(&diff, _repo, _b, idx, &opts)); ++ cl_git_pass(git_diff_tree_to_index(&diff, repo, _b, idx, &opts)); + break; + case 3: /* diff index to workdir reversed */; + opts.flags |= GIT_DIFF_REVERSE; +- cl_git_pass(git_diff_index_to_workdir(&diff, _repo, idx, &opts)); ++ cl_git_pass(git_diff_index_to_workdir(&diff, repo, idx, &opts)); + break; + } + +@@ -196,6 +202,7 @@ static void *run_index_diffs_with_modifier(void *arg) + + done: + git_index_free(idx); ++ git_repository_free(repo); + giterr_clear(); + + return arg; diff --git a/debian/rules b/debian/rules index 5103937c9..523fc1d07 100755 --- a/debian/rules +++ b/debian/rules @@ -13,8 +13,6 @@ TEST_TMPDIR := $(CURDIR)/tmp-test export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk -# build with gcc 7 segafaults in armhf -export CC=gcc-8 override_dh_auto_configure: dh_auto_configure --builddirectory=build-debian-release -- \