dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.19k stars 1.57k forks source link

[samples/ffi] use-of-uninitialized-value in SQLite sample #44312

Open sstrickl opened 3 years ago

sstrickl commented 3 years ago

There are new test failures on Migrator: Implement check boxes on directories...[test] Fixes for running tests on Fuchsia emulator.

The tests

samples_2/ffi/samples_test Crash (expected Pass)
samples_2/ffi/sqlite/test/sqlite_test Crash (expected Pass)

are failing on configurations

dartk-msan-linux-release-x64

TBH, I've forgotten how to check now if these were approved in the old location, but creating a bug and approving for now in case they were not. Feel free to close if they were approved there and/or an issue for that already exists. (Searched for ffi and MSAN and none of the issues that came up were directly related.)

/cc @dcharkes

dcharkes commented 3 years ago

Thanks for reporting @sstrickl.

Simple samples

https://dart-ci.appspot.com/log/vm-kernel-msan-linux-release-x64/dartk-msan-linux-release-x64/1226/samples_2/ffi/samples_test

==24286==ERROR: MemorySanitizer: requested allocation size 0xfffffffffffffff8 exceeds maximum supported size of 0x200000000

This is indeed expected to fail on MSAN.

SQLite

https://dart-ci.appspot.com/log/vm-kernel-msan-linux-release-x64/dartk-msan-linux-release-x64/1226/samples_2/ffi/sqlite/test/sqlite_test

--- Command "vm" (took 16.000241s):
DART_CONFIGURATION=ReleaseMSANX64 out/ReleaseMSANX64/dart --optimization-counter-threshold=5 --ignore-unrecognized-flags --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/samples_2/ffi/sqlite/test/sqlite_test.dart

exit code:
-6

stdout:
00:00 +0: sqlite integration test

stderr:
Uninitialized bytes in __interceptor_strlen at offset 61 inside [0x704000000600, 62)
==14262==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fb3585f6d7c  (/usr/lib/x86_64-linux-gnu/libsqlite3.so+0x4bd7c)
    #1 0x7fb3586560f8  (/usr/lib/x86_64-linux-gnu/libsqlite3.so+0xab0f8)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/usr/lib/x86_64-linux-gnu/libsqlite3.so+0x4bd7c) 
Exiting

--- Re-run this test:
python tools/test.py -n dartk-msan-linux-release-x64 samples_2/ffi/sqlite/test/sqlite_test

That one I have not investigated before.

aam commented 2 years ago

Started to fail again https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8805338751679921505/+/u/test_results/new_test_failures__logs_

alexmarkov commented 11 months ago

Still failing:

/=============================================================================================\
| samples/ffi/sqlite/test/sqlite_test failed again (CompileTimeError -> Crash, expected Pass) |
\=============================================================================================/

--- Command "vm" (took 15.000123s):
DART_CONFIGURATION=ReleaseMSANX64 out/ReleaseMSANX64/dart --sound-null-safety -Dtest_runner.configuration=vm-msan-linux-release-x64 --ignore-unrecognized-flags --packages=/b/s/w/ir/.dart_tool/package_config.json /b/s/w/ir/samples/ffi/sqlite/test/sqlite_test.dart

exit code:
-6

stdout:
00:00 +0: sqlite integration test

stderr:
Uninitialized bytes in strlen at offset 0 inside [0x703000016230, 42)
==14713==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fb30fabe563  (/lib/x86_64-linux-gnu/libsqlite3.so+0x67563) (BuildId: 02c8f1d04c9ec2f44b5e9d9f69973a201db0c8ac)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/lib/x86_64-linux-gnu/libsqlite3.so+0x67563) (BuildId: 02c8f1d04c9ec2f44b5e9d9f69973a201db0c8ac) 
Exiting

--- Re-run this test:
python3 tools/test.py -n vm-msan-linux-release-x64 samples/ffi/sqlite/test/sqlite_test