Executing pyRoot file in subprocess leads to segmentation error

Dear @anna98,

thank you so much for sharing the full reproducer!

The problem is a known regression in ROOT 6.34.00 and 6.34.02. We have already seen this in a different forum post, and it will be fixed in the next patch release ROOT 6.34.04.

Until that release, you can work around this crash by manually setting the ownership of the cloned histograms:

diff --git a/python/pixel_analysis.py b/python/pixel_analysis.py
index 40affa2..9e10c40 100644
--- a/python/pixel_analysis.py
+++ b/python/pixel_analysis.py
@@ -103,6 +103,8 @@ def pixel_analysis_threshold(hists, hlabel, canvas):
     hists_without_zero_bin = {}
     for stage in hists.keys():
         hists_without_zero_bin[stage] = [hists[stage][ichip].Clone(hists[stage][ichip].GetName() + '_wo_zerobin') for ichip in range(4)]
+        for h in hists_without_zero_bin[stage]:
+            ROOT.SetOwnership(h, False)

         for ichip in range(4):
             hists_without_zero_bin[stage][ichip].SetBinContent(0, 0)

Sorry for the inconvenience!

Cheers,
Jonas