Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-7512

Problem in the JIT of a TFormula when it is retrieved automatically from a file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.04/02
    • Fix Version/s: 6.14/00
    • Component/s: Cling
    • Labels:
      None
    • Environment:

      All

      Description

      When a TFormula object is read from a file using the feature to retrieve the object by its name, the JIT fails.
      It works instead if using TFile::Get(name)
      Attached is a simple example creating a ROOT file with a TFormula with name "formula".

      Doing in the ROOT prompt these will fail:

      auto file = TFile::Open("formula.root");
      formula->Eval(1.)

      ROOT will crash with this error message:

      Error in <TClingCallFunc::make_wrapper>: Failed to compile
      ==== SOURCE BEGIN ====
      #pragma clang diagnostic push
      #pragma clang diagnostic ignored "-Wformat-security"
      _attribute_((used)) extern "C" void __cf_0(void* obj, int nargs, void** args, void* ret)
      {
      if (ret)

      { new (ret) (double) (TFormula____id17143662084042884382(*(double**)args[0])); return; }

      else

      { TFormula____id17143662084042884382(*(double**)args[0]); return; }

      }
      #pragma clang diagnostic pop
      ==== SOURCE END ====

          • Break *** segmentation violation

      caused by an error in JITting the formula expressions. It looks likes Cling is not in the correct state.

      while this will work as it should be

      auto file = TFile::Open("formula.root");
      auto formula = (TFormula*) file->Get("formula");
      formula->Eval(1.)

      Note that the above code will not even work in a un-named macro (see attached testAutoRead.C file).
      In this case by typing
      .x testAutoRead.C I get:

      Assertion failed: ((!isa<TagDecl>(LookupCtx) || LookupCtx->isDependentContext() || cast<TagDecl>(LookupCtx)>isCompleteDefinition() || cast<TagDecl>(LookupCtx)>isBeingDefined()) && "Declaration context must already be complete!"), function LookupQualifiedName, file /Users/moneta/root/git/master/interpreter/llvm/src/tools/clang/lib/Sema/SemaLookup.cpp, line 1601.

      Lorenzo

        Attachments

        1. createFile.C
          0.2 kB
        2. testAutoRead.C
          0.3 kB

          Issue Links

            Activity

              People

              Assignee:
              moneta Lorenzo Moneta
              Reporter:
              moneta Lorenzo Moneta
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Actual End: