Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sstrickl opened this issue Nov 25, 2020 · 3 comments
Open

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

sstrickl opened this issue Nov 25, 2020 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening library-ffi

Comments

@sstrickl
Copy link
Contributor

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

@sstrickl sstrickl added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening labels Nov 25, 2020
@dcharkes
Copy link
Contributor

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 �[32m+0�[0m: sqlite integration test�[0m

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.

@dcharkes dcharkes changed the title Failures on Migrator: Implement check boxes on directories...[test] Fixes for running tests on Fuchsia emulator [samples/ffi] use-of-uninitialized-value in SQLite sample Nov 27, 2020
@aam
Copy link
Contributor

aam commented Aug 24, 2022

copybara-service bot pushed a commit that referenced this issue May 22, 2023
This allows it to be instrumented by the sanitizers.

Enabled only for MSAN and for Android.

TEST=ci
Bug: #44312
Bug: #44377
Bug: #43075
Bug: #50248
Bug: #50271
Bug: #52441
Change-Id: I96241e6ee28fb2a853d4a113aac268bc415a5fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304147
Commit-Queue: Ryan Macnak <[email protected]>
Reviewed-by: Daco Harkes <[email protected]>
copybara-service bot pushed a commit that referenced this issue May 22, 2023
This reverts commit bd589d4.

Reason for revert: breaks dart-sdk-linux-riscv64-main

Original change's description:
> [build] Build the standard c++ library from source.
>
> This allows it to be instrumented by the sanitizers.
>
> Enabled only for MSAN and for Android.
>
> TEST=ci
> Bug: #44312
> Bug: #44377
> Bug: #43075
> Bug: #50248
> Bug: #50271
> Bug: #52441
> Change-Id: I96241e6ee28fb2a853d4a113aac268bc415a5fd5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304147
> Commit-Queue: Ryan Macnak <[email protected]>
> Reviewed-by: Daco Harkes <[email protected]>

Bug: #44312
Bug: #44377
Bug: #43075
Bug: #50248
Bug: #50271
Bug: #52441
Change-Id: I0b1d0c0da1cd77e0f9645facfc58397cc216c584
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304823
Bot-Commit: Rubber Stamper <[email protected]>
Auto-Submit: Ryan Macnak <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
copybara-service bot pushed a commit that referenced this issue May 22, 2023
This allows it to be instrumented by the sanitizers.

Enabled only for MSAN and for Android.

Don't pick up Flutter's including no_exceptions in the default config set.

TEST=ci
Bug: #44312
Bug: #44377
Bug: #43075
Bug: #50248
Bug: #50271
Bug: #52441
Change-Id: If01704ff29569fba8f8181ed31d52faba8d8370f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304824
Reviewed-by: Alexander Aprelev <[email protected]>
Commit-Queue: Ryan Macnak <[email protected]>
@alexmarkov
Copy link
Contributor

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 �[32m+0�[0m: sqlite integration test�[0m

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening library-ffi
Projects
None yet
Development

No branches or pull requests

4 participants