diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 6a278055e950..65ee34162a9d 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -110,6 +110,16 @@ stdenv.mkDerivation (finalAttrs: { }) ]; + # capi3c.test is a copy of capi3.test, but upstream only disabled the + # intentional use-after-free cases in the original. They segfault with + # allocators that return freed memory to the OS eagerly, such as musl's. + ${if stdenv.hostPlatform.isMusl then "postPatch" else null} = '' + substituteInPlace test/capi3c.test \ + --replace-fail \ + 'if {[clang_sanitize_address]==0} {' \ + 'if {0 && [clang_sanitize_address]==0} {' + ''; + buildInputs = [ zlib ] @@ -199,6 +209,9 @@ stdenv.mkDerivation (finalAttrs: { doCheck = stdenv.hostPlatform.isLinux; # When tcl is not available, only run test targets that don't need it. checkTarget = lib.optionalString stdenv.hostPlatform.isStatic "fuzztest sourcetest"; + # Neither GCC's libsanitizer nor compiler-rt's sanitizers are built for + # musl, so the fuzzcheck-asan and fuzzcheck-ubsan programs cannot be linked. + ${if stdenv.hostPlatform.isMusl then "checkFlags" else null} = [ "TSTRNNR_OPTS=~fuzzcheck-%san" ]; passthru = { tests = {