Valgrind: неверное чтение размера 4, ошибка сегфоута вне пределов

У меня ошибка segfault в моем многопоточном проекте.
Этот проект является циклической программой, которая должна выполняться непрерывно. Она имеет ЗАДАЧИ, которые в свою очередь состоят из одной или нескольких ОПЕРАЦИЙ.

Запустив Valgrind, я получаю предупреждения об утечке памяти и за ее пределами (недопустимое чтение размера 4).

Valgrind LOG:

==30039== Memcheck, a memory error detector
==30039== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==30039== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==30039== Command: ./sisCAT
==30039==
DebugLog: ++++++++++++++ Inicio de Execucao ++++++++++++++++++++++
DebugLog: iniciando ciclo do controller

DebugLog: 3
==30039== Invalid read of size 4
==30039==    at 0x8081714: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:52)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x7355274 is 20 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x4984BE5: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x735526c is 12 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x4984BFB: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x7355264 is 4 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x4984C00: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x73551dc is 12 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x4984BF2: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x7355220 is 8 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x807A15F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1074)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x4984C12: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x73551d4 is 4 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x4984C1A: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x73551dc is 12 bytes inside a block of size 24 free'd
==30039==    at 0x48D1CFC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==30039==    by 0x807D1B2: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> > >::deallocate(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*, unsigned int) (new_allocator.h:98)
==30039==    by 0x807C3B9: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:373)
==30039==    by 0x807B08B: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:395)
==30039==    by 0x807A17F: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, SISCAT::Task*> >*) (stl_tree.h:1076)
==30039==    by 0x8079564: std::_Rb_tree<std::string, std::pair<std::string const, SISCAT::Task*>, std::_Select1st<std::pair<std::string const, SISCAT::Task*> >, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~_Rb_tree() (in /home/lioc/Siscat/sisCAT/Debug/sisCAT)
==30039==    by 0x8078FD6: std::map<std::string, SISCAT::Task*, std::less<std::string>, std::allocator<std::pair<std::string const, SISCAT::Task*> > >::~map() (stl_map.h:88)
==30039==    by 0x80816D0: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:40)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==
==30039== Use of uninitialised value of size 4
==30039==    at 0x8081E99: SISCAT::Task::GetTickExecution() (Task.h:121)
==30039==    by 0x808171E: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:52)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==
==30039== Invalid read of size 4
==30039==    at 0x8081E99: SISCAT::Task::GetTickExecution() (Task.h:121)
==30039==    by 0x808171E: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:52)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  Address 0x13 is not stack'd, malloc'd or (recently) free'd
==30039==
==30039== Process terminating with default action of signal 11 (SIGSEGV)
==30039==  Access not within mapped region at address 0x13
==30039==    at 0x8081E99: SISCAT::Task::GetTickExecution() (Task.h:121)
==30039==    by 0x808171E: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:52)
==30039==    by 0x80783B3: SISCAT::Controller::ExecuteCycle() (Controller.cpp:183)
==30039==    by 0x8078244: SISCAT::Controller::ClockCycle() (Controller.cpp:156)
==30039==    by 0x80781D5: SISCAT::Controller::StartClock() (Controller.cpp:146)
==30039==    by 0x8077B54: SISCAT::Controller::Initialize() (Controller.cpp:129)
==30039==    by 0x807F78C: SISCAT::Controller::Run() (Controller.h:57)
==30039==    by 0x807F71D: SISCAT::SisCAT::run() (SisCAT.cpp:27)
==30039==    by 0x804C8F8: main (boia.cpp:73)
==30039==  If you believe this happened as a result of a stack
==30039==  overflow in your program's main thread (unlikely but
==30039==  possible), you can try to increase the size of the
==30039==  main thread stack using the --main-stacksize= flag.
==30039==  The main thread stack size used in this run was 8388608.
==30039==
==30039== HEAP SUMMARY:
==30039==     in use at exit: 10,856 bytes in 183 blocks
==30039==   total heap usage: 237 allocs, 54 frees, 14,287 bytes allocated
==30039==
==30039== LEAK SUMMARY:
==30039==    definitely lost: 4,164 bytes in 2 blocks
==30039==    indirectly lost: 53 bytes in 2 blocks
==30039==      possibly lost: 2,427 bytes in 93 blocks
==30039==    still reachable: 4,212 bytes in 86 blocks
==30039==         suppressed: 0 bytes in 0 blocks
==30039== Rerun with --leak-check=full to see details of leaked memory
==30039==
==30039== For counts of detected and suppressed errors, rerun with: -v
==30039== Use --track-origins=yes to see where uninitialised values come from
==30039== ERROR SUMMARY: 15 errors from 9 contexts (suppressed: 0 from 0)
Segmentation fault

Части функций и классов, задействованных в этом отчете, показаны ниже:

RETURN::Return_t TaskCycle::GetTasksByTick(uint32_t tick,
std::vector<Task*>& Tasks)
{
Tasks.clear();
if (GetTasks().empty())
return RETURN::ERROR_UPDATING_TASK;
Task* task;
std::map<TaskID, Task*>::iterator iter = GetTasks().begin();
while (iter != GetTasks().end())
{
if ( iter->second->GetTickExecution()== tick) **// Line: 52**
{
task = iter->second;
if(task->CanExecute())
{
Tasks.push_back(task);
}
}
iter++;                                       **// Line: 63**
}
return RETURN::OK;
}

uint32_t Task::GetTickExecution()
{
return m_tickExecution;
}

Это конструктор класса задач, где TaskID является строковым типом:

Task(TaskID name, uint32_t m_tickOffSet, uint32_t m_tickInterval,
uint32_t m_executionsPerCycle, TaskPriority::TaskPriority_t m_prio,
std::map<OperationID, Operation*> m_registeredOperations) :
m_name(name), m_tickOffSet(m_tickOffSet),
m_tickInterval(m_tickInterval),
m_executionsPerCycle(m_executionsPerCycle), m_prio(m_prio),
m_registeredOperations(m_registeredOperations)

Метод, в котором сообщается об ошибке, это просто метод Get, который возвращает беззнаковую переменную int.

0

Решение

Так в чем именно твой вопрос?

Было бы очень полезно, если бы вы добавляли имена файлов и номера строк вместе с вашим кодом, чтобы люди могли сопоставить ваш код с номерами строк из вывода valgrind.

это

==30039== Invalid read of size 4
==30039==    at 0x8081714: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:52)

вероятно, означает, что вы обращаетесь к нулевому указателю или к унифицированному указателю в строке 52, и это

==30039== Invalid read of size 4
==30039==    at 0x4984BE5: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==30039==    by 0x80817A9: SISCAT::TaskCycle::GetTasksByTick(unsigned int, std::vector<SISCAT::Task*, std::allocator<SISCAT::Task*> >&) (TaskCycle.cpp:63)

очень намекает на передачу пустого указателя на std::_Rb_tree_increment, Но так как мы не видим, какие у вас строки с номерами 52 и 63 в TaskCycle.cpp, мы не можем с этим сильно помочь.

На вашем месте я бы использовал отладчик или добавил бы что-то вроде printf("xxx=%p\n", xxx) ко всем номерам строк, о которых сообщает valgrind (замените xxx всеми указателями, которые используются в этих строках), чтобы вы могли увидеть, какие из них кажутся неправильными.

0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]