Version 2.14.0-316.0.dev
Merge commit '02faf538f6bfc03485f1e9be849046ea6d27b7f5' into 'dev'
diff --git a/runtime/tests/concurrency/stress_test_list.json b/runtime/tests/concurrency/stress_test_list.json
index b8f2ae6..26cf025 100644
--- a/runtime/tests/concurrency/stress_test_list.json
+++ b/runtime/tests/concurrency/stress_test_list.json
@@ -3260,7 +3260,6 @@
"../../../tests/standalone/io/file_constructor_test.dart",
"../../../tests/standalone/io/file_copy_test.dart",
"../../../tests/standalone/io/file_create_test.dart",
- "../../../tests/standalone/io/file_fuzz_test.dart",
"../../../tests/standalone/io/file_non_ascii_sync_test.dart",
"../../../tests/standalone/io/file_non_ascii_test.dart",
"../../../tests/standalone/io/file_output_stream_test.dart",
@@ -6595,7 +6594,6 @@
"../../../tests/standalone_2/io/file_copy_test.dart",
"../../../tests/standalone_2/io/file_create_test.dart",
"../../../tests/standalone_2/io/file_error_test.dart",
- "../../../tests/standalone_2/io/file_fuzz_test.dart",
"../../../tests/standalone_2/io/file_non_ascii_sync_test.dart",
"../../../tests/standalone_2/io/file_non_ascii_test.dart",
"../../../tests/standalone_2/io/file_output_stream_test.dart",
diff --git a/runtime/vm/type_testing_stubs.cc b/runtime/vm/type_testing_stubs.cc
index 45d98c8..28b108b 100644
--- a/runtime/vm/type_testing_stubs.cc
+++ b/runtime/vm/type_testing_stubs.cc
@@ -50,7 +50,7 @@
string_ = lib_.url();
curl = OS::SCreate(Z, "%s_", string_.ToCString());
} else {
- static intptr_t counter = 0;
+ static std::atomic<intptr_t> counter = 0;
curl = OS::SCreate(Z, "nolib%" Pd "_", counter++);
}
diff --git a/runtime/vm/version_in.cc b/runtime/vm/version_in.cc
index 2fcf5c5..206cd1f 100644
--- a/runtime/vm/version_in.cc
+++ b/runtime/vm/version_in.cc
@@ -2,23 +2,31 @@
// 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.
-#include "vm/version.h"
+#include "platform/atomic.h"
#include "vm/cpu.h"
#include "vm/os.h"
+#include "vm/version.h"
namespace dart {
-// TODO(iposva): Avoid racy initialization.
-static const char* formatted_version = NULL;
+// We use require-release semantics to ensure initializing stores to the string
+// are visible when the string becomes visible.
+static AcqRelAtomic<const char*> formatted_version = nullptr;
const char* Version::String() {
- if (formatted_version == NULL) {
+ if (formatted_version.load() == nullptr) {
const char* os = OS::Name();
const char* arch = CPU::Id();
- formatted_version = OS::SCreate(NULL, "%s on \"%s_%s\"", str_, os, arch);
+ char* version_string =
+ OS::SCreate(nullptr, "%s on \"%s_%s\"", str_, os, arch);
+ const char* expect_old_is_null = nullptr;
+ if (!formatted_version.compare_exchange_strong(expect_old_is_null,
+ version_string)) {
+ free(version_string);
+ }
}
- return formatted_version;
+ return formatted_version.load();
}
const char* Version::SnapshotString() {
diff --git a/tests/standalone/io/issue_30687_test.dart b/tests/standalone/io/issue_30687_test.dart
index 96b514d..aed91cf 100644
--- a/tests/standalone/io/issue_30687_test.dart
+++ b/tests/standalone/io/issue_30687_test.dart
@@ -5,40 +5,41 @@
import 'dart:io';
import 'package:expect/expect.dart';
+import 'package:path/path.dart' as path;
+
+import 'unix_socket_test.dart' show withTempDir;
main() async {
- Link link1 = new Link(
- Directory.systemTemp.path + Platform.pathSeparator + 'link1.lnk');
- Link link2 = new Link(
- Directory.systemTemp.path + Platform.pathSeparator + 'link2.lnk');
+ await withTempDir('issue_30687', (Directory tempDir) async {
+ final link1 = Link(tempDir.path + Platform.pathSeparator + 'link1.lnk');
+ final link2 = Link(tempDir.path + Platform.pathSeparator + 'link2.lnk');
- Directory target1 = new Directory(
- Directory.systemTemp.path + Platform.pathSeparator + 'target1');
- Directory target2 = new Directory(
- Directory.systemTemp.path + Platform.pathSeparator + 'target2');
+ final target1 = Directory(path.join(tempDir.path, 'target1'));
+ final target2 = Directory(path.join(tempDir.path, 'target2'));
- target1.createSync();
- target2.createSync();
+ target1.createSync();
+ target2.createSync();
- Expect.isTrue(target1.existsSync());
- Expect.isTrue(target2.existsSync());
+ Expect.isTrue(target1.existsSync());
+ Expect.isTrue(target2.existsSync());
- link1.createSync(target1.path);
- link2.createSync(target2.path);
- Expect.isTrue(link1.existsSync());
- Expect.isTrue(link2.existsSync());
+ link1.createSync(target1.path);
+ link2.createSync(target2.path);
+ Expect.isTrue(link1.existsSync());
+ Expect.isTrue(link2.existsSync());
- try {
- Link renamed = await link1.rename(link2.path);
- Expect.isFalse(link1.existsSync());
- Expect.isTrue(renamed.existsSync());
- Expect.equals(renamed.path, link2.path);
- } finally {
- target1.delete();
- target2.delete();
- link2.delete();
- if (link1.existsSync()) {
- link1.delete();
+ try {
+ Link renamed = await link1.rename(link2.path);
+ Expect.isFalse(link1.existsSync());
+ Expect.isTrue(renamed.existsSync());
+ Expect.equals(renamed.path, link2.path);
+ } finally {
+ target1.delete();
+ target2.delete();
+ link2.delete();
+ if (link1.existsSync()) {
+ link1.delete();
+ }
}
- }
+ });
}
diff --git a/tests/standalone_2/io/issue_30687_test.dart b/tests/standalone_2/io/issue_30687_test.dart
index 1392012..a74b33e 100644
--- a/tests/standalone_2/io/issue_30687_test.dart
+++ b/tests/standalone_2/io/issue_30687_test.dart
@@ -7,40 +7,41 @@
import 'dart:io';
import 'package:expect/expect.dart';
+import 'package:path/path.dart' as path;
+
+import 'unix_socket_test.dart' show withTempDir;
main() async {
- Link link1 = new Link(
- Directory.systemTemp.path + Platform.pathSeparator + 'link1.lnk');
- Link link2 = new Link(
- Directory.systemTemp.path + Platform.pathSeparator + 'link2.lnk');
+ await withTempDir('issue_30687', (Directory tempDir) async {
+ final link1 = Link(tempDir.path + Platform.pathSeparator + 'link1.lnk');
+ final link2 = Link(tempDir.path + Platform.pathSeparator + 'link2.lnk');
- Directory target1 = new Directory(
- Directory.systemTemp.path + Platform.pathSeparator + 'target1');
- Directory target2 = new Directory(
- Directory.systemTemp.path + Platform.pathSeparator + 'target2');
+ final target1 = Directory(path.join(tempDir.path, 'target1'));
+ final target2 = Directory(path.join(tempDir.path, 'target2'));
- target1.createSync();
- target2.createSync();
+ target1.createSync();
+ target2.createSync();
- Expect.isTrue(target1.existsSync());
- Expect.isTrue(target2.existsSync());
+ Expect.isTrue(target1.existsSync());
+ Expect.isTrue(target2.existsSync());
- link1.createSync(target1.path);
- link2.createSync(target2.path);
- Expect.isTrue(link1.existsSync());
- Expect.isTrue(link2.existsSync());
+ link1.createSync(target1.path);
+ link2.createSync(target2.path);
+ Expect.isTrue(link1.existsSync());
+ Expect.isTrue(link2.existsSync());
- try {
- Link renamed = await link1.rename(link2.path);
- Expect.isFalse(link1.existsSync());
- Expect.isTrue(renamed.existsSync());
- Expect.equals(renamed.path, link2.path);
- } finally {
- target1.delete();
- target2.delete();
- link2.delete();
- if (link1.existsSync()) {
- link1.delete();
+ try {
+ Link renamed = await link1.rename(link2.path);
+ Expect.isFalse(link1.existsSync());
+ Expect.isTrue(renamed.existsSync());
+ Expect.equals(renamed.path, link2.path);
+ } finally {
+ target1.delete();
+ target2.delete();
+ link2.delete();
+ if (link1.existsSync()) {
+ link1.delete();
+ }
}
- }
+ });
}
diff --git a/tools/VERSION b/tools/VERSION
index fa3a2fe..d31e737 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 315
+PRERELEASE 316
PRERELEASE_PATCH 0
\ No newline at end of file