diff --git a/packages/hxtorch/package.py b/packages/hxtorch/package.py
index 09695e977136e4d279d6140951311f20baec4fd0..35efdb823970d1f2aeaa888a98d3212ec7b79a05 100644
--- a/packages/hxtorch/package.py
+++ b/packages/hxtorch/package.py
@@ -191,7 +191,6 @@ class Hxtorch(WafPackage):
         with working_dir('spack-test', create=True):
             old_pythonpath = os.environ.get('PYTHONPATH', '')
             os.environ['PYTHONPATH'] = ':'.join([str(self.prefix.lib), old_pythonpath])
-            python('-c', 'import hxtorch; print(hxtorch.__file__)')
-            # ignore exit code for now
-            cmd_true = which("true")
-            cmd_true()
+            bash = which("bash")
+            # ignore segfaults for now (exit code 139)
+            bash('-c', '(python -c "import hxtorch; print(hxtorch.__file__)" || ( test $? -eq 139 && echo "segfault")) || exit $?')
diff --git a/packages/pynn-brainscales/package.py b/packages/pynn-brainscales/package.py
index 344280e1c6dc4c5c227eacaeee4ebd01313c8f79..83354008b57f5dfa410285d179f6a82d2f06f653 100644
--- a/packages/pynn-brainscales/package.py
+++ b/packages/pynn-brainscales/package.py
@@ -168,7 +168,6 @@ class PynnBrainscales(WafPackage):
         with working_dir('spack-test', create=True):
             old_pythonpath = os.environ.get('PYTHONPATH', '')
             os.environ['PYTHONPATH'] = ':'.join([str(self.prefix.lib), old_pythonpath])
-            python('-c', 'import pynn_brainscales; print(pynn_brainscales.__file__)')
-            # ignore exit code for now
-            cmd_true = which("true")
-            cmd_true()
+            bash = which("bash")
+            # ignore segfaults for now (exit code 139)
+            bash('-c', '(python -c "import pynn_brainscales; print(pynn_brainscales.__file__)" || ( test $? -eq 139 && echo "segfault")) || exit $?')