Files
sdk/tests/standalone/io/file_error2_test.dart
T
Ryan Macnak 608604589c [vm, gc] Fix a lock order inversion detected by TSAN.
If a thread acquires both a freelist lock and the pages lock, ensure it acquires the freelist lock first.

Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: Iadd7c270e18052aa32d883db1ddb8e4ebd1f0c49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138041
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-03-03 18:30:23 +00:00

33 lines
1.2 KiB
Dart

// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Dart test program for testing error handling in file I/O.
//
// Customize ASAN options for this test with 'allocator_may_return_null=1' as
// it tries to allocate a large memory buffer.
// Environment=ASAN_OPTIONS=handle_segv=0:detect_stack_use_after_return=1:allocator_may_return_null=1
// Environment=LSAN_OPTIONS=handle_segv=0:detect_stack_use_after_return=1:allocator_may_return_null=1
// Environment=MSAN_OPTIONS=handle_segv=0:detect_stack_use_after_return=1:allocator_may_return_null=1
// Environment=TSAN_OPTIONS=handle_segv=0:detect_stack_use_after_return=1:allocator_may_return_null=1
import "dart:io";
import "file_error_test.dart" show createTestFile;
import "package:expect/expect.dart";
testReadSyncBigInt() {
createTestFile((file, done) {
var bigint = 9223372036854775807;
var openedFile = file.openSync();
Expect.throws(
() => openedFile.readSync(bigint), (e) => e is FileSystemException);
openedFile.closeSync();
done();
});
}
main() {
testReadSyncBigInt();
}