[med-svn] [Git][med-team/camitk][master] Fix segfault on exit and disable some tests that create side effects

Manik Bhattacharjee (@manik.bhattacharjee) gitlab at salsa.debian.org
Fri Sep 18 01:12:09 BST 2026



Manik Bhattacharjee pushed to branch master at Debian Med / camitk


Commits:
53477de6 by Manik Bhattacharjee at 2026-09-18T01:35:29+02:00
Fix segfault on exit and disable some tests that create side effects

- - - - -


9 changed files:

- debian/changelog
- debian/patches/0001-disable-graph-generation-in-api.patch
- debian/patches/0002-disable-python-binding-library-test.patch
- debian/patches/0003-force-camitk-extension-on-save.patch
- debian/patches/0004-remove-invalid-line-desktop-file.patch
- debian/patches/0005-vtk-9.6.patch
- + debian/patches/0006-Fix-segfault-on-exit.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+camitk (6.0.0-5) UNRELEASED; urgency=medium
+
+  * Fix a segfault on exit with newer dependencies versions.
+  * Disable tests that have side effects that make other tests to fail.
+
+ -- Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>  Fri, 18 Sep 2026 01:31:50 +0200
+
 camitk (6.0.0-4) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/0001-disable-graph-generation-in-api.patch
=====================================
@@ -1,12 +1,20 @@
-Description: Disable graph generation in apidoc 
- Generating graphs in apidoc takes a lot of resources.
- It is not particularly needed as it is available
- online and can be generated from the sources if
- needed.
-Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+From: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+Date: Wed, 16 Sep 2026 15:06:51 +0200
+Subject: Disable graph generation in apidoc
+
 Forwarded: not-needed
 Last-Update: 2025-12-10
 
+Generating graphs in apidoc takes a lot of resources.
+It is not particularly needed as it is available
+online and can be generated from the sources if
+needed.
+---
+ sdk/doc/doxygen.conf.in | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/sdk/doc/doxygen.conf.in b/sdk/doc/doxygen.conf.in
+index ab77fc3..7a780cf 100644
 --- a/sdk/doc/doxygen.conf.in
 +++ b/sdk/doc/doxygen.conf.in
 @@ -2516,7 +2516,7 @@ DOT_FONTPATH           =


=====================================
debian/patches/0002-disable-python-binding-library-test.patch
=====================================
@@ -1,25 +1,20 @@
-Description: Disable python binding library tests
- Python binding library tests require a virtual environment which needs
- internet connection to install python requirements which is forbidden
- during package building on salsa.
+From: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+Date: Wed, 16 Sep 2026 15:06:51 +0200
+Subject: Disable python binding library tests
 
+Python binding library tests require a virtual environment which needs
+internet connection to install python requirements which is forbidden
+during package building on salsa.
 Forwarded: not-needed
 Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+---
+ sdk/applications/config/CMakeLists.txt             | 2 +-
+ sdk/applications/extensiongenerator/CMakeLists.txt | 2 +-
+ sdk/libraries/python/CMakeLists.txt                | 6 ++++--
+ 3 files changed, 6 insertions(+), 4 deletions(-)
 
---- a/sdk/libraries/python/CMakeLists.txt
-+++ b/sdk/libraries/python/CMakeLists.txt
-@@ -102,6 +102,8 @@ endif()
- camitk_register_subproject(CORELIB ${PYCAMITK_TARGET_LIB_NAME})
- 
- # -- unit testing
--camitk_add_subdirectory(testing)
-+if(NOT PYTHON_BINDING_TEST_DISABLE)
-+    camitk_add_subdirectory(testing)
-+endif()
- 
--endif() # PYTHON_BINDING
-\ No newline at end of file
-+endif() # PYTHON_BINDING
+diff --git a/sdk/applications/config/CMakeLists.txt b/sdk/applications/config/CMakeLists.txt
+index 4a420c8..1f96012 100644
 --- a/sdk/applications/config/CMakeLists.txt
 +++ b/sdk/applications/config/CMakeLists.txt
 @@ -36,7 +36,7 @@ camitk_add_test(EXECUTABLE_ARGS "-e badfile"
@@ -31,6 +26,8 @@ Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
      # Test missing python script.
      # The following test must fails as the python scripts are not available in the directory
      # Copy a known camitk extension file
+diff --git a/sdk/applications/extensiongenerator/CMakeLists.txt b/sdk/applications/extensiongenerator/CMakeLists.txt
+index 88555e1..0885d5e 100644
 --- a/sdk/applications/extensiongenerator/CMakeLists.txt
 +++ b/sdk/applications/extensiongenerator/CMakeLists.txt
 @@ -163,7 +163,7 @@ camitk_add_test(EXECUTABLE_ARGS "-f ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp -d ${CM
@@ -41,4 +38,20 @@ Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
 +    if(PYTHON_BINDING AND NOT PYTHON_BINDING_TEST_DISABLE)
          set(${APPLICATION_TARGET_NAME}_TEST_PYTHON "-python")
      endif()
-
+ 
+diff --git a/sdk/libraries/python/CMakeLists.txt b/sdk/libraries/python/CMakeLists.txt
+index 0d59e30..037cc98 100644
+--- a/sdk/libraries/python/CMakeLists.txt
++++ b/sdk/libraries/python/CMakeLists.txt
+@@ -102,6 +102,8 @@ endif()
+ camitk_register_subproject(CORELIB ${PYCAMITK_TARGET_LIB_NAME})
+ 
+ # -- unit testing
+-camitk_add_subdirectory(testing)
++if(NOT PYTHON_BINDING_TEST_DISABLE)
++    camitk_add_subdirectory(testing)
++endif()
+ 
+-endif() # PYTHON_BINDING
+\ No newline at end of file
++endif() # PYTHON_BINDING


=====================================
debian/patches/0003-force-camitk-extension-on-save.patch
=====================================
@@ -1,13 +1,24 @@
-Description: When user saves a camitk file, file extension .camitk is added to the name
-   When the user saved a new extension file or a new workspace file, the extension .camitk was not automatically added to the filename.
-   When the user tried to open the saved file, it was not visible due to the wrong filename extensions
+From: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+Date: Wed, 16 Sep 2026 15:06:51 +0200
+Subject: When user saves a camitk file,
+ file extension .camitk is added to the name
 
+  When the user saved a new extension file or a new workspace file, the extension .camitk was not automatically added to the filename.
+  When the user tried to open the saved file, it was not visible due to the wrong filename extensions
 Forwarded: https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/merge_requests/251
 Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+---
+ sdk/actions/application/file/SaveWorkspace.cpp                      | 3 +++
+ sdk/actions/devstudio/actions/presenter/CamiTKExtensionEditor.cpp   | 6 +++++-
+ .../devstudio/actions/presenter/CamiTKExtensionModelPresenter.cpp   | 5 +++++
+ .../devstudio/actions/presenter/CamiTKExtensionModelPresenter.h     | 3 +++
+ 4 files changed, 16 insertions(+), 1 deletion(-)
 
+diff --git a/sdk/actions/application/file/SaveWorkspace.cpp b/sdk/actions/application/file/SaveWorkspace.cpp
+index 452cc6a..7d74d50 100644
 --- a/sdk/actions/application/file/SaveWorkspace.cpp
 +++ b/sdk/actions/application/file/SaveWorkspace.cpp
-@@ -67,6 +67,9 @@ Action::ApplyStatus SaveWorkspace::apply
+@@ -67,6 +67,9 @@ Action::ApplyStatus SaveWorkspace::apply() {
      QString filename = QFileDialog::getSaveFileName(nullptr, tr("Save Workspace As..."), suggestedName, "CamiTK file (*.camitk);;");
  
      if (!filename.isEmpty()) {
@@ -17,9 +28,11 @@ Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
          // save the workspace
          bool saveStatus = Application::saveWorkspace(filename);
          if (saveStatus) {
+diff --git a/sdk/actions/devstudio/actions/presenter/CamiTKExtensionEditor.cpp b/sdk/actions/devstudio/actions/presenter/CamiTKExtensionEditor.cpp
+index 23079a2..e1c2070 100644
 --- a/sdk/actions/devstudio/actions/presenter/CamiTKExtensionEditor.cpp
 +++ b/sdk/actions/devstudio/actions/presenter/CamiTKExtensionEditor.cpp
-@@ -195,10 +195,14 @@ void CamiTKExtensionEditor::saveClicked(
+@@ -195,10 +195,14 @@ void CamiTKExtensionEditor::saveClicked() {
  
      if (reply == QMessageBox::No) {
          // Ask the user for an alternative name
@@ -35,9 +48,11 @@ Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
              camitkFilePath = fileName;
              // Recursively call saveToFile with the alternative name
              saveClicked();
+diff --git a/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.cpp b/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.cpp
+index 0ef9b1b..38c5661 100644
 --- a/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.cpp
 +++ b/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.cpp
-@@ -246,4 +246,9 @@ bool CamiTKExtensionModelPresenter::isPy
+@@ -246,4 +246,9 @@ bool CamiTKExtensionModelPresenter::isPython() {
  // -------------------- saveExtensionFile --------------------
  void CamiTKExtensionModelPresenter::saveExtensionFile(const QFile& file) {
      camitkExtensionModel.save(QFileInfo(file).absoluteFilePath());
@@ -48,6 +63,8 @@ Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
 +    return camitkExtensionModel.getModel()["name"];
  }
 \ No newline at end of file
+diff --git a/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.h b/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.h
+index cf6d592..41a37a6 100644
 --- a/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.h
 +++ b/sdk/actions/devstudio/actions/presenter/CamiTKExtensionModelPresenter.h
 @@ -71,6 +71,9 @@ public:


=====================================
debian/patches/0004-remove-invalid-line-desktop-file.patch
=====================================
@@ -1,9 +1,16 @@
-Description: Invalid .desktop files creates a warning for debian package
-   An invalid line was present in the .desktop file of camitk-actionstatemachine
+From: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+Date: Wed, 16 Sep 2026 15:06:51 +0200
+Subject: Invalid .desktop files creates a warning for debian package
 
+  An invalid line was present in the .desktop file of camitk-actionstatemachine
 Bug: https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/241
 Author: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+---
+ .../actionstatemachine/resources/camitk-actionstatemachine.desktop      | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
+diff --git a/sdk/applications/actionstatemachine/resources/camitk-actionstatemachine.desktop b/sdk/applications/actionstatemachine/resources/camitk-actionstatemachine.desktop
+index 90f6a7e..0cc06a9 100644
 --- a/sdk/applications/actionstatemachine/resources/camitk-actionstatemachine.desktop
 +++ b/sdk/applications/actionstatemachine/resources/camitk-actionstatemachine.desktop
 @@ -11,4 +11,4 @@ Exec=camitk-actionstatemachine


=====================================
debian/patches/0005-vtk-9.6.patch
=====================================
@@ -1,7 +1,14 @@
-Description: Fix FTBFS with VTK 9.6
-Author: Adrian Bunk <bunk at debian.org>
+From: Adrian Bunk <bunk at debian.org>
+Date: Wed, 16 Sep 2026 15:06:51 +0200
+Subject: Fix FTBFS with VTK 9.6
+
 Bug-Debian: https://bugs.debian.org/1142211
+---
+ .../image/elastixregistration/SimpleElastixRegistrationAction.cpp       | 2 ++
+ 1 file changed, 2 insertions(+)
 
+diff --git a/sdk/actions/image/elastixregistration/SimpleElastixRegistrationAction.cpp b/sdk/actions/image/elastixregistration/SimpleElastixRegistrationAction.cpp
+index 01d2f11..d05d27e 100644
 --- a/sdk/actions/image/elastixregistration/SimpleElastixRegistrationAction.cpp
 +++ b/sdk/actions/image/elastixregistration/SimpleElastixRegistrationAction.cpp
 @@ -49,6 +49,8 @@


=====================================
debian/patches/0006-Fix-segfault-on-exit.patch
=====================================
@@ -0,0 +1,120 @@
+From: Manik Bhattacharjee <manik.bhattacharjee at univ-grenoble-alpes.fr>
+Date: Fri, 18 Sep 2026 01:21:39 +0200
+Subject: Fix segfault on exit
+
+---
+ sdk/libraries/core/application/Application.cpp | 29 +++++++++++++-------------
+ sdk/libraries/core/application/Application.h   |  3 ---
+ 2 files changed, 15 insertions(+), 17 deletions(-)
+
+diff --git a/sdk/libraries/core/application/Application.cpp b/sdk/libraries/core/application/Application.cpp
+index 28f8756..2279408 100644
+--- a/sdk/libraries/core/application/Application.cpp
++++ b/sdk/libraries/core/application/Application.cpp
+@@ -69,7 +69,7 @@ namespace camitk {
+ // the main window (static, unique instance, verifies singleton)
+ MainWindow* Application::mainWindow = nullptr;
+ SplashScreen* Application::splashScreen = nullptr;
+-QSettings Application::settings(QSettings::IniFormat, QSettings::UserScope, "CamiTK", QString(Core::version()).remove(QChar(' ')));
++// QSettings Application::settings(QSettings::IniFormat, QSettings::UserScope, "CamiTK", QString(Core::version()).remove(QChar(' ')));
+ QList<QFileInfo> Application::recentDocuments;
+ QDir Application::lastUsedDirectory;
+ int Application::maxRecentDocuments = 0;
+@@ -145,13 +145,13 @@ Application::Application(QString name, int& theArgc, char** theArgv, bool autolo
+     }
+ 
+     //-- initialize recent/lastUsedDirectory documents from the settings
+-    settings.beginGroup(name + ".Application");
++    getSettings().beginGroup(name + ".Application");
+ 
+     // max memorized recent documents
+-    maxRecentDocuments = settings.value("maxRecentDocuments", 10).toInt();
++    maxRecentDocuments = getSettings().value("maxRecentDocuments", 10).toInt();
+ 
+     // the recent documents
+-    QStringList recentDoc = settings.value("recentDocuments").toStringList();
++    QStringList recentDoc = getSettings().value("recentDocuments").toStringList();
+     recentDocuments.clear();
+ 
+     for (QString fileName : recentDoc) {
+@@ -160,8 +160,8 @@ Application::Application(QString name, int& theArgc, char** theArgv, bool autolo
+ 
+     // the last used directory
+     QDir defaultDir(Core::getTestDataDir());
+-    lastUsedDirectory.setPath(settings.value("lastUsedDirectory", defaultDir.absolutePath()).toString());
+-    settings.endGroup();
++    lastUsedDirectory.setPath(getSettings().value("lastUsedDirectory", defaultDir.absolutePath()).toString());
++    getSettings().endGroup();
+ 
+     //-- register file association with this application for opening
+     if (registerFileExtension) {
+@@ -171,7 +171,7 @@ Application::Application(QString name, int& theArgc, char** theArgv, bool autolo
+         // TODO : uses a better way to ask the user so that each component can be selected individually
+         // File types association with the application for opening
+         QStringList newFileExtensions;
+-        QStringList fileExtensionsAlreadyRegistered = settings.value("fileExtensionsRegistered").toStringList();
++        QStringList fileExtensionsAlreadyRegistered = getSettings().value("fileExtensionsRegistered").toStringList();
+         // Forbidden list, to avoid user to have common image file type associated with the application
+         QStringList fileExtensionForbidden;
+         fileExtensionForbidden.append("jpg");
+@@ -211,7 +211,7 @@ Application::Application(QString name, int& theArgc, char** theArgv, bool autolo
+ 
+             // save the file types in the application's settings in order not to be prompt again
+             fileExtensionsAlreadyRegistered.append(newFileExtensions);
+-            settings.setValue("fileExtensionsRegistered", fileExtensionsAlreadyRegistered);
++            getSettings().setValue("fileExtensionsRegistered", fileExtensionsAlreadyRegistered);
+         }
+ 
+ #endif
+@@ -358,7 +358,8 @@ MainWindow* Application::getMainWindow() {
+ 
+ // ----------------- getSettings --------------------
+ QSettings& Application::getSettings() {
+-    return settings;
++    static QSettings* instance = new QSettings(QSettings::IniFormat, QSettings::UserScope, "CamiTK", QString(Core::version()).remove(QChar(' ')));
++    return *instance;
+ }
+ 
+ // ----------------- exec --------------------
+@@ -503,10 +504,10 @@ void Application::addRecentDocument(QString filename) {
+     lastUsedDirectory = recentDocuments.last().absoluteDir();
+ 
+     // save settings (the last 10 recent files by default)
+-    settings.beginGroup(name + ".Application");
++    getSettings().beginGroup(name + ".Application");
+ 
+     // max memorized recent documents
+-    settings.setValue("maxRecentDocuments", maxRecentDocuments);
++    getSettings().setValue("maxRecentDocuments", maxRecentDocuments);
+ 
+     // save all up to maxRecentDocuments
+     int firstOpened = recentDocuments.size() - maxRecentDocuments;
+@@ -521,11 +522,11 @@ void Application::addRecentDocument(QString filename) {
+         recentDoc.append(recentDocuments[i].absoluteFilePath());
+     }
+ 
+-    settings.setValue("recentDocuments", recentDoc);
++    getSettings().setValue("recentDocuments", recentDoc);
+ 
+     // last used directory
+-    settings.setValue("lastUsedDirectory", lastUsedDirectory.absolutePath());
+-    settings.endGroup();
++    getSettings().setValue("lastUsedDirectory", lastUsedDirectory.absolutePath());
++    getSettings().endGroup();
+ }
+ 
+ // ----------------- getLastUsedDirectory --------------------
+diff --git a/sdk/libraries/core/application/Application.h b/sdk/libraries/core/application/Application.h
+index d9eb112..215e44b 100644
+--- a/sdk/libraries/core/application/Application.h
++++ b/sdk/libraries/core/application/Application.h
+@@ -544,9 +544,6 @@ private:
+     ///@name Application settings
+     ///@{
+ 
+-    /// global settings for CamiTK application
+-    static QSettings settings;
+-
+     /// Apply all the property values to update the model (e.g., use the logLevel to modify the actual log level of the application logger)
+     static void applyPropertyValues();
+ 


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@
 0003-force-camitk-extension-on-save.patch
 0004-remove-invalid-line-desktop-file.patch
 0005-vtk-9.6.patch
+0006-Fix-segfault-on-exit.patch


=====================================
debian/rules
=====================================
@@ -27,7 +27,8 @@ PRIVATE_LIB_BUILD_DIR := $(LIB_BUILD_DIR)/camitk-$(VER_SHORT)
 
 # List of python tests that require to install some PyPI packages, they should be not run during packaging
 # (no execution of code outside the source package)
-EXCLUDED_PYTHON_TESTS := "'(test-pythonhotplug-image|test-pythonhotplug-mesh|test-pythonhotplug-state|test-pythonhotplug-qt|test-pythonhotplug-meshPoints|test-pythonhotplug-transformationManager|test-pythonhotplug-userScriptValidity|test-pythonhotplug-actionPipeline|test-pythonscript-scriptVariable|test-pythonscript-numpyImageComponent|test-pythonscript-core|test-pythonscript-vtk)'"
+# Also exclude CPP hotplug tests, they does not cleanup the config file, creating issues for other tests
+EXCLUDED_CAMITK_TESTS := test-pythonhotplug-image|test-pythonhotplug-mesh|test-pythonhotplug-state|test-pythonhotplug-qt|test-pythonhotplug-meshPoints|test-pythonhotplug-transformationManager|test-pythonhotplug-userScriptValidity|test-pythonhotplug-actionPipeline|test-pythonscript-scriptVariable|test-pythonscript-numpyImageComponent|test-pythonscript-core|test-pythonscript-vtk|test-cpphotplug-parameters|test-cpphotplug-thresholdExtension|test-cpphotplug-multiActions|test-cpphotplug-registering|test-cmakeprojectmanager-testHotPlug
 
 # multi-arch support
 include /usr/share/dpkg/architecture.mk
@@ -94,7 +95,7 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# between extensions (i.e., mml component extension depends on physicalmodel component extensions)
 	# Lib dependencies can be in any extensions (viewers, component and action extensions) lib directory
 	export LD_LIBRARY_PATH=$(LIB_BUILD_DIR)/:$(PRIVATE_LIB_BUILD_DIR)/viewers/:$(PRIVATE_LIB_BUILD_DIR)/components/:$(PRIVATE_LIB_BUILD_DIR)/actions/:$(PRIVATE_LIB_BUILD_DIR)/ ; \
-	(cd camitk-build && xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ctest -V --timeout 1800 --exclude-regex "$(EXCLUDED_PYTHON_TESTS)")
+	(cd camitk-build && xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ctest -V --timeout 1800 --exclude-regex "$(EXCLUDED_CAMITK_TESTS)")
 endif
 
 # packages for specific arch



View it on GitLab: https://salsa.debian.org/med-team/camitk/-/commit/53477de62beffcabf97e6e958f8fc60c74b75081

-- 
View it on GitLab: https://salsa.debian.org/med-team/camitk/-/commit/53477de62beffcabf97e6e958f8fc60c74b75081
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260918/5362e966/attachment-0001.htm>


More information about the debian-med-commit mailing list