0

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?

Gaius
  • 2,556
  • 1
  • 24
  • 43

1 Answers1

1

Contemporary OS´s : casablanca is OK with → 1 . PCLinuxOS 2018, boost -1.64, g++ -7.3 . ... 2 . Fedora 28, boost -1.66, g++ -7.3 . ... 3 . Ubuntu 18.04, boost -1.65, g++ -7.3 .

Fedora 27, Debian 9 Stretch are failing :

cpprestsdk/Release/libs/websocketpp/websocketpp/transport/asio/security/tls.hpp:315:39: error: could not convert ‘boost::asio::ssl::error::make_error_code((boost::asio::ssl::error::stream_errors)1)’ from ‘boost::system::error_code’ to ‘std::error_code

CentOS 7.5 : g++ -4.8, -5.3 not usable. A build with g++ -6.3 : The test shows 'Segmentation fault'.

CentOS 7.5 : # yum install devtoolset-7-gcc-c++ → gcc / g++ -7.3.0

Boost-1.66 (gcc-6.3.0): $ echo "using gcc : 63 : /usr/bin/g++63 ; " >> tools/build/src/user-config.jam && ./bootstrap.sh && ./b2

$ cd casablanca/Release/build/
$ scl enable devtoolset-7 bash && cmake3 ..
$ make
$ cd Binaries/
$ ./test_runner *_test.so 2>&1 | tee casablanca-test.log.txt
.
All test cases PASSED
Finished running all 790 tests

1600 lines : casablanca-test.log.txt https://www.dropbox.com/s/m9ohuws0b0r700j/casablanca-test.log.txt?dl=0

Knud Larsen
  • 5,753
  • 2
  • 14
  • 19