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

Using undefined variable as array crashes ROOT

    XMLWordPrintable

    Details

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

      MacOS X 10.11, Xcode 7.0.1, Apple's python

      Description

      Trying to use an undefined variable as an array on the ROOT command line will crash ROOT.

      This was tested with:

      • ROOT 6.04/02 on MacOS X 10.11
      • ROOT 6.05/03 (9b4d1479b0e75e8c7a3b5d32232f281061c7a132, master from today) on SLC6 with GCC 4.9

      This is the stacktrace (for ROOT 6.05/03):
      code
      root
      root [0] a
      input_line_10:2:3: error: use of undeclared identifier 'a'
      (a)
      ^
      root [1] a[0]

          • Break *** segmentation violation

      ===========================================================
      There was a crash.
      This is the entire stack trace of all threads:
      ===========================================================
      #0 0x00000031870ac65e in waitpid () from /lib64/libc.so.6
      #1 0x000000318703e609 in do_system () from /lib64/libc.so.6
      #2 0x00007f46f703608a in TUnixSystem::StackTrace() () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #3 0x00007f46f703805c in TUnixSystem::DispatchSignals(ESignals) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #4 <signal handler called>
      #5 0x00007f46f4f52737 in llvm::IRBuilder<false, llvm::ConstantFolder, clang::CodeGen::CGBuilderInserter<false> >::CreateInBoundsGEP(llvm::Value*, llvm::Value*, llvm::Twine const&) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #6 0x00007f46f4fe8c3a in clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(clang::ArraySubscriptExpr const*, bool) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #7 0x00007f46f4fe7450 in clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #8 0x00007f46f4fe7b88 in clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #9 0x00007f46f4eefe32 in clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #10 0x00007f46f4ef01d0 in clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #11 0x00007f46f4f09362 in clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&, clang::Stmt const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #12 0x00007f46f4f0fa90 in clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #13 0x00007f46f4f2b39a in clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #14 0x00007f46f4f2bbb8 in clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #15 0x00007f46f4f2c4f8 in clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #16 0x00007f46f4f2cc00 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone .part.2976] () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #17 0x00007f46f4ebbe23 in clang::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #18 0x00007f46f4c555bb in cling::DeclCollector::HandleTopLevelDecl(clang::DeclGroupRef) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #19 0x00007f46f4c8fb3d in cling::IncrementalParser::ParseInternal(llvm::StringRef) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #20 0x00007f46f4c90dec in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #21 0x00007f46f4c99477 in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #22 0x00007f46f4c99755 in cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #23 0x00007f46f4cdb34b in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #24 0x00007f46f4b99b7d in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #25 0x00007f46f6f55206 in TApplication::ProcessLine(char const*, bool, int*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #26 0x00007f46f6b7f40f in TRint::ProcessLineNr(char const*, char const*, int*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libRint.so.6.04
      #27 0x00007f46f6b7f6d1 in TRint::HandleTermInput() () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libRint.so.6.04
      #28 0x00007f46f70377ed in TUnixSystem::CheckDescriptors() () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #29 0x00007f46f70388fa in TUnixSystem::DispatchOneEvent(bool) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #30 0x00007f46f6fb6cb4 in TSystem::InnerLoop() () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #31 0x00007f46f6fb5a21 in TSystem::Run() () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #32 0x00007f46f6f52a2f in TApplication::Run(bool) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCore.so.6.04
      #33 0x00007f46f6b80b2b in TRint::Run(bool) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libRint.so.6.04
      #34 0x0000000000400fd0 in main ()
      ===========================================================

      The lines below might hint at the cause of the crash.
      If they do not help you then please submit a bug report at
      http://root.cern.ch/bugs. Please post the ENTIRE stack trace
      from above as an attachment in addition to anything else
      that might help us fixing this issue.
      ===========================================================
      #5 0x00007f46f4f52737 in llvm::IRBuilder<false, llvm::ConstantFolder, clang::CodeGen::CGBuilderInserter<false> >::CreateInBoundsGEP(llvm::Value*, llvm::Value*, llvm::Twine const&) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #6 0x00007f46f4fe8c3a in clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(clang::ArraySubscriptExpr const*, bool) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #7 0x00007f46f4fe7450 in clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #8 0x00007f46f4fe7b88 in clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #9 0x00007f46f4eefe32 in clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #10 0x00007f46f4ef01d0 in clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #11 0x00007f46f4f09362 in clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&, clang::Stmt const*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #12 0x00007f46f4f0fa90 in clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #13 0x00007f46f4f2b39a in clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #14 0x00007f46f4f2bbb8 in clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #15 0x00007f46f4f2c4f8 in clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #16 0x00007f46f4f2cc00 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone .part.2976] () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #17 0x00007f46f4ebbe23 in clang::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #18 0x00007f46f4c555bb in cling::DeclCollector::HandleTopLevelDecl(clang::DeclGroupRef) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #19 0x00007f46f4c8fb3d in cling::IncrementalParser::ParseInternal(llvm::StringRef) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #20 0x00007f46f4c90dec in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #21 0x00007f46f4c99477 in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #22 0x00007f46f4c99755 in cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      #23 0x00007f46f4cdb34b in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /nfs/mnemosyne/sys/slc6/sw/root/x86-64/6.04.02/root-6.04.02/lib/libCling.so
      ===========================================================

      Root >
      code

        Attachments

          Activity

            People

            Assignee:
            axel Axel Naumann
            Reporter:
            suhl Sebastian Uhl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: