zstd icon indicating copy to clipboard operation
zstd copied to clipboard

LLVM mingw bug AddressSanitizer: use-after-poison on address

Open calvin2021y opened this issue 3 years ago • 3 comments

Describe the bug when build with https://github.com/mstorsjo/llvm-mingw and CMAKE, zstd make app crash with AddressSanitizer: use-after-poison on address

To Reproduce Steps to reproduce the behavior:

  1. download llvm mingw for ubuntu
  2. build zstd with cmake
  3. create libuv thread and use ZSTD_compress
  4. app late crash with AddressSanitizer: use-after-poison on address

remove the only one function call from ZSTD_compress fix the problem.

Expected behavior expect it work without crash.

Desktop (please complete the following information):

  • OS: win10
  • Compiler llvm mingw clang
  • Flags -O1 -g
  • Build system cmake -DBUILD_SHARED_LIBS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_MULTITHREAD_SUPPORT=OFF -DZSTD_BUILD_PROGRAMS=OFF

calvin2021y avatar Aug 10 '22 11:08 calvin2021y

remove ZSTD, or change ZSTD into lz4 both fix the problem.

calvin2021y avatar Aug 11 '22 09:08 calvin2021y

Thanks for the report! Could you share the exact code you're using to call ZSTD_compress? (You could create a GitHub Gist of that code and share that link with me).

embg avatar Aug 16 '22 16:08 embg

https://gist.github.com/calvin2021y/955910b52c46773a846dcad856a01fcd

calvin2021y avatar Aug 19 '22 09:08 calvin2021y

@calvin2021y, can you share a little more about this issue? I don't see -fsanitize=address in the list of arguments you're providing to the build.

felixhandte avatar Jan 12 '23 16:01 felixhandte