[LLVMbugs] [Bug 16281] New: iterator inalidation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 9 02:41:29 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16281

            Bug ID: 16281
           Summary: iterator inalidation
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: unassignedbugs at nondot.org
          Reporter: eugeny.grishul at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On ToT(r183626) Win32 debug build is broken, debug iterators asserts("vector
iterator not incrementable"). I found that 'RWI' is used (++) after
'SchedClasses' are resized with relocation

void CodeGenSchedModels::inferFromInstRWs(unsigned SCIdx) {
  const RecVec &RWDefs = SchedClasses[SCIdx].InstRWs;
  for (RecIter RWI = RWDefs.begin(), RWE = RWDefs.end(); RWI != RWE; ++RWI) {
    ...
    inferFromRW(Writes, Reads, SCIdx, ProcIndices);
  }
}

relocation appears here
static void inferFromTransitions(ArrayRef<PredTransition> LastTransitions,
                                 unsigned FromClassIdx,
                                 CodeGenSchedModels &SchedModels) {
...
}

Command line:
llvm-tblgen.exe -gen-instr-info -I E:/External/llvm/lib/Target/ARM -I
E:/External/llvm/lib/Target -I E:/External/llvm/include
E:/External/llvm/lib/Target/ARM/ARM.td -o
E:/External/llvmbin/lib/Target/ARM/ARMGenInstrInfo.inc.tmp

Stack trace:
>	msvcp110d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 15	C++
    
llvm-tblgen.exe!std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<llvm::Record
*> > >::operator++() Line 101    C++
     llvm-tblgen.exe!llvm::CodeGenSchedModels::inferFromInstRWs(unsigned int
SCIdx) Line 894    C++
     llvm-tblgen.exe!llvm::CodeGenSchedModels::inferSchedClasses() Line 857   
C++
    
llvm-tblgen.exe!llvm::CodeGenSchedModels::CodeGenSchedModels(llvm::RecordKeeper
& RK, const llvm::CodeGenTarget & TGT) Line 135    C++
     llvm-tblgen.exe!llvm::CodeGenTarget::getSchedModels() Line 259    C++
     llvm-tblgen.exe!`anonymous
namespace'::InstrInfoEmitter::InstrInfoEmitter(llvm::RecordKeeper & R) Line 39 
  C++
     llvm-tblgen.exe!llvm::EmitInstrInfo(llvm::RecordKeeper & RK,
llvm::raw_ostream & OS) Line 420    C++
     llvm-tblgen.exe!`anonymous namespace'::LLVMTableGenMain(llvm::raw_ostream
& OS, llvm::RecordKeeper & Records) Line 106    C++
     llvm-tblgen.exe!llvm::TableGenMain(char * argv0, bool (llvm::raw_ostream
&, llvm::RecordKeeper &) * MainFn) Line 117    C++
     llvm-tblgen.exe!main(int argc, char * * argv) Line 181    C++

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130609/d053acfe/attachment.html>


More information about the llvm-bugs mailing list