From 4618b6c136bfb81c99e366c5ba7775a4e2657d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bonnard?= Date: Tue, 7 May 2019 18:10:55 +0200 Subject: [PATCH] Fix parallel build in mosca/hdrd/tests hdrl_multiiter-test and hdrl_frameiter-test use the same base names for their data with a pid suffix but remove all files without using the pid suffix : char * fn = cpl_sprintf("frameiter%zu_%zd.fits", i, (intptr_t)getpid()); ... if (system("rm -f frameiter*fits")) {} So potentially, in parallel builds, tests can remove the files from the other one which happens systematically to me, which leads to a sigsev. This fix removes only the pid suffixed .fits created by the current process. --- debian/patches/fix-parallel-build.patch | 40 +++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 41 insertions(+) create mode 100644 debian/patches/fix-parallel-build.patch diff --git a/debian/patches/fix-parallel-build.patch b/debian/patches/fix-parallel-build.patch new file mode 100644 index 0000000..f575096 --- /dev/null +++ b/debian/patches/fix-parallel-build.patch @@ -0,0 +1,40 @@ +Description: Fix parallel build + hdrl_multiiter-test and hdrl_frameiter-test use the same base names for their + data with a pid suffix but remove all files without using the pid suffix : + + char * fn = cpl_sprintf("frameiter%zu_%zd.fits", i, (intptr_t)getpid()); + ... + if (system("rm -f frameiter*fits")) {} + + So potentially, in parallel builds, tests can remove the files from the + other one which happens systematically to me, which leads to a sigsev. + This fix removes only the pid suffixed .fits created by the current process. +Author: Frédéric Bonnard +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/mosca/hdrl/tests/hdrl_multiiter-test.c ++++ b/mosca/hdrl/tests/hdrl_multiiter-test.c +@@ -231,7 +231,9 @@ + cpl_test_error(CPL_ERROR_NONE); + + cpl_frameset_delete(frames); +- if (system("rm -f frameiter*fits")) {} ++ char * rm_fns = cpl_sprintf("rm -fr frameiter*_%zd.fits", (intptr_t)getpid()); ++ if (system(rm_fns)) {} ++ cpl_free(rm_fns); + + cpl_test_error(CPL_ERROR_NONE); + +--- a/mosca/hdrl/tests/hdrl_frameiter-test.c ++++ b/mosca/hdrl/tests/hdrl_frameiter-test.c +@@ -292,7 +292,9 @@ + } + + cpl_frameset_delete(frames); +- if (system("rm -f frameiter*fits")) {} ++ char * rm_fns = cpl_sprintf("rm -fr frameiter*_%zd.fits", (intptr_t)getpid()); ++ if (system(rm_fns)) {} ++ cpl_free(rm_fns); + } + + /*----------------------------------------------------------------------------*/ diff --git a/debian/patches/series b/debian/patches/series index aa827f2..82c41ed 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ dont_build_sextractor.patch disable_tests_libmosca.patch fix_test_fail.patch force-serial-tests.patch +fix-parallel-build.patch -- GitLab