From da08b1a8f5ab7f6bc2741153abc577e71cd1c5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bonnard?= Date: Thu, 9 May 2019 12:01:30 +0200 Subject: [PATCH] Fix parallel build in 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..c001259 --- /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/hdrl/tests/hdrl_multiiter-test.c ++++ b/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/hdrl/tests/hdrl_frameiter-test.c ++++ b/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 b5461a1..e742251 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ Set-the-plugin-directory-so-that-esorex-and-python-cpl-ca.patch Force-serial-tests-to-get-better-verbose-output.patch Add-missing-lcpldrs-to-xsh_cfg_recover-recipe.patch Temporarily-disable-XSH_SDP_KEYWORD_APERTURE-test.patch +fix-parallel-build.patch -- GitLab