khizmax / libcds

A C++ library of Concurrent Data Structures
http://libcds.sourceforge.net/doc/cds-api/index.html
Boost Software License 1.0
2.54k stars 355 forks source link

Errors happen when doing `make test` #121

Open stmatengss opened 6 years ago

stmatengss commented 6 years ago

I plan to migrate these data structures to hpx [https://github.com/STEllAR-GROUP/hpx] (a GSoC project). I want to test the performance of libcds, so I run these test cases in test directory. Unfortunately, there are some scenarios cannot pass the tests, I guess maybe I adopt a un-correct method to compile libcds.

The following tests FAILED:
         31 - unit-set-skip (OTHER_FAULT)
         33 - unit-set-split-lazy (SEGFAULT)
         38 - unit-tree (SEGFAULT)
         40 - stress-map-delodd (OTHER_FAULT)
         41 - stress-map-del3 (OTHER_FAULT)
         42 - stress-map-find-string (OTHER_FAULT)
         43 - stress-map-insdel-func (OTHER_FAULT)
         44 - stress-map-insdel-string (OTHER_FAULT)
         45 - stress-map-insdel-item-int (OTHER_FAULT)
         46 - stress-map-insdelfind-hp (OTHER_FAULT)
         48 - stress-map-minmax (OTHER_FAULT)
         49 - stress-map-iter-erase (OTHER_FAULT)
         50 - stress-pqueue (OTHER_FAULT)
         51 - stress-queue-pop (SEGFAULT)
         52 - stress-queue-push (SEGFAULT)
         53 - stress-queue-push-pop (SEGFAULT)
         54 - stress-queue-random (OTHER_FAULT)
         57 - stress-set-delodd (OTHER_FAULT)
         58 - stress-set-del3 (SEGFAULT)
         59 - stress-set-insdelfind-hp (OTHER_FAULT)
         62 - stress-set-insdel-func (OTHER_FAULT)
         63 - stress-set-insdel-string (OTHER_FAULT)
         64 - stress-set-iteration (SEGFAULT)
         65 - stress-set-iter-erase (SEGFAULT)
         66 - stress-stack (OTHER_FAULT)

There are three main factors to cause errors.

1. *** Error in `/home/mateng/GSoC/libcds-release/bin/unit-tree': malloc(): smallbin double linked list corrupted: 0x00000000035e1370
 ***
2. *** Error in `/home/mateng/GSoC/libcds-release/bin/stress-map-iter-erase': malloc(): memory corruption (fast): 0x00002ba53801d510 
3. *** Error in `/home/mateng/GSoC/libcds-release/bin/stress-pqueue': corrupted size vs. prev_size: 0x0000000000ddaae0 ***

So can someone help me to solve these issues? I will be appreciated.

khizmax commented 6 years ago

How do you compile the library?

stmatengss commented 6 years ago

I first run cmake . and make a new release directory. Then I make all to install this library. These are configurations.

Build type -- RELEASE
Compiler version: GNU 4.8.5
System: Linux version: 3.13.0-35-generic
Target architecture: x86_64
Compiler flags:  -O3 -DNDEBUG -std=c++11;-mcx16 -Wall;-Wextra;-pedantic
Exe flags: 
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   system
--   thread
--   chrono
--   date_time
--   atomic
Boost: 1_60 in /home/mateng/boost/boost_1_60_0, lib /home/mateng/boost/boost_1_60_0/stage/
lib
GTest: /usr/include, lib: /usr/local/lib/libgtest.a
khizmax commented 6 years ago

Hmm... Your trouble is a surprise for me... I have no reasonable answer. I suspect, the cause is some kind of misconfiguration in your environment. To find solution, get latest Clang or GCC, build libcds with asan instrumentation and run the test.

Example:

cmake -G "Unix Makefiles" \
 -DCMAKE_BUILD_TYPE=RELEASE \
 -DCMAKE_C_COMPILER=$CLANG6_ROOT/bin/clang \
 -DCMAKE_CXX_COMPILER=$CLANG6_ROOT/bin/clang++ \
 -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Wdocumentation -std=c++17" \
 -DCMAKE_EXE_LINKER_FLAGS="-L$CLANG6_ROOT/lib -Wl,-rpath=$CLANG6_ROOT/lib" \
 -DCDS_BIN_DIR=$BIN_ROOT \
 -DWITH_TESTS=ON \
 -DWITH_ASAN=ON \
 -DBOOST_ROOT=$LIB_ROOT/boost_1_65_1 \
 -DBOOST_LIBRARYDIR=$LIB_ROOT/boost_1_65_1/stage64-clang6-asan/lib \
 -DGTEST_INCLUDE_DIRS=$GTEST_ROOT/googletest/include \
 -DGTEST_LIBRARIES=$GTEST_ROOT/lib-clang6/libgtest.a \
 $CDS_SOURCE && \
make -j 10
stmatengss commented 6 years ago

Thx for your help. I will try it again or make tests on another platform.