I don’t remember if 5.26 works but i think it should otherwise i’d posted then. I checked it’s not related with backtrace problem, and i have the editline option enabled when compiling root. I am running ubuntu 10.10.
I can not reproduce this problem. It is possible that it is an installation problem (check that ROOTSYS, PATH and LD_LIBRARY_PATH are consistent). Also you could try to see if the problem is related to uninitialized memory by trying with valgrind (valgrind root.exe -b -l )
ok here’s what i found out by reading the TTabCom.cxx DetermineClass member function. basically it determines the class of a variable (name) by output to a tmp file, for example, supposed i defined a TH1F h, when pressing the tab after “h.”, the code does the following:
then by parsing the file content it gets the class name.
Now comes the really weird problem. Here I modified the source code to expose the probelm
check = (!file1 || c <= 0 || c == '*' || c != '(');
/*if ((!file1 || c <= 0 || c == '*' || c != '(')) {*/ // this is the original line that caused the problem.
if (check) { // instead, using this line will fix the problem.
cout<<"DEBUG:: why are we here? "<<(!file1)<<", "<<(c <= 0)<<", "<<(c != '(')<<endl;
Error("TTabCom::DetermineClass", "variable \"%s\" not defined?",
varName);
goto cleanup;
}
if i use the commented out condition line, i have the problem. Even though a cout of check in front of it will show the check actually returned 0. Somehow the if-condition breaks? in g++4.5.1? Maybe there are some weird optimization problem?
Anyway I fixed my problem. Hope it works for anyone else having the same trouble.
ok really weird. the above solution just worked once, now it failed again… maybe when the check or the if condition is evaluated, either the tmp file or c are not ready thus has some weird values??? but i don’t see there’s multiple thread/racing condition involved…
Anyway, the following code works for me more consistantly now:
check = (!file1) || c <= 0 || c == '*' || c != '(';
if (check) {
cout<<check<<"=yes: "<<(!file1)<<", "<<(c <= 0)<<", "<<(c != '(')<<" = "<<(!file1 || c <= 0 || c == '*' || c != '(')<<endl;
check = (!file1) || c <= 0 || c == '*' || c != '(';
cout<<"check again: "<<check<<", "<<(!file1)<<", "<<(c <= 0)<<", "<<(c != '(')<<" = "<<(!file1 || c <= 0 || c == '*' || c != '(')<<en\
dl;
} else {
cout<<check<<"=no"<<endl;
}
if (check) {
cout<<"DEBUG:: why are we here? "<<(!file1)<<", "<<(c <= 0)<<", "<<(c != '(')<<endl;
Error("TTabCom::DetermineClass", "variable \"%s\" not defined?",
varName);
goto cleanup;
}
NOTE, if i remove the cout’s it will fail again. So for now i will leave them in. It’s not bothering me too much…
[quote]NOTE, if i remove the cout’s it will fail again. So for now i will leave them in. It’s not bothering me too much…[/quote]This strongly points to a deficiency in the compiler (optimizer).