Failed interface between python and root by brew on Sonoma 14.6

Dear experts,
I’ve updated ROOT and python to newest version from brew:

  • brew reinstall root (getting 6.32.06 for macosx64 from tags/6-32-06@6-32-06)
  • brew install python@3.12
  • Sonoma 14.6.1

I find this conflict:

python3.12 -c "import ROOT; print(ROOT.__version__); c = ROOT.TCanvas()"         
6.32.06
2024-11-07 19:47:12.062 Python[14506:405978] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
 *** Break *** segmentation violation
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy_backend.so] (anonymous namespace)::TExceptionHandlerImp::HandleException(int) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libCore.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] PNGReadPlugin::initialize(IIODictionary*) (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] IIOReadPlugin::callInitialize() (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] IIOImageSource::getPropertiesAtIndexInternal(unsigned long, IIODictionary*) (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] IIOImageSource::copyPropertiesAtIndex(unsigned long, IIODictionary*) (no debug info)
[/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO] CGImageSourceCopyPropertiesAtIndex (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] ImageSourceOptionsForCGImageSource_index_ (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] +[NSBitmapImageRep _imagesWithData:hfsFileType:extension:zone:expandImageContentNow:includeAllReps:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] +[NSBitmapImageRep _imageRepsWithData:hfsFileType:extension:expandImageContentNow:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] +[NSImageRep _imageRepsWithContentsOfURL:expandImageContentNow:giveUpOnNetworkURLsWithoutGoodExtensions:] (no debug info)
[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit] -[NSImage initWithContentsOfURL:] (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGCocoa.so] TGCocoa::SetApplicationIcon() (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGCocoa.so] TGCocoa::MapWindow(unsigned long) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGui.so] TGStatusBar::TGStatusBar(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGui.so] TRootCanvas::CreateCanvas(char const*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGui.so] TRootCanvas::TRootCanvas(TCanvas*, char const*, int, int, unsigned int, unsigned int) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGui.so] TRootGuiFactory::CreateCanvasImp(TCanvas*, char const*, int, int, unsigned int, unsigned int) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGpad.so] TCanvas::Constructor(char const*, char const*, int) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libGpad.so] TCanvas::TCanvas(bool) (no debug info)
[<unknown binary>] (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy_backend.so] WrapperCall(long, unsigned long, void*, void*, void*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy_backend.so] Cppyy::CallConstructor(long, unsigned long, unsigned long, void*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy.so] CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy.so] CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy.so] CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy.so] CPyCppyy::CPPConstructor::Call(CPyCppyy::CPPInstance*&, _object* const*, unsigned long, _object*, CPyCppyy::CallContext*) (no debug info)
[/usr/local/Cellar/root/6.32.06/lib/root/libcppyy.so] CPyCppyy::(anonymous namespace)::mp_vectorcall(CPyCppyy::CPPOverload*, _object* const*, unsigned long, _object*) (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] _PyObject_FastCallDictTstate (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] slot_tp_init (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] type_call (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] _PyObject_MakeTpCall (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] _PyEval_EvalFrameDefault (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] PyEval_EvalCode (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] run_mod (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] PyRun_SimpleStringFlags (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] Py_RunMain (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] pymain_main (no debug info)
[/Library/Frameworks/Python.framework/Versions/3.12/Python] Py_BytesMain (no debug info)
[/usr/lib/dyld] start (no debug info)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: none of the 5 overloaded methods succeeded. Full details:
  TCanvas::TCanvas(Bool_t build = kTRUE) =>
    SegmentationViolation: segfault in C++; program state was reset
  TCanvas::TCanvas(const char* name, const char* title, Int_t ww, Int_t wh) =>
    TypeError: takes at least 4 arguments (0 given)
  TCanvas::TCanvas(const char* name, const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) =>
    TypeError: takes at least 6 arguments (0 given)
  TCanvas::TCanvas(const char* name, Int_t ww, Int_t wh, Int_t winid) =>
    TypeError: takes at least 4 arguments (0 given)
  TCanvas::TCanvas(const char* name, const char* title = "", Int_t form = 1) =>
    TypeError: takes at least 1 arguments (0 given)

I followed the suggestions in Problem running pyroot on freshly installed ROOT with brew, but they didn’t work for me.

Cheers
Francesca


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hello @fpastore, thanks for your question. I think @couet may be able to help you on this.

As I mentioned, I don’t use brew to install ROOT. Your problem does seem quite similar to the one you referenced, so @vpadulan might have some hints about this issue.

I’m afraid @vpadulan is currently away so he might not answer for a while.

It appears that you are using the correct version of Python, as recommended by @vpadulan in the post you referred to. However, the error you’re encountering seems slightly different. It seems the TCanvas constructor you’re using might not be the correct one.

Hi, maybe it’s only related to TCanvas, I have the same error with whatever TCanvas constructor I use.
For example:

python3.12 -c "import ROOT; print(ROOT.__version__); c= ROOT.TCanvas(\"a\", \"d\", 1, 2)"

It does not happen with TH1F for example, but basically I cannot open any canvas in my scripts after this migration.

Weird, it is fine for me:

% python3.12 -c "import ROOT; print(ROOT.__version__); c= ROOT.TCanvas(\"a\", \"d\", 1, 2)"

6.33.01

ROOT comes with a web-based canvas, which is now being started. 
Revert to the legacy canvas by setting "Canvas.Name: TRootCanvas" in rootrc file or
by starting "root --web=off".
Find more info on https://root.cern/for_developers/root7/#twebcanvas
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:9446

but with sequoia and ROOT installed from source, so it is not the same context.

Hi, the problem is indeed more wide, since running root directly also shows failures of opening the Canvas and the Browser. I tried reinstalling root from brew, but it still failed.
So I unistalled from brew and tried with mac port (sudo port install root6), it fails again with this errors:

Error: Failed to activate gdk-pixbuf2: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_gdk-pixbuf2/gdk-pixbuf2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port root6 failed
--->  Some of the ports you installed have notes:
  OpenBLAS has the following notes:
    This version is built based on a base architecture for convenience,
    which may not be optimized for your system. To build a version
    customized for your machine, use the +native variant
  libpsl has the following notes:
    libpsl API documentation is provided by the libpsl-docs port.
  lzma has the following notes:
    The LZMA SDK program is installed as "lzma_alone", to avoid conflict with
    LZMA Utils
  tbb has the following notes:
    More recent versions are released as oneTBB and are packaged in the new
    'onetbb' port
    This version is installed into /opt/local/libexec/tbb/libexec/tbb

Then I tried with the direct installation from binary, and again root crashes:

root
input_line_1:1:2: fatal error: module file '/Users/sftnight/ROOT-CI/build/lib/DarwinFoundation.pcm' not found: module file not found
#include <new>
 ^
input_line_1:1:2: note: imported by module 'std' in '/Applications/root/root_v6.32.06/lib/std.pcm'
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version

Can you suggest an easy way to install the latest version of root on sonoma 14.6, with the complete set of libraries needed? Do I have to compile from source? I think using brew made a little mess on my libraries. Root v.5 still works instead.

Personally I am doing:

git clone https://github.com/root-project/root.git
mkdir build
cd build
cmake ../root
make -j8
source bin/thisroot.sh

ok, I have recompiled it, but all works now after a reboot. I’m not sure what happened after using brew, some libraries were mixed, and also the compiled version showed the same errors as before. Definitely the full reboot fixed things.
Thanks for the help, francesca

1 Like

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