[root-10629] clang codegen assertion popping exception stack when not empty created: 20/mar/20 updated: 30/apr/20 resolved: 30/apr/20 stat

[ROOT-10629] clang CodeGen assertion "popping exception stack when not
empty" Created: 20/Mar/20 Updated: 30/Apr/20 Resolved: 30/Apr/20
Status:
Closed
Project:
ROOT
Component/s:
Cling
Affects Version/s:
master, 6.20/00, 6.20/02
Fix Version/s:
6.22/00
Type:
Bug
Priority:
Critical
Reporter:
Stefan Wunsch
Assignee:
Axel Naumann
Resolution:
Fixed
Votes:
0
Labels:
None
Environment:
master on 6efc540aee4effdbeb77e4314a1c941d63e545e3, on arch linux with
Python 3.8.2
Attachments:
File gdb.log File jit_cpp.cpp File jit_python.cpp
Development:
Description
Edit: You can find a C++ only reproducer here:
http://opendata.web.cern.ch/record/12350
Download the skim.cxx file, compile with clang++ -g skim.cxx
$(root-config --cflags --libs) and run it.
Following reproducer fails in Python but not in C++. Note that this is
experimental PyROOT.
The issue is not reproducible with Python 3.6.
import ROOT
df = ROOT.RDataFrame( 1 )
df = df.Define( "b" , "true" ). Filter ( "b" )
c = df.Count()
print (c.GetValue())
python: path/to/root/interpreter/llvm/src/tools/clang/lib/CodeGen/CGCleanup.h:584: void clang::CodeGen::EHScopeStack::popTerminate(): Assertion `!empty() && "popping exception stack when not empty"' failed.
*** Break *** abort
void rep() {
ROOT::RDataFrame df(1);
auto df2 = df.Define( "b" , "true" ).Filter( "b" );
auto c = df2.Count();
c.GetValue();
}
Comments
Comment by Stefan Wunsch [ 20/Mar/20 ]
No wait, the gdb log does not look like PyROOT. Enrico Guiraud Could
you have a look as well?
So it's still jitting, but not strictly Python related. So how does it
come that it breaks?
#39 0x00007ffff2fc1616 in TCling::Calc (this=0x5555556f5920,
line=0x555558dd5e70 "ROOT::Internal::RDF::JitDefineHelper([](){return true\n;}, {}, \"b\", reinterpret_cast(0x55555a1e1690), *reinterpret_cast(0x5555"...,
error=0x7fffffffdb54) at /home/stefan/src/root-dev/core/metacling/src/TCling.cxx:3425
Comment by Enrico Guiraud [ 20/Mar/20 ]
Never seen something similar, but based on the error message and the
gdb stacktrace you can probably reproduce out of RDF by calling
gInterpreter on the stuff that is being jitted, maybe even reduce to
something that is not related to RDF at all.
In any case I think we need a cling expert.
Comment by Stefan Wunsch [ 20/Mar/20 ]
I've added the actual code that is jitted for cpp and python. it's
exactly the same (besides the pointers). So back to blaming PyROOT and
RDF is free of charge.
Comment by Stefan Wunsch [ 20/Mar/20 ]
Vasil Georgiev Vasilev Axel Naumann Could you have a look at the
stacktrace? It's very weird, since it really looks like pure C++ and
cling. My only last idea would be some interference between cppyy and
cling. But I don't know where to start looking.
Comment by Stefan Wunsch [ 20/Mar/20 ]
The PR https://github.com/root-project/root/pull/5175 is partially
blocked by this issue (we would break the tests).
Comment by Axel Naumann [ 20/Mar/20 ]
Yes that's a cling bug. I'll have to debug. How urgent is this?
Comment by Stefan Wunsch [ 20/Mar/20 ]
Python 3.8 breaks with it, even though I don't understand at all why
it's related to Python. The issue shows up only in the new tutorial,
but ofc I can't speak for users code
Comment by Stefan Wunsch [ 23/Mar/20 ]
The issue is getting more serious. Also external code breaks, for
example the open data analysis here:
http://opendata.web.cern.ch/record/12350
Comment by Stefan Wunsch [ 23/Mar/20 ]
Here the backtrace to the open data example mentioned above using
clang++ -g skim.cxx $(root-config --cflags --libs):
#0 0x00007ffff62b5ce5 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff629f857 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff629f727 in __assert_fail_base.cold () from /usr/lib/libc.so.6
#3 0x00007ffff62ae426 in __assert_fail () from /usr/lib/libc.so.6
#4 0x00007ffff253a11c in clang::CodeGen::CodeGenFunction::EmitEndEHSpec(clang::Decl const*) () from /home/stefan/builds/root-dev/lib/libCling.so
#5 0x00007ffff240e5a2 in clang::CodeGen::CodeGenFunction::FinishFunction(clang::SourceLocation) () from /home/stefan/builds/root-dev/lib/libCling.so
#6 0x00007ffff2414103 in clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) () from /home/stefan/builds/root-dev/lib/libCling.so
#7 0x00007ffff24f6b3b in clang::CodeGen::CodeGenModule::codegenCXXStructor(clang::CXXMethodDecl const*, clang::CodeGen::StructorType) () from /home/stefan/builds/root-dev/lib/libCling.so
#8 0x00007ffff2493cb1 in (anonymous namespace)::ItaniumCXXABI::emitCXXStructor(clang::CXXMethodDecl const*, clang::CodeGen::StructorType) () from /home/stefan/builds/root-dev/lib/libCling.so
#9 0x00007ffff2425744 in clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) () from /home/stefan/builds/root-dev/lib/libCling.so
#10 0x00007ffff241e368 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#11 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#12 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#13 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#14 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#15 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#16 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#17 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#18 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#19 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#20 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#21 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#22 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#23 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#24 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#25 0x00007ffff241e394 in clang::CodeGen::CodeGenModule::EmitDeferred() () from /home/stefan/builds/root-dev/lib/libCling.so
#26 0x00007ffff241d85a in clang::CodeGen::CodeGenModule::Release() () from /home/stefan/builds/root-dev/lib/libCling.so
#27 0x00007ffff2390164 in clang::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) () from /home/stefan/builds/root-dev/lib/libCling.so
#28 0x00007ffff22d63d1 in cling::IncrementalParser::codeGenTransaction(cling::Transaction*) () from /home/stefan/builds/root-dev/lib/libCling.so
#29 0x00007ffff22d5fd8 in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair, llvm::PointerIntPairInfo > >&, bool) () from /home/stefan/builds/root-dev/lib/libCling.so
#30 0x00007ffff22d6b73 in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /home/stefan/builds/root-dev/lib/libCling.so
#31 0x00007ffff225983e in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string, std::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) ()
from /home/stefan/builds/root-dev/lib/libCling.so
#32 0x00007ffff21da616 in TCling::Calc (this=0x5555557a5a80,
line=0x5555587dbac0 "*reinterpret_cast>*>(0x7fffffffdd00) = reinterpret_cast*>(0x7fffffffdd3"..., error=0x7fffffffda84)
at /home/stefan/src/root-dev/core/metacling/src/TCling.cxx:3425
#33 0x00007ffff6844b1e in ROOT::Internal::RDF::InterpreterCalc (
code="*reinterpret_cast>*>(0x7fffffffdd00) = reinterpret_cast*>(0x7fffffffdd3"..., context="Snapshot")
at /home/stefan/src/root-dev/tree/dataframe/src/RDFUtils.cxx:299
#34 0x00005555556329b8 in ROOT::RDF::RInterface::Snapshot (this=0x7fffffffe1a8, treename="Events", filename="GluGluToHToTauTauSkim.root", columnList=std::vector of length 37, capacity 37 = {...}, options=...)
at /home/stefan/builds/root-dev/include/ROOT/RDF/RInterface.hxx:529
#35 0x000055555562af70 in main () at skim.cxx:369
Comment by Stefan Wunsch [ 23/Mar/20 ]
Axel Naumann Could you rename the issue?
Comment by Chris Burr [ 23/Mar/20 ]
I think this might be the same issue that was discussed on the conda
channel on mattermost. If so it only affects builds that have
runtime_cxxmodules=ON.
Comment by Stefan Wunsch [ 23/Mar/20 ]
Axel Naumann Vasil Georgiev Vasilev I've just checked, it's the same
as in conda. All is fine if I use runtime_cxxmodules=OFF. Checked for
both reproducers above.
Comment by Stefan Wunsch [ 23/Mar/20 ]
Adding here the minimal reproducer I could find from the skim.cxx
mentioned above:
#include "ROOT/RDataFrame.hxx"
int main() {
ROOT::RDataFrame df( "Events" , "GluGluToHToTauTau.root" );
auto df2 = df.Define( "gen_match" , "GenPart_pdgId[0] == 15" );
df2.Snapshot( "Events" , "out.root" , { "gen_match" });
}
Comment by Stefan Wunsch [ 23/Mar/20 ]
There we go, as minimal as it probably gets:
#include "ROOT/RDataFrame.hxx"
int main() {
ROOT::RDataFrame df(1);
auto df2 = df.Define( "vec" , "ROOT::RVec(1)" ).Define( "match" , "vec[0] == 42" );
df2.Snapshot( "Events" , "out.root" , { "match" });
}
Comment by Stefan Wunsch [ 24/Mar/20 ]
Update: Happens only with c+17, no with c+14.
Comment by Chris Burr [ 31/Mar/20 ]
To add to my earlier comment this is affecting all Linux builds in
conda-forge of 6.20/XX and at least a couple of people have downgraded
to 6.18/04 to avoid it. I can disable runtime_cxxmodules if it's
unlikely to get fixed quickly?
To reproduce:
$ unset PYTHONPATH; unset LD_LIBRARY_PATH; source /cvmfs/lhcbdev.cern.ch/conda-experimental/bin/activate /cvmfs/lhcbdev.cern.ch/conda-experimental/envs/admorris-rdst
$ root -b -l -q -x -e 'ROOT::RDataFrame df(1); auto df2 = df.Define("vec", "ROOT::RVec(1)").Define("match", "vec[0] == 42"); df2.Snapshot("Events", "out.root", {"match"});'
Comment by Vasil Georgiev Vasilev [ 06/Apr/20 ]
I could reproduce the issue when runtime_cxxmodules were off executing
the suggested command: `root -b -l -q -x -e 'ROOT::RDataFrame df(1);
auto df2 = df.Define("vec", "ROOT::RVec(1)").Define("match",
"vec[0] == 42"); df2.Snapshot("Events", "out.root",
{"match"}
);'`
I am investigating.
Comment by Axel Naumann [ 17/Apr/20 ]
Help! I was able to reproduce it, I cannot reproduce it anymore with
the current master. Can someone confirm?
Comment by Axel Naumann [ 24/Apr/20 ]
`skim.cxx` still reproduces it. Lucky me...
Comment by Axel Naumann [ 29/Apr/20 ]
Fixed by
https://github.com/root-project/root/commit/73ae672925c1def350a66f35ec688aaa04209197
Comment by Stefan Wunsch [ 29/Apr/20 ]
Thanks for fixing I can confirm, also
https://github.com/root-project/root/pull/5175 is know fine!
Comment by Axel Naumann [ 30/Apr/20 ]
Thanks. And that new tutorial is also our test.
The patch is discussed with clang upstream.
Comment by Stefan Wunsch [ 30/Apr/20 ]
You'll backport the changes to 6.20? Otherwise we have failing (open
data) analyses with 6.20.
Comment by Stefan Wunsch [ 30/Apr/20 ]
Backport PR: https://github.com/root-project/root/pull/5511
Generated at Sat Dec 04 04:05:06 CET 2021 using Jira
8.17.0#817000-sha1:a507a62ee263f31d253569e578e747c4fedadad0.

  • MAINE INTEGRATED HEALTH MANAGEMENT SOLUTION HEALTH PAS ONLINE INSTITUTIONAL
  • HOW TO PREPARE YOUR PAPER FOR PRINTING IN WS
  • NEW JERSEY DEPARTMENT OF EDUCATION ENGLISH LANGUAGE LEARNERS (ELL)
  • PARENTAL LEAVE – REQUEST TO EXTEND LEAVE BEYOND INITIAL
  • CORREIO DA SEMANA (CUIABÁ) ANO Nº MÊSANO EXEMP
  • ANEXO 6 – MEMORIA DE ACTUACION JUSTIFICATIVA PROGRAMAS 1
  • POSIEDZENIE ZESPOŁU STERUJĄCEGO PROGRAMU ROZWOJU KULTURY 14032013 R G
  • FICHA DE AUTORIZACIÓN A MENORES DE EDAD PERFORACIONES (PIERCINGS)
  • COMMONWEALTH OF VIRGINIA DEPARTMENT OF CRIMINAL JUSTICE SERVICES DIVISION
  • TECTÓNICA DE PLACAS ©MIGUEL GARCÍA CASAS HORIZONTALES 112 EL
  • MIÉRCOLES 21 DE OCTUBRE DE 2020 DIARIO OFICIAL 203
  • DECLARACIÓN JURADA DE HABERSE VISTO IMPOSIBILITADO DE REALIZAR ACTIVIDADES
  • KA KIRKELIG ARBEIDSGIVER OG INTERESSEORGANISASJON SÆRAVTALE OM REISEREGULATIVET 1
  • INTERNATIONAL CIVIL AVIATION ORGANIZATION WORKING PAPER ACPWGW01WP29 200605 AERONAUTICAL
  • SOLICITUD DE COMPLEMENTO RETRIBUTIVO PARA PERSONAL DOCENTE E INVESTIGADOR
  • ISTITUTO……………… PROTOCOLLO D’INTESA TRA REGIONE EMILIAROMAGNA E UFFICIO SCOLASTICO
  • SUPERVISOR’S QUICK REFERENCE GUIDE TO RECRUITMENT METHODS AND INCENTIVES
  • NA OSNOVU ČLANA 32 STAV 1 TAČKA 5 I
  • BIOL 264 PROF WADE POWELL KENYON COLLEGE UPDATED SUMMER
  • MÚSICA 7° AB PROF ALEXIS CORTÉS B GUÍA DE
  • ESTATUTO DE LA CORTE INTERAMERICANA DE DERECHOS HUMANOS APROBADO
  • KOMISJA REWIZYJNA RADY GMINY ŁUBNIANY RAPORT NR 12013R Z
  • O CORREIO ELETRÔNICO MUITA GENTE SE PERGUNTA O
  • CHAPTER 18 – ABSENTEE BALLOTS 08 NCAC 18 0101
  • STRUTTURA DEL TEMA DI MATEMATICA ALL’ESAME DI STATO UN
  • ÅLANDS LANDSKAPSSTYRELSE PARALLELLTEXTER DATUM 20011108 PARALLELLTEXTER TILL LANDSKAPSSTYRELSENS FRAMSTÄLLNING
  • 0 BELARUS UNITED NATIONS GENERAL ASSEMBLY 71ST SESSION EIGHTH
  • WHAT TO DO IF A PATRON ALLEGES FOOD POISONING
  • DECLARACIÓN JURADA PROMESA NO REALIZACIÓN OBRAS YO DDÑA
  • MITYBA ŽIEMĄ AR UŽKLUPUS PERŠALIMUIGRIPUI ŠILTI IR SAUSI BATAI