Draw() crash with segmentation violation

Hello. I’m learning root program to study high-energy physics.

I used the Draw method to draw graphs. But, it won’t work, and Break Segmentation violation.


This is the code that called error…

root [0] TF1 f1(“f1”,“sin(x)/x”,0.,10.)
(TF1 &) Name: f1 Title: sin(x)/x
root [1] f1.Draw()


Then, this is the error message.

*** Break *** segmentation violation

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

[] (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/lib/libGCocoa.so] TGCocoa::SetApplicationIcon() (no debug info)

[/usr/local/lib/libGCocoa.so] TGCocoa::MapWindow(unsigned long) (no debug info)

[/usr/local/lib/libGui.so] TGStatusBar::TGStatusBar(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) (no debug info)

[/usr/local/lib/libGui.so] TRootCanvas::CreateCanvas(char const*) (no debug info)

[/usr/local/lib/libGui.so] TRootCanvas::TRootCanvas(TCanvas*, char const*, int, int, unsigned int, unsigned int) (no debug info)

[/usr/local/lib/libGui.so] TRootGuiFactory::CreateCanvasImp(TCanvas*, char const*, int, int, unsigned int, unsigned int) (no debug info)

[/usr/local/lib/libGpad.so] TCanvas::Constructor(char const*, char const*, int) (no debug info)

[/usr/local/lib/libGpad.so] TCanvas::TCanvas(char const*, char const*, int) (no debug info)

[/usr/local/lib/libGpad.so] TCanvas::MakeDefCanvas() (no debug info)

[] (no debug info)

[/usr/local/lib/libCling.so] cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (no debug info)

[/usr/local/lib/libCling.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/usr/local/lib/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/usr/local/lib/libCling.so] cling::Interpreter::process(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, cling::Value*, cling::Transaction**, bool) (no debug info)
[/usr/local/lib/libCling.so] cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (no debug info)
[/usr/local/lib/libCling.so] HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (no debug info)
[/usr/local/lib/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/usr/local/lib/libCore.so] TROOT::ProcessLine(char const*, int*) (no debug info)
[/usr/local/lib/libCore.so] TObject::AppendPad(char const*) (no debug info)
[/usr/local/lib/libHist.so] TF1::Draw(char const*) (no debug info)
[/usr/local/lib/libCling.so] cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (no debug info)
[/usr/local/lib/libCling.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/usr/local/lib/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/usr/local/lib/libCling.so] cling::Interpreter::process(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, cling::Value*, cling::Transaction**, bool) (no debug info)
[/usr/local/lib/libCling.so] cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (no debug info)
[/usr/local/lib/libCling.so] HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (no debug info)
[/usr/local/lib/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/usr/local/lib/libRint.so] TRint::ProcessLineNr(char const*, char const*, int*) (no debug info)
[/usr/local/lib/libRint.so] TRint::HandleTermInput() (no debug info)
[/usr/local/lib/libCore.so] TUnixSystem::CheckDescriptors() (no debug info)
[/usr/local/lib/libCore.so] TMacOSXSystem::DispatchOneEvent(bool) (no debug info)
[/usr/local/lib/libCore.so] TSystem::InnerLoop() (no debug info)
[/usr/local/lib/libCore.so] TSystem::Run() (no debug info)
[/usr/local/lib/libCore.so] TApplication::Run(bool) (no debug info)
[/usr/local/lib/libRint.so] TRint::Run(bool) (no debug info)
[/usr/local/bin/root.exe] main (no debug info)
[/usr/lib/dyld] start (no debug info)


I’m using M1 macbook pro and its version is ventura 13.2 .
My root version is 6.26.10. I installed it using “brew install root” .
I run root in the terminal, and other functions work well except draw() (+ other graphical function do not work) .

When I run draw() method, an root.exe file is created in the dock and the error message as above is printed.

Please Help me!


TF1 f1("f1", "sin(x)/x", 1.e-11, 10.);

Thank you for your reply.
But, the same error still occurs.

I don’t think it’s a matter of code. I think there’s a problem with the way the Draw() method approaches the inside of the computer, is there any way to infer this from the error message?

@couet Can you reproduce that on the same macOS version? :-/

no:

Thank you for your reply!

May be “segmentation violation” problem caused by my computer…
Is there any way to find sloution from the error message? eg. modifying something in the paths that’s written message…

Can you try a simple thing like:

auto c = new TCanvas();

?
It should open a graphics window.

Wow! It works well!

Oh, my problem has been solved!

I removed python virtual enviroment and Draw() method worked very well!!!
Thank you so much for your care!!!