ChimeraTK / cppext

A collection of C++ classes which are quite fundamental and thus considered inside ChimeraTK as an extension of C++.
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Tests fail with a segmentation fault #16

Closed smarsching closed 1 year ago

smarsching commented 1 year ago

When running the tests on macOS (12.6), some fail with a segmentation fault, others fail with different errors, and some never complete:

Running tests...
Test project /Users/termi/Documents/ChimeraTK/cppext-build
      Start  1: example
 1/16 Test  #1: example ..........................   Passed    1.43 sec
      Start  2: example2
 2/16 Test  #2: example2 .........................   Passed    1.17 sec
      Start  3: testContinuations
 3/16 Test  #3: testContinuations ................***Failed    0.31 sec
      Start  4: testEmpty
 4/16 Test  #4: testEmpty ........................***Failed    0.20 sec
      Start  5: testExceptions
 5/16 Test  #5: testExceptions ...................   Passed    0.20 sec
      Start  6: testFront
 6/16 Test  #6: testFront ........................***Failed    0.19 sec
      Start  7: testPerformance
 7/16 Test  #7: testPerformance ..................***Exception: SegFault  0.22 sec
      Start  8: testPushPop
 8/16 Test  #8: testPushPop ......................***Failed    0.20 sec
      Start  9: testReadWriteAvailable
 9/16 Test  #9: testReadWriteAvailable ...........***Failed    0.20 sec
      Start 10: testSemaphore
10/16 Test #10: testSemaphore ....................   Passed    0.30 sec
      Start 11: testSharing
11/16 Test #11: testSharing ......................***Failed    0.23 sec
      Start 12: testStresstest
12/16 Test #12: testStresstest ...................Bus error***Exception:   0.20 sec
      Start 13: testStresstestMultiproducer
13/16 Test #13: testStresstestMultiproducer ......***Exception: SegFault  0.19 sec
      Start 14: testSwap
14/16 Test #14: testSwap .........................***Failed    0.20 sec
      Start 15: testWhenAll
^Cmake: *** [test] Interrupt: 2

(The last test was cancelled because it did not complete, spinning at 100% CPU load).

I believe that this is caused by the missing initialization of an std::atomic. I will submit a PR that fixes the issue.