Error with ROOT 6.22 and Python 3.9.6 in macOS BigSur

Hi,
I have managed to solve some incompatibilities of libraries in my macOS BigSur and managed to make it work with my ROOT and python. My python script is working well but ends with a segmentation violation which doesn’t have anything to do with the script, but I think it’s related to the macOS Big Sur system. I don’t have any idea on how to solve this. Any help will be much appreciated.

_ROOT Version: 6.22/08
_python Version: 3.9.6
_Platform: macOS BigSur Version 11.6

*** Break *** segmentation violation

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] SigHandler(ESignals) (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] sighandler(int) (no debug info)

[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)

[<unknown binary>] (no debug info)

[/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/Python] PyGILState_Ensure (no debug info)

[/usr/local/lib/python3.9/site-packages/matplotlib/backends/_macosx.cpython-39-darwin.so] -[Window dealloc] (no debug info)

[/usr/lib/libobjc.A.dylib] AutoreleasePoolPage::releaseUntil(objc_object**) (no debug info)

[/usr/lib/libobjc.A.dylib] objc_autoreleasePoolPop (no debug info)

[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] _CFAutoreleasePoolPop (no debug info)

[/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -[NSAutoreleasePool release] (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] ROOT::MacOSX::Util::AutoreleasePool::~AutoreleasePool() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] ROOT::MacOSX::Util::AutoreleasePool::~AutoreleasePool() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] ROOT::MacOSX::Details::MacOSXSystem::~MacOSXSystem() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] ROOT::MacOSX::Details::MacOSXSystem::~MacOSXSystem() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] std::__1::default_delete<ROOT::MacOSX::Details::MacOSXSystem>::operator()(ROOT::MacOSX::Details::MacOSXSystem*) const (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] std::__1::unique_ptr<ROOT::MacOSX::Details::MacOSXSystem, std::__1::default_delete<ROOT::MacOSX::Details::MacOSXSystem> >::reset(ROOT::MacOSX::Details::MacOSXSystem*) (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] std::__1::unique_ptr<ROOT::MacOSX::Details::MacOSXSystem, std::__1::default_delete<ROOT::MacOSX::Details::MacOSXSystem> >::~unique_ptr() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] std::__1::unique_ptr<ROOT::MacOSX::Details::MacOSXSystem, std::__1::default_delete<ROOT::MacOSX::Details::MacOSXSystem> >::~unique_ptr() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] TMacOSXSystem::~TMacOSXSystem() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] TMacOSXSystem::~TMacOSXSystem() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] TMacOSXSystem::~TMacOSXSystem() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] TROOT::~TROOT() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] TROOT::~TROOT() (no debug info)

[/usr/local/Cellar/root/6.22.08_2/lib/root/libCore.so] at_exit_of_TROOT() (no debug info)

[/usr/lib/system/libsystem_c.dylib] __cxa_finalize_ranges (no debug info)

[/usr/lib/system/libsystem_c.dylib] exit (no debug info)

[/usr/lib/system/libdyld.dylib] start (no debug info)

[<unknown binary>] (no debug info)

Hi,
You would need to post your script, so we can reproduce your problem.
Cheers

Lorenzo

Hi, thanks for the response. I have reduced my code and still have a segmentation violation (not exactly the same as before). This is the current error I have with my complete code after debugging. In the small script, if either section A or B or C is commented, the script finishes without error. At the bottom I put the segmentation violation I get when running the script as it is. Any help would be appreciated.

import numpy as np
import ROOT
import sys
import matplotlib.pyplot as plt

gauss1= lambda x,C1,m1,s1: C1*np.exp(-(1./2.)*((x-m1)**2)/s1**2)

def PlotPedestal(xdata,ydata,function,xfit,params,fittype):
    plt.plot(xdata,ydata,linestyle='None',marker='o',markersize=6)
    if fittype=="GaussPlusExpo" and params is not None:
        yfit = gauss1(xfit,params[0],params[1],params[2])
        plt.plot(xfit,yfit,marker='None')
    plt.show()

if __name__=='__main__':

    #SECTION A
    with open('ProposedVoltagesV3R1301S0_0V_PMTStability_Run0.root',"r") as f:
        print("inside open")
        myfile = ROOT.TFile.Open('ProposedVoltagesV3R1301S0_0V_PMTStability_Run0.root')

    #SECTION B
    fittype = str(input("Fit type to perform:"))
    if fittype not in ["Gauss2","Gauss3"]:
        print("Please input a valid fitting approach to take.")
        sys.exit(0)

    #SECTION C
    pedxdata = np.array([360,365])
    pedydata = np.array([361,362])
    pedopt = np.array([1.18514423e+05, 7.48417878e-05, 2.54248221e-05])
    PlotPedestal(pedxdata,pedydata,gauss1,pedxdata,pedopt,"GaussPlusExpo")

 *** Break *** <TUnixSystem::DispatchSignals>: segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/Python] PyGILState_Ensure (no debug info)
[/usr/local/lib/python3.9/site-packages/matplotlib/backends/_macosx.cpython-39-darwin.so] -[Window dealloc] (no debug info)
[/usr/lib/libobjc.A.dylib] AutoreleasePoolPage::releaseUntil(objc_object**) (no debug info)
[/usr/lib/libobjc.A.dylib] objc_autoreleasePoolPop (no debug info)
[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation] _CFAutoreleasePoolPop (no debug info)
[/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation] -[NSAutoreleasePool release] (no debug info)
[/usr/local/Cellar/root/6.24.06/lib/root/libCore.so] ROOT::MacOSX::Util::AutoreleasePool::~AutoreleasePool() (no debug info)
[/usr/local/Cellar/root/6.24.06/lib/root/libCore.so] ROOT::MacOSX::Details::MacOSXSystem::~MacOSXSystem() (no debug info)
[/usr/local/Cellar/root/6.24.06/lib/root/libCore.so] TMacOSXSystem::~TMacOSXSystem() (no debug info)
[/usr/local/Cellar/root/6.24.06/lib/root/libCore.so] TROOT::~TROOT() (no debug info)
[/usr/lib/system/libsystem_c.dylib] __cxa_finalize_ranges (no debug info)
[/usr/lib/system/libsystem_c.dylib] exit (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)

As you can see the 3 sections of my script are independent from each other. In SECTION A a root file is opened, in SECTION B a string is asked to the user, in SECTION C a function is used to make a plot. However, when only one section is erased (any of them) the code runs well without giving the segmentation violation. Any idea on what could be producing the segmentation fault ?

@moneta Thanks for the reply. I hope my later posts give you more hints about my error.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.