From b19dbaf22ce3ac6589a890340da298b01c98f681 Mon Sep 17 00:00:00 2001 From: Vincenzo Eduardo Padulano Date: Fri, 7 Oct 2022 17:24:45 +0200 Subject: [PATCH] Print statements for DistRDF+Cling failure --- .../lib/Interpreter/IncrementalExecutor.h | 13 ++++++++++++ .../cling/lib/Interpreter/Interpreter.cpp | 20 +++++++++++++++++-- tree/dataframe/src/RDFUtils.cxx | 7 +++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/interpreter/cling/lib/Interpreter/IncrementalExecutor.h b/interpreter/cling/lib/Interpreter/IncrementalExecutor.h index 45ffef92a3..1f521d2599 100644 --- a/interpreter/cling/lib/Interpreter/IncrementalExecutor.h +++ b/interpreter/cling/lib/Interpreter/IncrementalExecutor.h @@ -32,6 +32,12 @@ #include #include +#include +// getpid +#include +#include +// getpid + namespace clang { class DiagnosticsEngine; class CodeGenOptions; @@ -289,7 +295,14 @@ namespace cling { // check if there is any unresolved symbol in the list if (diagnoseUnresolvedSymbols(funcname, "function") || !fun) + { + std::cout << "\n\nFailure in " + "cling::IncrementalExecutor::jitInitOrWrapper: PID=" + << getpid() << ",funcname=" << funcname.str() << "\n\n"; + volatile int a = 0; + while (a == 0) {} return IncrementalExecutor::kExeUnresolvedSymbols; + } return IncrementalExecutor::kExeSuccess; } diff --git a/interpreter/cling/lib/Interpreter/Interpreter.cpp b/interpreter/cling/lib/Interpreter/Interpreter.cpp index 0956eaf44e..964f2b1e9c 100644 --- a/interpreter/cling/lib/Interpreter/Interpreter.cpp +++ b/interpreter/cling/lib/Interpreter/Interpreter.cpp @@ -65,6 +65,12 @@ #include #include +#include +// getpid +#include +#include +// getpid + using namespace clang; namespace { @@ -996,8 +1002,13 @@ namespace cling { CO.ValuePrinting = 0; CO.ResultEvaluation = 1; CO.CheckPointerValidity = 0; - - return EvaluateInternal(input, CO, &V); + auto evalres = EvaluateInternal(input, CO, &V); + if (evalres != cling::Interpreter::kSuccess) { + std::cout << "\n\nFailure in Interpreter::EvaluateInternal: PID=" + << getpid() << ",evalres=" << evalres << "\n"; + std::cout << "The process was evaluating: " << input << "\n\n"; + } + return evalres; } Interpreter::CompilationResult @@ -1385,6 +1396,8 @@ namespace cling { && "Not committed?"); if (V) *V = Value(); + std::cout << "\n\nFailure in Interpreter::EvaluateInternal at: " + << __FILE__ << ":" << __LINE__ << "\n\n"; return kFailure; } @@ -1392,6 +1405,8 @@ namespace cling { if (PRT.getInt() == IncrementalParser::kFailed) { if (V) *V = Value(); + std::cout << "\n\nFailure in Interpreter::EvaluateInternal at: " + << __FILE__ << ":" << __LINE__ << "\n\n"; return kFailure; } @@ -1420,6 +1435,7 @@ namespace cling { V->dump(); return Interpreter::kSuccess; } else { + std::cout << "\n\nFailure at " << __FILE__ << ":" << __LINE__ << " with ExecutionResult=" << res << "\n\n"; return Interpreter::kFailure; } } diff --git a/tree/dataframe/src/RDFUtils.cxx b/tree/dataframe/src/RDFUtils.cxx index 6b26ef5cbe..d10854f163 100644 --- a/tree/dataframe/src/RDFUtils.cxx +++ b/tree/dataframe/src/RDFUtils.cxx @@ -31,6 +31,12 @@ #include #include +#include +// getpid +#include +#include +// getpid + using namespace ROOT::Detail::RDF; using namespace ROOT::RDF; @@ -333,6 +339,7 @@ Long64_t InterpreterCalc(const std::string &code, const std::string &context) auto callCalc = [&errorCode, &context](const std::string &codeSlice) { gInterpreter->Calc(codeSlice.c_str(), &errorCode); if (errorCode != TInterpreter::EErrorCode::kNoError) { + std::cout << "\n\nFailure in gInterpreter->Calc: PID=" << getpid() << ",errorCode=" << errorCode << "\n\n"; std::string msg = "\nAn error occurred during just-in-time compilation"; if (!context.empty()) msg += " in " + context; -- 2.37.3