It failed with: ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
Use ASAN_OPTIONS=verify_asan_link_order=0 instead.
target_link_libraries(pthread-${x} PRIVATE Threads::Threads)
add_dependencies(tests pthread-${x})
target_link_libraries(pthread-${x} PRIVATE Threads::Threads)
add_dependencies(tests pthread-${x})
- ADD_TESH_FACTORIES(pthread-${x} "^thread" --setenv LD_PRELOAD=${CMAKE_BINARY_DIR}/lib/libsthread.so --cd ${CMAKE_BINARY_DIR}/examples/sthread ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
+ ADD_TESH_FACTORIES(pthread-${x} "^thread" --setenv libdir=${CMAKE_BINARY_DIR}/lib --cd ${CMAKE_BINARY_DIR}/examples/sthread ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
endif()
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
endif()
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
-$ ./pthread-mutex-simple
+$ env ASAN_OPTIONS=verify_asan_link_order=0:$ASAN_OPTIONS LD_PRELOAD=${libdir:=.}/libsthread.so ./pthread-mutex-simple
> [0.000000] [sthread/INFO] Starting the simulation.
> The thread 0 is terminating.
> All threads are started.
> The thread 1 is terminating.
> User's main is terminating.
> [0.000000] [sthread/INFO] Starting the simulation.
> The thread 0 is terminating.
> All threads are started.
> The thread 1 is terminating.
> User's main is terminating.
-> [0.000000] [sthread/INFO] All threads exited. Terminating the simulation.
\ No newline at end of file
+> [0.000000] [sthread/INFO] All threads exited. Terminating the simulation.