Assert sanitizers are not correctly used by tests
Description
The revert commit bea35447 was inserted because the solution found at the time to start PyS2OPC tests without ASan was not robust (5ac0861d).
The problem was that the PyS2OPC validation test could not be started when compiled with ASan.
At the time, we wished to keep in CI all the tests with ASan and the PyS2OPC validation test on each push.
To do so, we used the fact that dependencies:
in the .gitlab-ci.yml
is a list to fetch the artefacts from the non-ASan build first (including the PyS2OPC library), then fetch the ASan build (which would replace all binaries except the PyS2OPC library).
This behavior worked at first, knowing that it was not an "elegant" solution.
Then it broke.
The goal of this commit is to find a solution to include regression tests of PyS2OPC without endangering ASan regression tests.
Possible Fixes
Test PyS2OPC on another occasion
Like in the nightly coverage tests, or make it a special test job and nightly schedule.
Not recommended.
Test PyS2OPC with sanitized S2OPC/libclient_subcription
Digging a little more in the issue of running sanitized PyS2OPC, it may be possible to run sanitized PyS2OPC with unsanitized Python. To do so:
- use sanitized
libs2opc
- run tests with the
LD_PRELOAD=/path/to/libasan.so python3 test.py
- (various solutions with
-lasan
at link time do not work because libasan must be the first dynamic library to be loaded by the program (which ispython3
)
Test sanitized PyS2OPC
Compile the CFFI module with -fsanitize
.
This is a step further in the sanitize process.
This may raise issues about CFFI that will be hard to fix.
Fixes
The choice was set to "Test PyS2OPC with sanitized S2OPC/libclient_subcription".
We did not reach this goal yet, as there are more leaks (maybe false positive), mostly due to the use of Python, which cannot be filtered out easily.
Further investigations are required (#597 (closed)).
The decision is to fallback to "Test PyS2OPC on another occasion", namely the nightly builds.