Segfault in nanos_cmalloc
Threre in a segmentation fault when using nanos_cmalloc
. Here is the GDB output for the stream benchmark (from the ompss-benchmarks suite by Javier Bueno):
Program received signal SIGSEGV, Segmentation fault.
0x00002aaaaaf07a84 in nanos::Lock::tryAcquire (this=0x90)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/support/lock.hpp:101
101 if ( state_ == NANOS_LOCK_FREE ) {
(gdb) bt
#0 0x00002aaaaaf07a84 in nanos::Lock::tryAcquire (this=0x90)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/support/lock.hpp:101
#1 0x00002aaaab5ac90b in nanos::DirectoryEntryData::addRootedAccess (this=0x0, loc=0,
version=2)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/core/regiondirectory.hpp:142
#2 0x00002aaaab5a8532 in nanos::RegionDirectory::addRootedAccess (dict=0x6b4710, id=0,
loc=0, version=2)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/core/regiondirectory.cpp:227
#3 0x00002aaaab5e7ced in nanos::global_reg_t::setOwnedMemory (this=0x7fffffffc310, loc=0)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/core/globalregt.cpp:299
#4 0x00002aaaab564850 in nanos::System::registerNodeOwnedMemory (
this=0x2aaaab8937c0 <nanos::sys>, node=0, addr=0x40000000, len=1879048192)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/core/system.cpp:1704
#5 0x00002aaaab16c0cc in nanos_cmalloc (p=0x630420, size=1879048192, node=0, file=0x0,
line=0)
at /gpfs/scratch/bsc28/bsc28668/my-ompss/nanox-git-master/src/apis/c/nanos_memory.cpp:91
#6 0x0000000000401d2e in tuned_initialization () at mcc_stream.c:679
#7 0x0000000000402015 in main (argc=1, argv=0x7fffffffc6b8) at mcc_stream.c:728
The regression appeared somewhere between 44a42d84 and ada03f4e. I know this is a large commit window, but this is the best I can say right now. The bug still exists in 7a5e3290.
Of course, this can be overcome by using the allocating functions from the standard libraries.