[ROOT-7092] Typing nullptr on interpreter prompt triggers stacktrace Created: 20/Feb/15  Updated: 21/Feb/15  Resolved: 21/Feb/15

Status: Closed
Project: ROOT
Component/s: Cling
Affects Version/s: 6.02/05
Fix Version/s: 6.04.00, 6.02/08

Type: Bug Priority: High
Reporter: Oliver Freyermuth Assignee: Axel Naumann
Resolution: Fixed Votes: 0
Labels: None
Environment:

Gentoo Linux x86_64


Development:

 Description   

Dear ROOTers,

today I observed the following stacktrace:

$ root -l
root [0] nullptr
 
 *** Break *** segmentation violation
 
 
 
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00000037694b800c in waitpid () from /lib64/libc.so.6
#1  0x000000376944110b in do_system () from /lib64/libc.so.6
#2  0x0000003000699d9a in Exec (shellcmd=<optimized out>, this=<optimized out>) at /usr/src/debug/sci-physics/root-9999/root-9999/core/unix/src/TUnixSystem.cxx:2069
#3  TUnixSystem::StackTrace (this=0xa3bbb0) at /usr/src/debug/sci-physics/root-9999/root-9999/core/unix/src/TUnixSystem.cxx:2297
#4  0x000000300069bf1c in TUnixSystem::DispatchSignals (this=0xa3bbb0, sig=kSigSegmentationViolation) at /usr/src/debug/sci-physics/root-9999/root-9999/core/unix/src/TUnixSystem.cxx:3533
#5  <signal handler called>
#6  getStmtClass (this=0x0) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/clang/AST/Stmt.h:356
#7  classof (S=0x0) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/clang/AST/Expr.h:3062
#8  doit (Val=...) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/llvm/Support/Casting.h:56
#9  doit (Val=0x0) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/llvm/Support/Casting.h:96
#10 doit (Val=<optimized out>) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/llvm/Support/Casting.h:122
#11 doit (Val=<optimized out>) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/llvm/Support/Casting.h:114
#12 isa<clang::BinaryOperator, clang::Stmt*> (Val=<synthetic pointer>) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/llvm/Support/Casting.h:134
#13 dyn_cast<clang::BinaryOperator, clang::Stmt> (Val=0x0) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/llvm/Support/Casting.h:298
#14 Visit (S=0x0, this=0x7fffcdf30820) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/llvm/inst/include/clang/AST/StmtVisitor.h:44
#15 VisitCompoundStmt (CS=0x1ff2550, this=0x7fffcdf30820) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp:109
#16 Inject (CS=0x1ff2550, this=0x7fffcdf30820) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp:96
#17 cling::NullDerefProtectionTransformer::Transform (this=<optimized out>) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp:290
#18 0x00007f6cd4a34ede in cling::TransactionTransformer::TransformTransaction (this=0xa7c4f0, T=...) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/TransactionTransformer.cpp:22
#19 0x00007f6cd4a6a8a1 in cling::IncrementalParser::transformTransactionAST (this=this
entry=0xa71800, T=T
entry=0x177d660) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:611
#20 0x00007f6cd4a69d3c in cling::IncrementalParser::endTransaction (this=this
entry=0xa71800, T=T
entry=0x177d660) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:325
#21 0x00007f6cd4a6c5f1 in cling::IncrementalParser::Compile (this=0xa71800, input=..., Opts=...) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:709
#22 0x00007f6cd49bb954 in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /usr/lib64/root/libCling.so
#23 0x00007f6cd49bbbb5 in cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**) () from /usr/lib64/root/libCling.so
#24 0x00007f6cd4a82f13 in cling::MetaProcessor::process (this=0x1483920, input_text=0x1e77810 "#line 1 \"ROOT_prompt_0\"\nnullptr", compRes=
0x7fffcdf30bec: cling::Interpreter::kSuccess, result=result
entry=0x7fffcdf30ce0) at /usr/src/debug/sci-physics/root-9999/root-9999/interpreter/cling/lib/MetaProcessor/MetaProcessor.cpp:162
#25 0x00007f6cd491a970 in TCling::ProcessLine (this=0xa6f940, line=<optimized out>, error=0x7fffcdf310bc) at /usr/src/debug/sci-physics/root-9999/root-9999/core/meta/src/TCling.cxx:1885
#26 0x00000030005ef900 in TApplication::ProcessLine (this=this
entry=0xa5d9b0, line=<optimized out>, sync=sync
entry=false, err=err
entry=0x7fffcdf310bc) at /usr/src/debug/sci-physics/root-9999/root-9999/core/base/src/TApplication.cxx:982
#27 0x000000300001b1ff in TRint::ProcessLineNr (this=this
entry=0xa5d9b0, filestem=filestem
entry=0x300001f474 "ROOT_prompt_", line=0x7fffcdf31169 "nullptr", error=0x7fffcdf310bc, error
entry=0x0) at /usr/src/debug/sci-physics/root-9999/root-9999/core/rint/src/TRint.cxx:729
#28 0x000000300001b4e1 in TRint::HandleTermInput (this=0xa5d9b0) at /usr/src/debug/sci-physics/root-9999/root-9999/core/rint/src/TRint.cxx:601
#29 0x000000300069b5bd in TUnixSystem::CheckDescriptors (this=this
entry=0xa3bbb0) at /usr/src/debug/sci-physics/root-9999/root-9999/core/unix/src/TUnixSystem.cxx:1297
#30 0x000000300069c84a in TUnixSystem::DispatchOneEvent (this=0xa3bbb0, pendingOnly=false) at /usr/src/debug/sci-physics/root-9999/root-9999/core/unix/src/TUnixSystem.cxx:1052
#31 0x00000030005df3e4 in TSystem::InnerLoop (this=0xa3bbb0) at /usr/src/debug/sci-physics/root-9999/root-9999/core/base/src/TSystem.cxx:409
#32 0x00000030005ddfe1 in TSystem::Run (this=0xa3bbb0) at /usr/src/debug/sci-physics/root-9999/root-9999/core/base/src/TSystem.cxx:359
#33 0x00000030005ecfcf in TApplication::Run (this=0xa5d9b0, retrn=<optimized out>) at /usr/src/debug/sci-physics/root-9999/root-9999/core/base/src/TApplication.cxx:1130
#34 0x000000300001ca4b in TRint::Run (this=0x17b81c0, retrn=32) at /usr/src/debug/sci-physics/root-9999/root-9999/core/rint/src/TRint.cxx:455
#35 0x0000000000401060 in main (argc=1, argv=0x7fffcdf334f8) at /usr/src/debug/sci-physics/root-9999/root-9999/main/src/rmain.cxx:29
===========================================================

Interpreter does not recover.

Cheers,
Oliver



 Comments   
Comment by Axel Naumann [ 21/Feb/15 ]

Heehee, great find, thanks for reporting

That's now fixed in the master and in v6-02-00-patches.

Cheers, Axel.

Generated at Sun Sep 22 01:28:59 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.