-
Notifications
You must be signed in to change notification settings - Fork 3
Bump luzer with sanitizers support #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Needed for the following commit.
2c7a363
to
9fc045c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sergey!
Thanks for the patchset!
I'll proceed with the review per-patch below.
[PATCH 1/2] cmake: replace string with env as a list
Generally LGTM, with one nit below.
@@ -16,6 +16,13 @@ lapi_tests_make_lua_path(LUA_PATH | |||
${CMAKE_CURRENT_SOURCE_DIR}/?.lua | |||
) | |||
|
|||
list(APPEND TEST_ENV | |||
"LUA_PATH=${LUA_PATH};" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: I suppose there is no need for ;
here and below, since it is already the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LUA_PATH
and LUA_CPATH
are not touched in proposed patch, however, I've fixed for LD_PRELOAD_LIBS
:
@@ -29,7 +33,7 @@ list(APPEND TEST_ENV
"LUA_CPATH=${LUA_CPATH};"
"ASAN_OPTIONS=detect_odr_violation=0;"
"LD_DYNAMIC_WEAK=1;"
- "LD_PRELOAD=${LD_PRELOAD_LIBS};"
+ "LD_PRELOAD=${LD_PRELOAD_LIBS}"
)
function(create_test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[PATCH 2/2] cmake: support ASAN/UBSan in lapi tests
LGTM, with a few comments below.
@@ -26,7 +26,7 @@ endif() | |||
|
|||
ExternalProject_Add(bundled-luzer | |||
GIT_REPOSITORY https://github.com/ligurio/luzer | |||
GIT_TAG 82d41c5f350296ca351e785a24c914165a0e8033 | |||
GIT_TAG ligurio/gh-xxxx-build-sanitizer-libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update this part after the ligurio/luzer#38 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a reminder as a separate commit:
commit 94b11bbd294525c5543ff1999f7b241a2903f1c8 (HEAD -> ligurio/gh-xxxx-bump-luzer-sanitizers)
Author: Sergey Bronnikov <estetus@gmail.com>
Date: Mon Jun 9 17:01:31 2025 +0300
cmake: bump luzer version [TODO]
Must be updated after merging https://github.com/ligurio/luzer/pull/38
diff --git a/cmake/BuildLuzer.cmake b/cmake/BuildLuzer.cmake
index a55e7ce..e37edfb 100644
--- a/cmake/BuildLuzer.cmake
+++ b/cmake/BuildLuzer.cmake
@@ -26,7 +26,7 @@ endif()
ExternalProject_Add(bundled-luzer
GIT_REPOSITORY https://github.com/ligurio/luzer
- GIT_TAG 82d41c5f350296ca351e785a24c914165a0e8033
+ GIT_TAG ligurio/gh-xxxx-build-sanitizer-libs
GIT_PROGRESS TRUE
GIT_SHALLOW FALSE
SOURCE_DIR ${LUZER_DIR}/source
@@ -16,11 +16,20 @@ lapi_tests_make_lua_path(LUA_PATH | |||
${CMAKE_CURRENT_SOURCE_DIR}/?.lua | |||
) | |||
|
|||
set(DSO_SANITIZER_PATH "${PROJECT_BINARY_DIR}/luzer/build/luzer") | |||
set(DSO_ASAN_PATH "${DSO_SANITIZER_PATH}/asan_with_fuzzer.so") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather name it fuzzer_with_asan.so
and fuzzer_with_ubsan.so
instead. Feel free to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed here, right? ligurio/luzer#38
set(DSO_ASAN_PATH "${DSO_SANITIZER_PATH}/asan_with_fuzzer.so") | ||
set(DSO_UBSAN_PATH "${DSO_SANITIZER_PATH}/ubsan_with_fuzzer.so") | ||
|
||
if(ENABLE_ASAN OR ENABLE_UBSAN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is better to append the LD_PRELOAD_LIBS
env var for each type of sanitizer to avoid loading the UBSan version when only ASan is requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated:
--- a/tests/lapi/CMakeLists.txt
+++ b/tests/lapi/CMakeLists.txt
@@ -20,8 +20,12 @@ set(DSO_SANITIZER_PATH "${PROJECT_BINARY_DIR}/luzer/build/luzer")
set(DSO_ASAN_PATH "${DSO_SANITIZER_PATH}/asan_with_fuzzer.so")
set(DSO_UBSAN_PATH "${DSO_SANITIZER_PATH}/ubsan_with_fuzzer.so")
-if(ENABLE_ASAN OR ENABLE_UBSAN)
- set(LD_PRELOAD_LIBS "${DSO_ASAN_PATH}:${DSO_UBSAN_PATH}")
+if(ENABLE_ASAN)
+ list(APPEND LD_PRELOAD_LIBS ${DSO_ASAN_PATH})
+endif()
+
+if(ENABLE_UBSAN)
+ list(APPEND LD_PRELOAD_LIBS ${DSO_UBSAN_PATH})
endif()
list(APPEND TEST_ENV
C stack overflow:
|
Depends on ligurio/luzer#38.