Skip to content

Commit 06dd95b

Browse files
rmacnak-googleCommit Queue
authored and
Commit Queue
committed
[infra] Expand sanitizer test coverage.
TEST=ci Change-Id: I5e7709572f3ea0a16925996be8ab903b6eccc0e1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365100 Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent dc37283 commit 06dd95b

File tree

5 files changed

+12
-70
lines changed

5 files changed

+12
-70
lines changed

runtime/bin/ffi_test/ffi_test_functions.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
#include <stdarg.h>
1111
#include <stddef.h>
12+
#include <stdio.h>
1213
#include <stdlib.h>
1314
#include <sys/types.h>
1415

16+
#include <cinttypes>
1517
#include <cmath>
1618
#include <iostream>
1719
#include <limits>
@@ -898,7 +900,7 @@ DART_EXPORT void CallbackWithStruct(void (*f)(Struct8BytesNestedIntCopy)) {
898900
// Sanity test.
899901
DART_EXPORT intptr_t TestSimpleAddition(intptr_t (*add)(int, int)) {
900902
const intptr_t result = add(10, 20);
901-
std::cout << "result " << result << "\n";
903+
printf("result %" PRIdPTR "\n", result);
902904
CHECK_EQ(result, 30);
903905
return 0;
904906
}

runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ class PendingCall {
688688
*response_length_ = response_length;
689689

690690
printf("C : Notify result ready.\n");
691+
std::unique_lock<std::mutex> lock(mutex);
691692
notified = true;
692693
cv.notify_one();
693694
}

runtime/vm/compiler/backend/il.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2550,7 +2550,7 @@ Definition* BinaryIntegerOpInstr::Canonicalize(FlowGraph* flow_graph) {
25502550
break;
25512551

25522552
case Token::kMOD:
2553-
if (std::abs(rhs) == 1) {
2553+
if ((rhs == -1) || (rhs == 1)) {
25542554
return flow_graph->TryCreateConstantReplacementFor(this,
25552555
Object::smi_zero());
25562556
}

samples/ffi/samples_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// This file exercises the sample files so that they are tested.
66
//
77
// SharedObjects=ffi_test_dynamic_library ffi_test_functions
8+
// Environment=MSAN_OPTIONS=handle_segv=0:detect_stack_use_after_return=1:allocator_may_return_null=1
9+
// Environment=TSAN_OPTIONS=handle_segv=0:detect_stack_use_after_return=1:allocator_may_return_null=1
810

911
import 'sample_ffi_bitfield.dart' as bitfield;
1012
import 'sample_ffi_data.dart' as data;

tools/bots/test_matrix.json

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,7 @@
12501250
"builders": [
12511251
"vm-asan-linux-release-x64",
12521252
"vm-msan-linux-release-x64",
1253+
"vm-tsan-linux-release-x64",
12531254
"vm-ubsan-linux-release-x64"
12541255
],
12551256
"meta": {
@@ -1266,42 +1267,7 @@
12661267
{
12671268
"name": "vm tests",
12681269
"arguments": [
1269-
"-nvm-${sanitizer}-${system}-${mode}-${arch}",
1270-
"corelib",
1271-
"ffi",
1272-
"language",
1273-
"lib",
1274-
"samples",
1275-
"standalone",
1276-
"utils",
1277-
"vm"
1278-
],
1279-
"fileset": "vm",
1280-
"shards": 4
1281-
}
1282-
]
1283-
},
1284-
{
1285-
"builders": [
1286-
"vm-tsan-linux-release-x64"
1287-
],
1288-
"meta": {
1289-
"description": "This configuration is used by the VM/JIT builders with sanitizers."
1290-
},
1291-
"steps": [
1292-
{
1293-
"name": "build dart",
1294-
"script": "tools/build.py",
1295-
"arguments": [
1296-
"runtime"
1297-
]
1298-
},
1299-
{
1300-
"name": "vm tests",
1301-
"arguments": [
1302-
"-nvm-${sanitizer}-${system}-${mode}-${arch}",
1303-
"vm",
1304-
"standalone"
1270+
"-nvm-${sanitizer}-${system}-${mode}-${arch}"
13051271
],
13061272
"fileset": "vm",
13071273
"shards": 8
@@ -1312,6 +1278,7 @@
13121278
"builders": [
13131279
"vm-aot-asan-linux-release-x64",
13141280
"vm-aot-msan-linux-release-x64",
1281+
"vm-aot-tsan-linux-release-x64",
13151282
"vm-aot-ubsan-linux-release-x64"
13161283
],
13171284
"meta": {
@@ -1329,40 +1296,10 @@
13291296
{
13301297
"name": "vm tests",
13311298
"arguments": [
1332-
"-nvm-aot-${sanitizer}-${system}-${mode}-${arch}",
1333-
"vm",
1334-
"standalone"
1335-
],
1336-
"fileset": "vm",
1337-
"shards": 4
1338-
}
1339-
]
1340-
},
1341-
{
1342-
"builders": [
1343-
"vm-aot-tsan-linux-release-x64"
1344-
],
1345-
"meta": {
1346-
"description": "This configuration is used by the VM/AOT builders with sanitizers."
1347-
},
1348-
"steps": [
1349-
{
1350-
"name": "build dart",
1351-
"script": "tools/build.py",
1352-
"arguments": [
1353-
"runtime",
1354-
"runtime_precompiled"
1355-
]
1356-
},
1357-
{
1358-
"name": "vm tests",
1359-
"arguments": [
1360-
"-nvm-aot-${sanitizer}-${system}-${mode}-${arch}",
1361-
"vm",
1362-
"standalone"
1299+
"-nvm-aot-${sanitizer}-${system}-${mode}-${arch}"
13631300
],
13641301
"fileset": "vm",
1365-
"shards": 8
1302+
"shards": 12
13661303
}
13671304
]
13681305
},

0 commit comments

Comments
 (0)