ksundberg / CourseMaterials

Course materials for various computer science courses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Device not initialized

TJonesy opened this issue · comments

It appears that the FifoReadyQueue for each device may not actually be initialized. I am getting a segfault when a job is pushed onto a device queue. From the debugger it looks like the queue is pointing at garbage memory.

queue {Cannot access memory at address 0x40d5fbde00000000

#0  0x000000000041ddb9 in __gnu_cxx::new_allocator<int>::construct<int, int const&> (this=0x6483f0, __p=0xbf800000) at /usr/include/c++/5/ext/new_allocator.h:120
#1  0x000000000041dbe1 in std::allocator_traits<std::allocator<int> >::construct<int, int const&> (__a=..., __p=0xbf800000) at /usr/include/c++/5/bits/alloc_traits.h:530
#2  0x000000000041da96 in std::deque<int, std::allocator<int> >::push_back (this=0x6483f0, __x=@0x7fffffffda64: 2) at /usr/include/c++/5/bits/stl_deque.h:1521
#3  0x000000000041d9ff in std::queue<int, std::deque<int, std::allocator<int> > >::push (this=0x6483f0, __x=@0x7fffffffda64: 2) at /usr/include/c++/5/bits/stl_queue.h:216
#4  0x000000000041d94c in cs3100::FifoReadyQueue::add (this=0x6483e8, x=2) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/FifoReadyQueue.cpp:5
#5  0x00000000004204aa in cs3100::Simulation::scheduleIo (this=0x648ba0, job=2) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:57
#6  0x000000000042088b in cs3100::Simulation::jobDone (this=0x648ba0, job=2, time=4.34699965) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:85
#7  0x0000000000420011 in cs3100::Simulation::<lambda()>::operator()(void) const (__closure=0x649180) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:48
#8  0x00000000004217c3 in std::_Function_handler<void(), cs3100::Simulation::scheduleJob()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/5/functional:1871
#9  0x0000000000422718 in std::function<void ()>::operator()() const (this=0x649180) at /usr/include/c++/5/functional:2267
#10 0x0000000000420c50 in cs3100::Simulation::run (this=0x648ba0) at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/Simulation.cpp:129
#11 0x0000000000427159 in main () at /home/taylor/OneDrive/Documents/Classes/CS3100/Projects/scheduler/scheduler_main.cpp:77#0  0x000000000041ddb9 in __gnu_cxx::new_allocator<int>::construct<int, int const&> (this=0x6483f0, __p=0xbf800000) at /usr/include/c++/5/ext/new_allocator.h:120