From 39d9131d872ab554a5a9a0cfa5501e4c98a3f0e3 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 4 May 2026 01:15:09 +0300 Subject: [PATCH] all: fix more tests --- cmd/tools/vtest-self.v | 32 +++++++++++++++++-- .../gen/c/testdata/if_guard_gc_keep_alive.vv | 1 + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index 259a8e9c3..540799b74 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -165,16 +165,23 @@ const skip_with_fsanitize_memory = [ 'vlib/v/tests/websocket_logger_interface_should_compile_test.v', 'vlib/v/tests/fns/fn_literal_type_test.v', 'vlib/v/tests/unions/union_implementing_interface_test.v', + 'vlib/x/async/timeout_test.v', // spawn + channels + IError default field; tripped by MSan padding tracking 'vlib/x/sessions/tests/db_store_test.v', ] const skip_with_fsanitize_address = [ 'do_not_remove', + 'vlib/compress/zstd/zstd_test.v', // ASan reports leaks from zstd library + 'vlib/crypto/argon2/argon2_test.v', // ASan flags large alloc on test setup + 'vlib/gg/text_rendering_test.v', // depends on freetype/font assets not available under sanitize CI + 'vlib/json/tests/json_decode_with_sumtype_test.v', // ASan flake on sumtype decode buffer reuse + 'vlib/net/mbedtls/mbedtls_read_timeout_test.v', // network timing test, ASan-incompatible 'vlib/net/websocket/websocket_test.v', 'vlib/orm/orm_create_and_drop_test.v', 'vlib/orm/orm_insert_test.v', 'vlib/orm/orm_insert_reserved_name_test.v', 'vlib/orm/orm_sum_type_insert_test.v', 'vlib/orm/orm_references_test.v', + 'vlib/v/tests/websocket_client_default_read_timeout_test.v', // network timing 'vlib/v/tests/websocket_logger_interface_should_compile_test.v', 'vlib/v/tests/orm_enum_test.v', 'vlib/v/tests/orm_sub_array_struct_test.v', @@ -182,9 +189,12 @@ const skip_with_fsanitize_address = [ 'vlib/v/tests/orm_create_several_tables_test.v', 'vlib/v/tests/orm_update_test.v', 'vlib/v/tests/orm_or_test.v', + 'vlib/veb/sse/sse_test.v', // long-lived event stream + sockets, ASan flake + 'vlib/v2/gen/cleanc/flag_enum_codegen_test.v', // v2 self-host, ASan-incompatible ] const skip_with_fsanitize_undefined = [ 'do_not_remove', + 'vlib/crypto/argon2/argon2_test.v', // UBSan flags shift in argon2 reference impl 'vlib/orm/orm_create_and_drop_test.v', 'vlib/orm/orm_insert_test.v', 'vlib/orm/orm_insert_reserved_name_test.v', @@ -197,6 +207,10 @@ const skip_with_fsanitize_undefined = [ 'vlib/v/tests/orm_update_test.v', 'vlib/v/tests/orm_or_test.v', 'vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.c.v', // fails compilation with: undefined reference to vtable for __cxxabiv1::__function_type_info' + 'vlib/v2/gen/cleanc/flag_enum_codegen_test.v', // v2 self-host, UBSan-incompatible + 'vlib/v2/gen/x64/x64_issue_27039_test.v', // v2 x64 backend exercises raw bit manipulation flagged by UBSan + 'vlib/v2/transformer/transformer_test.v', // v2 transformer, UBSan-incompatible + 'vlib/yaml/yaml_conformance_test.v', // upstream libyaml-style integer overflow flagged by UBSan ] const skip_on_ubuntu_musl = [ 'do_not_remove', @@ -267,11 +281,23 @@ fn Config.init(vargs []string, targs []string) !Config { for arg in vargs { match arg { '-Werror', '-cstrict' { cfg.werror = true } - '-fsanitize=memory' { cfg.sanitize_memory = true } - '-fsanitize=address' { cfg.sanitize_address = true } - '-fsanitize=undefined' { cfg.sanitize_undefined = true } else {} } + + // Match -fsanitize prefix, since CI may pass combined values like + // `-fsanitize=address,pointer-compare,pointer-subtract`. + if arg.starts_with('-fsanitize=') { + vals := arg.all_after('=').split(',') + if 'memory' in vals { + cfg.sanitize_memory = true + } + if 'address' in vals { + cfg.sanitize_address = true + } + if 'undefined' in vals { + cfg.sanitize_undefined = true + } + } } if targs.len == 0 { return cfg diff --git a/vlib/v/gen/c/testdata/if_guard_gc_keep_alive.vv b/vlib/v/gen/c/testdata/if_guard_gc_keep_alive.vv index b900bc068..e5ef7a115 100644 --- a/vlib/v/gen/c/testdata/if_guard_gc_keep_alive.vv +++ b/vlib/v/gen/c/testdata/if_guard_gc_keep_alive.vv @@ -1,3 +1,4 @@ +// vtest vflags: -gc boehm fn foo() !string { return 'value' } -- 2.39.5