The current DoubleChooz analysis code runs on ROOT 5.20.00, and crashed on ROOT 5.21.04. I believe I have traced this to a behavior of cint involving calls to static methods.
I’ve abstracted the code responsible as so
tester.hh:
[code]// Minimal test code to prove a cint behavior that may be a bug
#include
class A {
public:
static void SetConfig(const std::string s);
private:
static std::string configStr;
};
class B {
public:
B();
~B();
static void callThrough(const std::string s);
private:
A* myA;
};[/code]
[code]// Minimal test code to prove a cint behavior that may be a bug
#include “tester.hh”
std::string A::configStr = std::string();
void A::SetConfig(const std::string s){
configStr=s;
}
B::B():
myA(0)
{}
B::~B(){
if (myA){
delete myA;
myA=0;
};
}
void B::callThrough(const std::string s){
A::SetConfig(s);
};[/code]
this compiles without trouble and cint generates a dictionary just as easily.
When I run a trivial macro to invoke it:
{
gSystem->Load("lib/libtester.so");
B::callThrough("config_info");
}
it crashed on 5.21.04, and works fine with 5.20.00.
I see in the SVN logs that changes have been made to the static method call protection.
Possibly the C++ is wrong. I didn’t write it and don’t claim to have a full understanding of the proper use of static methods.
I’m sticking with ROOT 5.20 for now, but any help would be appreciated.