Commit 969b6285 authored by Philip Carns's avatar Philip Carns

skip instrumentation attempts on anonymous mmap()

Anonymous mmap() calls have no backing file and therefore won't match
any Darshan characterization records, so we can skip the record lookup
in this case.  This also fixes a deadlock on Cray systems with hugepages
enabled, see #210.
parent 78ac2f29
......@@ -7,6 +7,9 @@ Darshan-3.1.3-pre1
* add --enable-HDF5_1.10 configure option to explicitly enable HDF5 1.10+
support, needed on some platforms for API compatibility
- contributed by Karl-Ulrich Bamberg
* skip instrumentation attempts for anonymous mmap() calls; this avoids a
potentential deadlock condition when used with hugepages on Cray systems.
Reported by Glenn Lockwood and Cristian Simarro.
Darshan-3.1.2
=============
......
......@@ -925,6 +925,14 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
MAP_OR_FAIL(mmap);
if(fd < 0 || (flags & MAP_ANONYMOUS))
{
/* mmap is not associated with a backing file; skip all Darshan
* characterization attempts.
*/
return(__real_mmap(addr, length, prot, flags, fd, offset));
}
ret = __real_mmap(addr, length, prot, flags, fd, offset);
if(ret == MAP_FAILED)
return(ret);
......@@ -948,6 +956,14 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
MAP_OR_FAIL(mmap64);
if(fd < 0 || (flags & MAP_ANONYMOUS))
{
/* mmap is not associated with a backing file; skip all Darshan
* characterization attempts.
*/
return(__real_mmap64(addr, length, prot, flags, fd, offset));
}
ret = __real_mmap64(addr, length, prot, flags, fd, offset);
if(ret == MAP_FAILED)
return(ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment