we encounter some weird segfaults in recent root versions. I have attached a source and header file of the class we compile and a python script which we execute as example. In root versions up to 5.34.01 everything runs fine. In 5.34.02 and 5.34.04 it crashes both with python 2.6.5 and 2.7 with a segfaut raised in ConvertOLRToString which just matches a string to an enum. The c++ way (i.e. in cint) works just fine. My first guess would be that it is an issue with the enums. Any ideas what is going on here?
Many thanks in advance.
TauSFProvider.h (2.23 KB)
TestEVetoSF.py (732 Bytes)
TauSFProvider.cxx (5.08 KB)
after some further investigations it turns out that recent root version have problems dealing with const reference. In previous version one had to explicitly use ROOT.Long to pass the reference. Could it be that the bugfix for this introduced a new bug, or is it just not possible (which would be very bad)?
the code did not initially crash for me there, but rather it crashed in the Initialise() call (b/c the input file can not be found).
Getting past that, I see another crash as well. Seems to be due to this revision, which was there to prevent the need of ROOT.Long (CINT allows pass-by-value of builtin types). Apparently, enums are special still in their treatment, and require a pointer-passing even for const-ref, but not needing ROOT.Long or equivalent (note that passing an enum by const-ref isn’t common, as an enum is of integer size, so pass by-value is more efficient).
I’ve put in a fix and a regression test for v5-34-00-patches (const-ref in the Cling world is different still, so I’ll only add the regression test to the trunk tests, but not the fix just yet). With this, both use of ROOT.Long and use of by-value should now work (other than that your code continues to crash, as ‘h’ is NULL, but I guess that’s related to the missing input file).