dart-lang / sdk

The Dart SDK, including the VM, dart2js, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
9.95k stars 1.53k forks source link

MSAN use-of-uninitialized-value in FFI tests #55783

Open rmacnak-google opened 1 month ago

rmacnak-google commented 1 month ago

ffi/function_structs_by_value_generated_args_native_test log ffi/function_structs_by_value_generated_ret_arg_native_test log ffi/function_structs_by_value_generated_args_test log

are flaky failing for both X64 and ARM64.

@dcharkes

dcharkes commented 1 month ago

Thanks @rmacnak-google.

Relevant logs:

stderr:
==27580==WARNING: MemorySanitizer: use-of-uninitialized-value
/b/s/w/ir/cache/builder/sdk/buildtools/linux-arm64/clang/bin/llvm-symbolizer: error: '[anon:dart-code]': No such file or directory
    #0 0xffffe74df9b0 in PassStructStruct16BytesMixed3x10 out/ReleaseMSANARM64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:3808:25
    #1 0xfffff7587024  ([anon:dart-code]+0x7024)
    #2 0xffffe73bafe0  ([anon:dart-code]+0x3afe0)
stderr:
==27376==WARNING: MemorySanitizer: use-of-uninitialized-value
/b/s/w/ir/cache/builder/sdk/buildtools/linux-arm64/clang/bin/llvm-symbolizer: error: '[anon:dart-code]': No such file or directory
    #0 0xffffe7ffd9e4 in ReturnStructNestedIntStructAlignmentInt32 out/ReleaseMSANARM64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:6238:13
    #1 0xfffff7587e04  ([anon:dart-code]+0x7e04)
    #2 0xfffff50e6858  ([anon:dart-code]+0x66858)
stderr:
==725132==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fd3d1c5003e in ReturnStructArgumentStructStruct32BytesHomogeneous out/ReleaseMSANX64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:5962:36
    #1 0x7fd3e1486e3a  (<unknown module>)
    #2 0x7fd3de94448e  (<unknown module>)
stderr:
==725150==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f47351510f0 in ReturnStructNestedIntStructAlignmentInt32 out/ReleaseMSANX64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:6238:13
    #1 0x7f4744185f79  (<unknown module>)
    #2 0x7f474185dbdd  (<unknown module>)
    #3 0x7f474185d6cf  (<unknown module>)
stderr:
==15165==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f4191c765e2 in PassStruct8BytesInlineArrayIntx4 out/ReleaseMSANX64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:3412:13
    #1 0x7f41a1e85f79  (<unknown module>)
    #2 0x7f4192699cc2  (<unknown module>)

Seems to happen with multiple combinations of vm flags.

And it's all when std:couting parameters.

(And as opposed to earlier issues with std::cout (https://github.com/dart-lang/sdk/issues/43075), this is not failing inside the std lib, but on the actual parameters.)

Link to flakes on dashboard: https://dart-current-results.web.app/#/filter=ffi/function_structs_by_value&flaky

Link to flakiness dashboard: msan and ffi.

Some more similar existing failures:

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8747900274836325473/+/u/test_results/ignored_flaky_test_failure_logs

stderr:
==572662==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fd6ca648b0c in PassUnion9BytesNestedIntx10 out/ReleaseMSANX64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:4425:57
    #1 0x7fd6da385f79  (<unknown module>)
    #2 0x7fd6caf3df24  (<unknown module>)

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8749893407485939393/+/u/test_results/ignored_flaky_test_failure_logs

stderr:
==311022==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f537f8c944e in PassUint8Struct32BytesInlineArrayMultiDimensionalI out/ReleaseMSANX64/../../runtime/bin/ffi_test/ffi_test_functions_generated.cc:3918:13
    #1 0x7f538f286e3a  (<unknown module>)

This has been happing for a while, going as far back as 2023-05-xx.