Skip to content

Commit

Permalink
AddressSpace::verify() should not be infallible
Browse files Browse the repository at this point in the history
  • Loading branch information
sidkshatriya authored and rocallahan committed Nov 8, 2024
1 parent 26c68fe commit 14cd8b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AddressSpace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,11 @@ void AddressSpace::verify(Task* t) const {
LOG(debug) << "Verifying address space for task " << t->tid;

MemoryMap::const_iterator mem_it = mem.begin();
KernelMapIterator kernel_it(t);
bool ok = false;
// Must pass ok parameter otherwise KernelMapIterator constructor will become
// infallible if /proc/[tid]/maps cannot be opened
KernelMapIterator kernel_it(t, &ok);
// checking at_end() is equivalent to checking if ok
if (kernel_it.at_end()) {
LOG(debug) << "Task " << t->tid << " exited unexpectedly, ignoring";
return;
Expand Down

0 comments on commit 14cd8b9

Please sign in to comment.