Skip to content

Commit efa5fe8

Browse files
committed
Fail informatively if the task can't open its own /proc/.../mem
1 parent d8b1db0 commit efa5fe8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Task.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,6 +2640,11 @@ bool Task::open_mem_fd() {
26402640
AutoRestoreMem remote_path(remote, mem, sizeof(mem));
26412641
int remote_mem_fd = remote.syscall(syscall_number_for_openat(arch()),
26422642
remote_mem_dir_fd, remote_path.get(), O_RDWR);
2643+
if (remote_mem_fd < 0) {
2644+
LOG(info) << "Can't retrieve mem fd for " << tid
2645+
<< "; couldn't open /proc/...mem; errno=" << errno_name(-remote_mem_fd);
2646+
return false;
2647+
}
26432648
fd = remote.retrieve_fd(remote_mem_fd);
26442649
remote.infallible_close_syscall_if_alive(remote_mem_fd);
26452650
remote.infallible_close_syscall_if_alive(remote_mem_dir_fd);

0 commit comments

Comments
 (0)