Hello all,
I have a problem when I execute a specific Root script twice.
In order to illustrate it, I have made a very minimalistic piece of code which reproduce the problem:
g->Draw(“APC”);
}[/code]
BTW. You can execute “.x vectors.cxx” many times without any problems. There is still a problem (i.e. a “segmentation violation”) if one first does “.x vectors.cxx+” (one plus) and then “.x vectors.cxx++” (two pluses). No problems if one first does “.x vectors.cxx++” (two pluses) - then the next “.x vectors.cxx+” (one plus) and/or “.x vectors.cxx++” (two pluses) are fine.
[code]root [0] .x vectors.cxx+
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
root [1] .x vectors.cxx++
Info in : unmodified script has already been compiled and loaded
Info in : it will be regenerated and reloaded!
Info in TUnixSystem::ACLiC: creating shared library /…/./vectors_cxx.so
*** Break *** segmentation violation
===========================================================
There was a crash (#7 0xb72a616d in SigHandler(ESignals) ()).
This is the entire stack trace of all threads:
#0 0xb77e1430 in __kernel_vsyscall ()
#1 0xb662f7d3 in __waitpid_nocancel ()
at …/sysdeps/unix/syscall-template.S:82
#2 0xb65d0de3 in do_system (line=)
at …/sysdeps/posix/system.c:149
#3 0xb670027d in system (
line=0x8416730 “/…/v5-30-00-patches/etc/gdb-backtrace.sh 13814 1>&2”) at pt-system.c:29
#4 0xb72a016d in TUnixSystem::Exec(char const*) ()
from /…/v5-30-00-patches/lib/libCore.so.5.30
…
#38 0xb687ca8b in TRint::Run(bool) ()
from /…/v5-30-00-patches/lib/libRint.so.5.30
#39 0x08048edf in main ()
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
#12 0xb71a1a0a in TApplication::IsCmdThread() ()
from /…/v5-30-00-patches/lib/libCore.so.5.30
Root > !!!Dictionary position not recovered because G__unloadfile() is used in a macro!!!
*** Break *** segmentation violation
===========================================================
There was a crash (#7 0xb72a616d in SigHandler(ESignals) ()).
This is the entire stack trace of all threads:
#0 0xb77e1430 in __kernel_vsyscall ()
#1 0xb662f7d3 in __waitpid_nocancel ()
at …/sysdeps/unix/syscall-template.S:82
#2 0xb65d0de3 in do_system (line=)
at …/sysdeps/posix/system.c:149
#3 0xb670027d in system (
line=0x84d7358 “/…/v5-30-00-patches/etc/gdb-backtrace.sh 13814 1>&2”) at pt-system.c:29
#4 0xb72a016d in TUnixSystem::Exec(char const*) ()
from /…/v5-30-00-patches/lib/libCore.so.5.30
…[/code]
Dear Pepe Le Pew,
If I use either “.x vectors.C++” or “.x vectors.C+”, the script works in its original version, in any possible combination of “+” and “++”. There is no need to add these “CINT” lines you proposed.
The problem I have is when not using the “+” : “.x vectors.C”.
Nevertheless, if we slightly modify the script to get the number of points in the parabola as an argument, it doesn’t work anymore after the first execution. Try this code, please:
Then execute it modifying the argument:
".x vectors.C(20)+" will crash immediately.
".x vectors.C(20)++" will work the first time, but it won’t a second.
Oh! Sorry, I did a mistake. When running the script with the arguments and the pluses the syntax is like you wrote: “.x vectors.C++(20)”, and not “.x vectors.C(20)++” as I tried…
In such a way the script works without any modification. Your “brutal fix” is not needed.
At least in ROOT 5.32.
Thanks a lot.
Hi Pepe and others,
This issue is still causing me a lot of troubles.
It is true that in this simple example, re-executions of the script inside the same CINT session are working if one uses the “+” and/or the “++”, but it doesn’t with other scripts more complicated.
There is something here which I don’t understand.
How is possible that a program which works with no problem once gets broken when it is called multiple times?
Everything seems to be due to multiple calls to #include .
In my other scripts I got warning messages of this type, when I re-execute them:
Besides, If I compile a program which does multiple calls to these macros in a loop of this type:
// Time looper
for(Int_t i=iStart; i<iEnd+1; i+=iStep) {
// Run macros for plots
TString command;
command = Form(".x PlotPhase1D.C(%i)",time);
gROOT->ProcessLine(command);
}
I get segmentation faults although the script PlotPhase1D.C is working good in CINT (even with multiple calls) and the program itself works when it only loops once. Crazy…