[Tarantool-patches] [PATCH luajit v2 4/5] build: introduce LUAJIT_USE_ASAN option

Sergey Bronnikov sergeyb at tarantool.org
Tue Jul 25 15:26:04 MSK 2023


Hello, again


On 7/21/23 11:12, Igor Munkin wrote:


<snipped>

> +option(LUAJIT_USE_ASAN "Build LuaJIT with AddressSanitizer" OFF)
> +if(LUAJIT_USE_ASAN)
> +  if(NOT LUAJIT_USE_SYSMALLOC)
> +    message(WARNING
> +      "Unfortunately, internal LuaJIT memory allocator is not instrumented yet,"
> +      " so to find any memory errors it's better to build LuaJIT with system"
> +      " provided memory allocator (i.e. run CMake configuration phase with"
> +      " -DLUAJIT_USE_SYSMALLOC=ON)."
> +    )
> +  endif()
> +  # Use all recomendations described in AddressSanitize docs:
> +  # https://clang.llvm.org/docs/AddressSanitizer.html.
> +  AppendFlags(CMAKE_C_FLAGS
> +    # Enable hints for AddressSanitizer (see src/lj_str.c).
> +    -DLUAJIT_USE_ASAN
> +    # XXX: To get nicer stack traces in error messages.
> +    -fno-omit-frame-pointer
> +    # Enable AddressSanitizer support.
> +    -fsanitize=address
> +  )
> +endif()
>   

I suspect we need set in LUAJIT_USE_SYSMALLOC in cmake/luajit.cmake [1] 
on next LuaJIT bump, right?

Otherwise Tarantool CI will fail.


1. 
https://github.com/tarantool/tarantool/blob/1cda22aaaf7eb1f0880f4c70f2c79ce27a9604ce/cmake/luajit.cmake#L74-L76


>   # --- Main source tree ---------------------------------------------------------
>   


More information about the Tarantool-patches mailing list