Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRatioPlot crashes if loaded from the file #14855

Closed
1 task done
linev opened this issue Feb 29, 2024 · 5 comments · Fixed by #14881
Closed
1 task done

TRatioPlot crashes if loaded from the file #14855

linev opened this issue Feb 29, 2024 · 5 comments · Fixed by #14881

Comments

@linev
Copy link
Member

linev commented Feb 29, 2024

Check duplicate issues.

  • Checked for duplicates

Description

If load canvas with ratio plot from the file and then simply close it - ROOT crashes.

Reproducer

root -l -b https://jsroot.gsi.de/files/ratioplot.root -e 'ratioplot1->Draw(); ratioplot1->Close();'

ROOT version

master

Installation method

build from source

Operating system

OpenSUSE Linux

Additional context

No response

@ferdymercury
Copy link
Collaborator

Same on Ubu22.04

Debug stack trace here:

#0  0x00007fa201eea3ea in __GI___wait4 (pid=689394, stat_loc=stat_loc
entry=0x7ffe8194a818, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x00007fa201eea3ab in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7ffe8194a818, options=options
entry=0) at ./posix/waitpid.c:38
#2  0x00007fa201e50bdb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:171
#3  0x00007fa202ab531a in TUnixSystem::Exec (this=0x56308f7b6f60, shellcmd=0x56309242b640 "/home/user/build/build-root-Desktop-Debug/etc/gdb-backtrace.sh 689371 1>&2") at /opt/root_src/core/unix/src/TUnixSystem.cxx:2125
#4  0x00007fa202ab5c3e in TUnixSystem::StackTrace (this=0x56308f7b6f60) at /opt/root_src/core/unix/src/TUnixSystem.cxx:2416
#5  0x00007fa202ab9ac5 in TUnixSystem::DispatchSignals (this=0x56308f7b6f60, sig=kSigSegmentationViolation) at /opt/root_src/core/unix/src/TUnixSystem.cxx:3636
#6  0x00007fa202ab0cf2 in SigHandler (sig=kSigSegmentationViolation) at /opt/root_src/core/unix/src/TUnixSystem.cxx:402
#7  0x00007fa202ab99c3 in sighandler (sig=11) at /opt/root_src/core/unix/src/TUnixSystem.cxx:3607
#8  0x00007fa202aa14a2 in textinput::TerminalConfigUnix::HandleSignal (this=0x7fa202db6d00 <textinput::TerminalConfigUnix::Get()::s>, signum=11) at /opt/root_src/core/textinput/src/textinput/TerminalConfigUnix.cpp:99
#9  0x00007fa202aa1194 in (anonymous namespace)::TerminalConfigUnix__handleSignal (signum=11) at /opt/root_src/core/textinput/src/textinput/TerminalConfigUnix.cpp:36
#10 <signal handler called>
#11 0x00005630924075b0 in ?? ()
#12 0x00007fa1e65ad3d9 in operator() (__closure=0x7ffe8194d453, obj=0x563091644350) at /opt/root_src/graf2d/gpad/src/TRatioPlot.cxx:116
#13 0x00007fa1e65ad44e in TRatioPlot::~TRatioPlot (this=0x563092404020, __in_chrg=<optimized out>) at /opt/root_src/graf2d/gpad/src/TRatioPlot.cxx:119
#14 0x00007fa1e65ad6b8 in TRatioPlot::~TRatioPlot (this=0x563092404020, __in_chrg=<optimized out>) at /opt/root_src/graf2d/gpad/src/TRatioPlot.cxx:139
#15 0x00007fa2029d267d in TCollection::GarbageCollect (obj=0x563092404020) at /opt/root_src/core/cont/src/TCollection.cxx:736
#16 0x00007fa2029daf97 in TList::Clear (this=0x5630923e3c00, option=0x7fa1e65ce0fc "") at /opt/root_src/core/cont/src/TList.cxx:449
#17 0x00007fa1e657ad87 in TPad::Close (this=0x563090edf1c0) at /opt/root_src/graf2d/gpad/src/TPad.cxx:981
#18 0x00007fa1e65522b0 in TCanvas::Close (this=0x563090edf1c0, option=0x7fa20211a000 "") at /opt/root_src/graf2d/gpad/src/TCanvas.cxx:802
#19 0x00007fa1faab4788 in cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const () from /home/user/build/build-root-Desktop-Debug/lib/libCling.so
#20 0x00007fa1faa3787c in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /home/user/build/build-root-Desktop-Debug/lib/libCling.so
#21 0x00007fa1faa37fc7 in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /home/user/build/build-root-Desktop-Debug/lib/libCling.so
#22 0x00007fa1faa381e8 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) () from /home/user/build/build-root-Desktop-Debug/lib/libCling.so
#23 0x00007fa1fab1ed17 in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /home/user/build/build-root-Desktop-Debug/lib/libCling.so
#24 0x00007fa1fa7e8eee in HandleInterpreterException (metaProcessor=0x5630904129e0, input_line=0x56309243fb60 "#line 1 \"ROOT_cli_1\"\nratioplot1->Draw(); ratioplot1->Close();", compRes=
0x7ffe8194da8c: cling::Interpreter::kSuccess, result=0x7ffe8194dad0) at /opt/root_src/core/metacling/src/TCling.cxx:2438
#25 0x00007fa1fa7e9b8b in TCling::ProcessLine (this=0x56308f842ce0, line=0x5630923e0630 "#line 1 \"ROOT_cli_1\"\nratioplot1->Draw(); ratioplot1->Close();", error=0x7ffe8194e080) at /opt/root_src/core/metacling/src/TCling.cxx:2598
#26 0x00007fa2028f8786 in TApplication::ProcessLine (this=0x56308f808ef0, line=0x5630923e0630 "#line 1 \"ROOT_cli_1\"\nratioplot1->Draw(); ratioplot1->Close();", sync=false, err=0x7ffe8194e080) at /opt/root_src/core/base/src/TApplication.cxx:1732
#27 0x00007fa202faf2bc in TRint::ProcessLineNr (this=0x56308f808ef0, filestem=0x7fa202fc157a "ROOT_cli_", line=0x7ffe8194e0e0 "ratioplot1->Draw(); ratioplot1->Close();", error=0x7ffe8194e080) at /opt/root_src/core/rint/src/TRint.cxx:801
#28 0x00007fa202fadb8f in TRint::Run (this=0x56308f808ef0, retrn=false) at /opt/root_src/core/rint/src/TRint.cxx:461
#29 0x000056308d8545e4 in main (argc=1, argv=0x7ffe81950288) at /opt/root_src/main/src/rmain.cxx:84

@linev
Copy link
Member Author

linev commented Feb 29, 2024

It is clear ownership problem.

@ferdymercury - you can try to fix it if you want.

@ferdymercury
Copy link
Collaborator

ferdymercury commented Feb 29, 2024

I tried a bit but I'm confused with the safeDelete function, so I think I'll leave this one to someone else ;)

@dpiparo dpiparo added this to Issues in Fixed in 6.32.00 via automation Feb 29, 2024
@dpiparo dpiparo added this to Issues in Fixed in 6.30.06 via automation Feb 29, 2024
linev added a commit to linev/root that referenced this issue Feb 29, 2024
TRatioPlot object was registered in list of cleanups,
but recursive remove was not implemented.
Therefore if any internal object was deleted before -
it make problem.

Fixes issue root-project#14855
linev added a commit to linev/root that referenced this issue Feb 29, 2024
TRatioPlot object was registered in list of cleanups,
but recursive remove was not implemented.
Therefore if any internal object was deleted before -
it make problem.
Also when read from the file TRatioPlot has to be implemented.

Fixes issue root-project#14855
linev added a commit to linev/root that referenced this issue Mar 1, 2024
TRatioPlot object was registered in list of cleanups,
but recursive remove was not implemented.
Therefore if any internal object was deleted before -
it make problem.
Also when read from the file TRatioPlot has to be implemented.

Fixes issue root-project#14855
@dpiparo
Copy link
Member

dpiparo commented Mar 2, 2024

Is it clear what ratioplot1->Close() is supposed to mean?

@linev
Copy link
Member Author

linev commented Mar 4, 2024

Is it clear what ratioplot1->Close() is supposed to mean?

It is just method which is called when canvas closed in interactive mode.
I put it here to demonstrate problem.
Calling canvas destructor will cause the same seg fault.

I tried to fix the problem in #14861 but facing much more problems.
RecursiveRemove is not a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants