MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / PrintProcMaps

Method PrintProcMaps

jalib/jassert.cpp:237–256  ·  view source on GitHub ↗

This routine is called when JASSERT triggers. Something failed. DOES (for further diagnosis): cp /proc/self/maps $DMTCP_TMPDIR/proc-maps WITHOUT malloc or spawning process (could be dangerous in fragile state).

Source from the content-addressed store, hash-verified

235// DOES (for further diagnosis): cp /proc/self/maps $DMTCP_TMPDIR/proc-maps
236// WITHOUT malloc or spawning process (could be dangerous in fragile state).
237void
238jassert_internal::JAssert::PrintProcMaps()
239{
240 ssize_t count;
241 char buf[4096] = {0};
242 int fd = jalib::open("/proc/self/maps", O_RDONLY, 0);
243 if (fd == -1) {
244 return;
245 }
246
247 Print(" Memory maps: \n");
248
249 while ((count = jalib::readAll(fd, buf, sizeof(buf) - 1)) > 0) {
250 Print(buf);
251 }
252
253 Print("\n");
254
255 jalib::close(fd);
256}
257
258void
259jassert_internal::set_log_file(const dmtcp::string &path)

Callers

nothing calls this directly

Calls 3

readAllFunction · 0.85
openFunction · 0.70
closeFunction · 0.70

Tested by

no test coverage detected