vector iterators incompatible
-
Ich bekomme einen Crahs mit der Fehlermeldung 'vector iterators incompatible' mit folgendem Trace:
> ShapedMaterialProcessingd.exe!std::_Vector_const_iterator<Command *,std::allocator<Command *> >::_Compat(const std::_Vector_const_iterator<Command *,std::allocator<Command *> > & _Right=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}) Zeile 238 + 0x17 Bytes C++
ShapedMaterialProcessingd.exe!std::_Vector_const_iterator<Command *,std::allocator<Command *> >::operator==(const std::_Vector_const_iterator<Command *,std::allocator<Command *> > & _Right=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}) Zeile 198 C++
ShapedMaterialProcessingd.exe!std::_Vector_const_iterator<Command *,std::allocator<Command *> >::operator!=(const std::_Vector_const_iterator<Command *,std::allocator<Command *> > & _Right=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}) Zeile 203 + 0xc Bytes C++
ShapedMaterialProcessingd.exe!std::_Debug_range2<std::_Vector_const_iterator<Command *,std::allocator<Command *> > >(std::_Vector_const_iterator<Command *,std::allocator<Command *> > _First=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, std::_Vector_const_iterator<Command *,std::allocator<Command *> > _Last=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, const wchar_t * _File=0x006a9e28, unsigned int _Line=145, std::random_access_iterator_tag __formal={...}) Zeile 1394 + 0xc Bytes C++
ShapedMaterialProcessingd.exe!std::_Debug_range<std::_Vector_const_iterator<Command *,std::allocator<Command *> > >(std::_Vector_const_iterator<Command *,std::allocator<Command *> > _First=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, std::_Vector_const_iterator<Command *,std::allocator<Command *> > _Last=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, const wchar_t * _File=0x006a9e28, unsigned int _Line=145) Zeile 1406 + 0x56 Bytes C++
ShapedMaterialProcessingd.exe!std::_Uninit_copy<std::_Vector_const_iterator<Command *,std::allocator<Command *> >,Command * *,std::allocator<Command *> >(std::_Vector_const_iterator<Command *,std::allocator<Command *> > _First=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, std::_Vector_const_iterator<Command *,std::allocator<Command *> > _Last=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, Command * * _Dest=0x01eadb58, std::allocator<Command *> & __formal={...}, std::allocator<Command *> & __formal={...}, std::allocator<Command *> & __formal={...}) Zeile 145 + 0x45 Bytes C++
ShapedMaterialProcessingd.exe!stdext::unchecked_uninitialized_copy<std::_Vector_const_iterator<Command *,std::allocator<Command *> >,Command * *,std::allocator<Command *> >(std::_Vector_const_iterator<Command *,std::allocator<Command *> > _First=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, std::_Vector_const_iterator<Command *,std::allocator<Command *> > _Last=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, Command * * _Dest=0x01eadb58, std::allocator<Command *> & _Al={...}) Zeile 805 + 0x6b Bytes C++
ShapedMaterialProcessingd.exe!std::vector<Command *,std::allocator<Command *> >::_Ucopy<std::_Vector_const_iterator<Command *,std::allocator<Command *> > >(std::_Vector_const_iterator<Command *,std::allocator<Command *> > _First=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, std::_Vector_const_iterator<Command *,std::allocator<Command *> > _Last=0xfeeefeee {m_isExecuted=??? m_wasSuccessful=??? m_errorValue=??? ...}, Command * * _Ptr=0x01eadb58) Zeile 1105 + 0x46 Bytes C++
ShapedMaterialProcessingd.exe!std::vector<Command *,std::allocator<Command *> >::vector<Command *,std::allocator<Command *> >(const std::vector<Command *,std::allocator<Command *> > & _Right=[335](0x00f4a8f8 {SMCPar=0x01fb46a4 },0x00f43598 {SMCPar=0x01fb46a4 },0x00eeffd0 {SMCPar=0x01fb46a4 },0x00ee9ca8 {SMCPar=0x01fb46a4 m_Mode={...} },0x02048ee8 {SMCPar=0x01fb46a4 },0x021a4a60 {SMCPar=0x01fb46a4 },0x021c00e0 {SMCPar=0x01fb46a4 },0x01f86e68 {SMCPar=0x01fb46a4 },0x021bfe30 {SMCPar=0x01fb46a4 },0x00f704e8 {SMCPar=0x01fb46a4 },0x01eea170 {SMCPar=0x01fb46a4 },0x021bdf30 {SMCPar=0x01fb46a ,...)) Zeile 490 + 0x45 Bytes C++
ShapedMaterialProcessingd.exe!DialogRotationStageStanda::updateCommandList() Zeile 387 + 0x1a Bytes C++an der Codezueile:
void DialogRotationStageStanda::updateCommandList() { vector<Command*> commands = RotationStage->cmdStack.Commands(); ... }irgentwelche Ideen?
-
Solange du die Einzelheiten, was ::Commandas() zurückgibt nicht erläuterst kann man nur raten.
Hast du da was mit const_iteratoren? Die Fehlermeldung weisst nämlich auf etwas solches hin.
-
drakon schrieb:
Solange du die Einzelheiten, was ::Commandas() zurückgibt nicht erläuterst kann man nur raten.
Hast du da was mit const_iteratoren? Die Fehlermeldung weisst nämlich auf etwas solches hin.vector<Command*> & Commands() { return commands; } private: vector<Command*> commands;kann den Fehler auch nicht reproduzieren.
-
Evtl ist "RotationStage" nicht (mehr?) gültig?
-
Badestrand schrieb:
Evtl ist "RotationStage" nicht (mehr?) gültig?
Es speichert den Pointer von MicroSMC::instance(), einem Singelton.
Ich greifen nur aus einem anderen Thread auf 'RotationStage' zu, was wiederum ein Signal auslöst, was in der GUI zum aktualiseren einer Liste führt. Für die List holt sich die GUI die Commands - an der Stelle bricht das Programm ab.
-
pospiech schrieb:
aus einem anderen Thread
Sind die wechselseitigen Zugriffe gesichert?
-
Badestrand schrieb:
pospiech schrieb:
aus einem anderen Thread
Sind die wechselseitigen Zugriffe gesichert?
Ich wüsste nicht wo ich wie sichern sollte.
Der neue Thread erzeugt über 'RotationStage->move(200);' ein neues Kommando. Dieses wird erzeugt (Command Pattern) und ausgeführt. Das führt automatisch dazu das ein Signal (Qt) ausgelöst wird, dass ein Befehl ausgeführt wurde.
In der GUI ist dieses Signal mit einem Update der Command Liste verbunden.
-
pospiech schrieb:
Badestrand schrieb:
pospiech schrieb:
aus einem anderen Thread
Sind die wechselseitigen Zugriffe gesichert?
Ich wüsste nicht wo ich wie sichern sollte.
Stichwort "Mutex". Wenn auf Elementvariablen zugegriffen wird aus verschiedenen Threads, und der eine Thread liest, während der andere das Schreiben anfängt gibts Trouble...