I have built Casablanca on CentOS 7.5 using GCC 8.1.0 and Boost 1.6.7 (both built from source just previously).
git clone https://github.com/Microsoft/cpprestsdk.git casablanca
cd casablanca/Release
mkdir build.debug
cd build.debug
cmake3 .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ -DWERROR=OFF
make
However the tests fail:
cd Binaries
./test_runner *_test.so
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
Checking with strace
I see
mmap(NULL, 140728712380416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(NULL) = 0x134e000
brk(0x7ffdf61f8000) = 0x134e000
mmap(NULL, 140728712511488, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7fb46b842000
munmap(0x7fb46b842000, 8118272) = 0
munmap(0x7fb470000000, 58990592) = 0
mprotect(0x7fb46c000000, 135168, PROT_READ|PROT_WRITE) = 0
mmap(NULL, 140728712380416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
futex(0x7fb47d8d91a0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
The second parameter to mmap()
is a size_t
but that's huge, 127Tb! Why is it doing this and how can I fix it? I presume that I have gotten something amiss during compilation?