Enable the address sanitizer in our CI to catch memory corruption immediately (#1014)

* android

* add a new build job with asan enabled

* xcconfigs & test crash page

* lock merge

* don't enable ASAN from yml

* fix flow

* yarn lint

* run static analysis on release unit/integration

* fix merge conflicts with master

* yarn lint and pathing fix

* static analyzer & sanitizer building

* ios enablesanitizer

* disable thread sanitizer

* remove clang static analyzer sim filter

* add back arm64 excluded arch

* add back arm64 exclusion

* ios sanitizer scheme

* enable asan from ios schemes

* podfile.lock conflicts
This commit is contained in:
HeyImChris 2022-02-18 14:43:29 -08:00 коммит произвёл GitHub
Родитель f84e49e931
Коммит 75775cabb2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
23 изменённых файлов: 393 добавлений и 48 удалений

Просмотреть файл

@ -0,0 +1,25 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
import type {ViewProps} from '../Components/View/ViewPropTypes';
const {requireNativeComponent} = require('react-native');
type NativeProps = $ReadOnly<{|
...ViewProps,
|}>;
const RCTAddressSanitizerCrash: HostComponent<NativeProps> = requireNativeComponent<NativeProps>(
'RCTAddressSanitizerCrash',
);
module.exports = RCTAddressSanitizerCrash;

Просмотреть файл

@ -0,0 +1,12 @@
/*
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <React/RCTUIKit.h>
#import <React/RCTBridge.h>
@interface RCTAddressSanitizerCrashManager : NSObject <RCTBridgeModule>
@end

Просмотреть файл

@ -0,0 +1,18 @@
//
// RCTAddressSanitizerCrashManager.mm
// Pods
//
#import "RCTAddressSanitizerCrashManager.h"
@implementation RCTAddressSanitizerCrashManager
RCT_EXPORT_MODULE(ASANCrash)
RCT_EXPORT_METHOD(invokeMemoryCrash) {
char *s = (char*)malloc(100);
free(s);
strcpy(s, "Hello world!"); // AddressSanitizer: heap-use-after-free
}
@end

Просмотреть файл

@ -542,8 +542,8 @@ SPEC CHECKSUMS:
boost-for-react-native: 8f7c9ecfe357664c072ffbe2432569667cbf1f1b
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: ed15e075aa758ac0e4c1f8b830bd4e4d40d669e8
FBLazyVector: ebf827c1137d58460e91013ad341f91a57ff2fd8
FBReactNativeSpec: f1236597074fcb9981477abfad7af8f97ea63fd6
FBLazyVector: 11bc87f472827a73ff114494b2e80e0b805a32d7
FBReactNativeSpec: f58c30a99b669cb145e7a8c0c0c721de83951240
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c
@ -557,35 +557,35 @@ SPEC CHECKSUMS:
glog: 42c4bf47024808486e90b25ea9e5ac3959047641
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: 43adc9ce880eb76792f88c011773cb5c664c1419
RCTRequired: 70d6e44fd49b73a356ace7fff03ebd6a6055a794
RCTTypeSafety: 853cc09650317f266858fe64a49adfade5bdb507
React: 2f28a8887149351ae6c3d5ad99e81b7fbc3cd3a0
React-callinvoker: 32aac90d294beacf1b87a557281683979ced1b2e
React-Core: 056be4275ad4304b50962d6b1a502559083caf33
React-CoreModules: 4d907f698dc3174a1ec7af7651a8feb75d03bf01
React-cxxreact: a5b4f5c5f2cf058db8008093524e90adba16206f
React-jsi: 6b41823090b72f585e7ef1145edb0466eafe86e8
React-jsiexecutor: 6dee4b37eb64deb7a097d3f3f69d524855e5e017
React-jsinspector: d3a00e805958a9573a635f6fe131c27e0facc08c
React-logger: 2985e43d81170e89d8c0e3d7d9ae89e3e15a0862
React-perflogger: 45719a6d33b673135604f4910d61a1c4174aba79
React-RCTActionSheet: 4f70b3466af85f80b1047849db4266ca9c1c8a90
React-RCTAnimation: 8c1e372a3b726e0fce6585be11b79f73a7752720
React-RCTBlob: ace846e33dbe865f95255dc170342aa92760f618
React-RCTImage: 3c9592dd1a890524d4e01d2bd521c5f8cb59b3b0
React-RCTLinking: e2ffc806b5fbab75c5954361f9596c0f97c31efc
React-RCTNetwork: 7ac78536ca124d22f7dd93287b411c8a03835a91
React-RCTPushNotification: 032269ce39273b745723188b2173a47c32ed265b
React-RCTSettings: a7ae59ca4bc6c095cc77111964b5b48439f0e1f4
React-RCTTest: 63650a03894db33e06a9847ee08b71d14f6743b1
React-RCTText: a1a62bb79c18818ac340e3929b64a7741769b317
React-RCTVibration: 0252fc1d2e4d7487f24a61d0ba420e92c7a3fcc3
React-runtimeexecutor: b43eb92fa9bc1475a67dfd39c6c7f6b973cd0c3d
RCT-Folly: 5c589d0de10e841479ad79352fae591dc0e9533a
RCTRequired: 2eb1355625e25d08081cfe239db7d3874d77d208
RCTTypeSafety: 9f298b5aa98b080b67792676b6243f1ca032520c
React: 3cd3b5138e36d870bfefaf4a9f0e8d4d658cf499
React-callinvoker: bfbb455c76da9a24732560d956a4458057bb1021
React-Core: 160b28e71f337fa24c27937cecbeebce7af1693f
React-CoreModules: 38f6c3f85421cbbe43f26fb7eec281269f502fe1
React-cxxreact: c72a2ce5d5fa068fe72130d2530caeb8cf6e6790
React-jsi: c6a502974929a68d0c706dec909de949d3a184cf
React-jsiexecutor: 6194311bab350a51c265c42424ce3377b58e776b
React-jsinspector: 98a8edfdf1a77275d1e1ad8832ed2ca6ebe4ea61
React-logger: 745a29a1f97e1725bab7888b8d501dda06b7f485
React-perflogger: 3dcb37ac059350488c74211912731f88d4207b9a
React-RCTActionSheet: aca58af0c729d4d70e2e25565fbd6f6322b18764
React-RCTAnimation: 18e68a8ba438155cefe4b3fb91450492036aca48
React-RCTBlob: ee8067d9c6af4557a9bde315e91bac756498e91c
React-RCTImage: a4167a4967505eaa04a82f5b9573065c30ecf69e
React-RCTLinking: d9034395129c1e4d9c7e60c9deb5b987daf79554
React-RCTNetwork: 80bfb1e3f3498c067293e709a78ad07355a5b05c
React-RCTPushNotification: 899e34163eb7e632fa5164f2c1a2b8e7fb02e7a3
React-RCTSettings: 8049c8ffdd76393479d731ab350d6fd0550a7549
React-RCTTest: c2d9a4516b734322e8df43d192cc3db97d58b092
React-RCTText: 9f435bd5c5f631bf791bf60e501780192ec376af
React-RCTVibration: ed1e5e188b6ed93739d39bc23a20aa87d7eb47f0
React-runtimeexecutor: c433f9ba42e6bcc0bd5e42d2710538f3591edc02
React-TurboModuleCxx-RNW: f2e32cbfced49190a61d66c993a8975de79a158a
React-TurboModuleCxx-WinRTPort: 33943de08957f524b0b24f1e7466fee879807ae6
ReactCommon: d849454f42b3b5a84b064426940477cd6cfd6678
Yoga: b5ccb900d6ff873c37ad1b40d4d9f68bde5e685d
React-TurboModuleCxx-WinRTPort: 523c514e00e9136f0d048fdce302e976e24357f1
ReactCommon: 57264a0de7cd051c3495c78775056e8582988388
Yoga: a4c667843470ecfe7ed3a1bc546889f4730534c7
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: c7a7110b242497f2bf323ba74caedb9ee61ee05e

Просмотреть файл

@ -73,6 +73,12 @@
9F15345F233AB2C4006DFE44 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9F15345E233AB2C4006DFE44 /* AppDelegate.mm */; };
9F153461233AB2C7006DFE44 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9F153460233AB2C7006DFE44 /* Assets.xcassets */; };
9F153467233AB2C7006DFE44 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F153466233AB2C7006DFE44 /* main.m */; };
9F29408627A99ACE00AB150A /* Debug-iOS.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */; };
9F29408727A99ACE00AB150A /* Debug-iOS.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */; };
9F29408827A99ACF00AB150A /* Debug-iOS.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */; };
9F29408927A99AD000AB150A /* Debug-iOS.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */; };
9F29408A27A99AD300AB150A /* Debug-iOS.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */; };
9F29408B27A99AD400AB150A /* Debug-iOS.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */; };
AFC757F10008B167B9DCFD43 /* libPods-iosDeviceBuild.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDE8ED7D8FB17AFA3F66FF96 /* libPods-iosDeviceBuild.a */; };
B2F2040A24E76D7600863BE1 /* ScreenshotMacOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2F2040924E76D7600863BE1 /* ScreenshotMacOS.mm */; };
E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; };
@ -228,6 +234,18 @@
9F153478233AB2C7006DFE44 /* RNTester-macOSIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RNTester-macOSIntegrationTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
9F15347C233AB2C7006DFE44 /* RNTesterIntegrationTests_macOS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests_macOS.m; sourceTree = "<group>"; };
9F15347E233AB2C7006DFE44 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9F29408327A999D200AB150A /* Debug-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug-iOS.xcconfig"; sourceTree = "<group>"; };
9F44D86927B313CA005F40CC /* Debug-macOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug-macOS.xcconfig"; sourceTree = "<group>"; };
9F44D86E27BDB80C005F40CC /* Debug_UnitTests-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug_UnitTests-iOS.xcconfig"; sourceTree = "<group>"; };
9F44D86F27BDB826005F40CC /* Debug_IntegrationTests-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug_IntegrationTests-iOS.xcconfig"; sourceTree = "<group>"; };
9F44D87027BDB840005F40CC /* Debug-UnitTests-macOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug-UnitTests-macOS.xcconfig"; sourceTree = "<group>"; };
9F44D87127BDB84C005F40CC /* Debug-IntegrationTests-macOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug-IntegrationTests-macOS.xcconfig"; sourceTree = "<group>"; };
9F44D87A27BDFFCD005F40CC /* Release-macOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release-macOS.xcconfig"; sourceTree = "<group>"; };
9F44D87B27BDFFCD005F40CC /* Release-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release-iOS.xcconfig"; sourceTree = "<group>"; };
9F44D87C27BDFFCD005F40CC /* Release-IntegrationTests-macOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release-IntegrationTests-macOS.xcconfig"; sourceTree = "<group>"; };
9F44D87D27BDFFCD005F40CC /* Release-UnitTests-macOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release-UnitTests-macOS.xcconfig"; sourceTree = "<group>"; };
9F44D87E27BDFFCD005F40CC /* Release_UnitTests-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release_UnitTests-iOS.xcconfig"; sourceTree = "<group>"; };
9F44D87F27BDFFCD005F40CC /* Release_IntegrationTests-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release_IntegrationTests-iOS.xcconfig"; sourceTree = "<group>"; };
A3D174930AD75B12F47289E6 /* libPods-RNTester-macOSIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester-macOSIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A84904C6079328ECC03280D1 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AB0102C840930F7AC64C3D36 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -486,6 +504,7 @@
9F15345C233AB2C4006DFE44 /* RNTester-macOS */,
9F153470233AB2C7006DFE44 /* RNTester-macOSUnitTests */,
9F15347B233AB2C7006DFE44 /* RNTester-macOSIntegrationTests */,
9F29408C27A99BC600AB150A /* xcconfig */,
83CBBA001A601CBA00E9B192 /* Products */,
2DE7E7D81FB2A4F3009E225D /* Frameworks */,
E23BD6487B06BD71F1A86914 /* Pods */,
@ -548,6 +567,41 @@
path = "RNTester-macOSIntegrationTests";
sourceTree = "<group>";
};
9F29408C27A99BC600AB150A /* xcconfig */ = {
isa = PBXGroup;
children = (
9F44D87227BDFFA0005F40CC /* Debug */,
9F44D87327BDFFA6005F40CC /* Release */,
);
path = xcconfig;
sourceTree = "<group>";
};
9F44D87227BDFFA0005F40CC /* Debug */ = {
isa = PBXGroup;
children = (
9F29408327A999D200AB150A /* Debug-iOS.xcconfig */,
9F44D86E27BDB80C005F40CC /* Debug_UnitTests-iOS.xcconfig */,
9F44D86F27BDB826005F40CC /* Debug_IntegrationTests-iOS.xcconfig */,
9F44D86927B313CA005F40CC /* Debug-macOS.xcconfig */,
9F44D87027BDB840005F40CC /* Debug-UnitTests-macOS.xcconfig */,
9F44D87127BDB84C005F40CC /* Debug-IntegrationTests-macOS.xcconfig */,
);
path = Debug;
sourceTree = "<group>";
};
9F44D87327BDFFA6005F40CC /* Release */ = {
isa = PBXGroup;
children = (
9F44D87B27BDFFCD005F40CC /* Release-iOS.xcconfig */,
9F44D87E27BDFFCD005F40CC /* Release_UnitTests-iOS.xcconfig */,
9F44D87F27BDFFCD005F40CC /* Release_IntegrationTests-iOS.xcconfig */,
9F44D87A27BDFFCD005F40CC /* Release-macOS.xcconfig */,
9F44D87D27BDFFCD005F40CC /* Release-UnitTests-macOS.xcconfig */,
9F44D87C27BDFFCD005F40CC /* Release-IntegrationTests-macOS.xcconfig */,
);
path = Release;
sourceTree = "<group>";
};
E23BD6487B06BD71F1A86914 /* Pods */ = {
isa = PBXGroup;
children = (
@ -909,6 +963,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F29408B27A99AD400AB150A /* Debug-iOS.xcconfig in Resources */,
2DDEF0101F84BF7B00DBDF73 /* Images.xcassets in Resources */,
8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */,
3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */,
@ -919,6 +974,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F29408A27A99AD300AB150A /* Debug-iOS.xcconfig in Resources */,
5101985B23ADA00B00118BF1 /* legacy_image@2x.png in Resources */,
9F153461233AB2C7006DFE44 /* Assets.xcassets in Resources */,
5101985723AD9EE600118BF1 /* Main.storyboard in Resources */,
@ -929,6 +985,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F29408827A99ACF00AB150A /* Debug-iOS.xcconfig in Resources */,
3811324724550A8F009E988D /* RNTesterUnitTestsBundle.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -937,6 +994,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F29408927A99AD000AB150A /* Debug-iOS.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -944,6 +1002,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F29408627A99ACE00AB150A /* Debug-iOS.xcconfig in Resources */,
E7DB20DA22B2BAA6005AC45F /* RNTesterUnitTestsBundle.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -952,6 +1011,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F29408727A99ACE00AB150A /* Debug-iOS.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1544,7 +1604,7 @@
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */;
baseConfigurationReference = 9F29408327A999D200AB150A /* Debug-iOS.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
@ -1588,7 +1648,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */;
baseConfigurationReference = 9F44D87B27BDFFCD005F40CC /* Release-iOS.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@ -1935,7 +1995,7 @@
};
9F15347F233AB2C7006DFE44 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E9CE1968E72EB97B674E80A4 /* Pods-RNTester-macOS.debug.xcconfig */;
baseConfigurationReference = 9F44D86927B313CA005F40CC /* Debug-macOS.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ANALYZER_NONNULL = YES;
@ -1975,7 +2035,7 @@
};
9F153480233AB2C7006DFE44 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 604873ABF80DC3EE97E87CCF /* Pods-RNTester-macOS.release.xcconfig */;
baseConfigurationReference = 9F44D87A27BDFFCD005F40CC /* Release-macOS.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ANALYZER_NONNULL = YES;
@ -2015,7 +2075,7 @@
};
9F153481233AB2C7006DFE44 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 87D5D06CD6060D32601A10DD /* Pods-RNTester-macOSUnitTests.debug.xcconfig */;
baseConfigurationReference = 9F44D87027BDB840005F40CC /* Debug-UnitTests-macOS.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2051,7 +2111,7 @@
};
9F153482233AB2C7006DFE44 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 821937C864FDA0F3C485B4A6 /* Pods-RNTester-macOSUnitTests.release.xcconfig */;
baseConfigurationReference = 9F44D87D27BDFFCD005F40CC /* Release-UnitTests-macOS.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2087,7 +2147,7 @@
};
9F153483233AB2C7006DFE44 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AFC451B51B7D6F0C1CAD0C18 /* Pods-RNTester-macOSIntegrationTests.debug.xcconfig */;
baseConfigurationReference = 9F44D87127BDB84C005F40CC /* Debug-IntegrationTests-macOS.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2125,7 +2185,7 @@
};
9F153484233AB2C7006DFE44 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 27E7277560D64734B4F0E7D9 /* Pods-RNTester-macOSIntegrationTests.release.xcconfig */;
baseConfigurationReference = 9F44D87C27BDFFCD005F40CC /* Release-IntegrationTests-macOS.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2158,7 +2218,7 @@
};
E7DB20A722B2BA84005AC45F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */;
baseConfigurationReference = 9F44D86E27BDB80C005F40CC /* Debug_UnitTests-iOS.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2194,7 +2254,7 @@
};
E7DB20A822B2BA84005AC45F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */;
baseConfigurationReference = 9F44D87E27BDFFCD005F40CC /* Release_UnitTests-iOS.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2230,7 +2290,7 @@
};
E7DB215B22B2F332005AC45F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */;
baseConfigurationReference = 9F44D86F27BDB826005F40CC /* Debug_IntegrationTests-iOS.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
@ -2268,7 +2328,7 @@
};
E7DB215C22B2F332005AC45F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */;
baseConfigurationReference = 9F44D87F27BDFFCD005F40CC /* Release_IntegrationTests-iOS.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;

Просмотреть файл

@ -40,7 +40,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO">
shouldUseLaunchSchemeArgsEnv = "NO"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"

Просмотреть файл

@ -26,7 +26,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO">
shouldUseLaunchSchemeArgsEnv = "NO"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@ -70,6 +72,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

Просмотреть файл

@ -26,7 +26,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO">
shouldUseLaunchSchemeArgsEnv = "NO"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@ -65,6 +67,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

Просмотреть файл

@ -40,7 +40,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@ -89,6 +91,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

Просмотреть файл

@ -0,0 +1,37 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
*/
import type {Node} from 'React';
import {NativeModules, Button} from 'react-native';
import React from 'react';
const {ASANCrash} = NativeModules;
exports.displayName = (undefined: ?string);
exports.framework = 'React';
exports.title = 'ASAN Crash';
exports.category = 'Basic';
exports.description = 'ASAN Crash examples.';
exports.examples = [
{
title: 'Native Address Sanitizer crash',
render(): Node {
return (
<Button
title="Native Address Sanitizer crash"
onPress={() => {
ASANCrash.invokeMemoryCrash();
}}
/>
);
},
},
];

Просмотреть файл

@ -293,6 +293,11 @@ const APIs: Array<RNTesterModuleInfo> = [
module: require('../examples/Crash/CrashExample'),
supportsTVOS: false,
},
{
key: 'ASANCrashExample',
module: require('../examples/ASAN/ASANCrashExample'),
supportsTVOS: false,
},
{
key: 'DevSettings',
module: require('../examples/DevSettings/DevSettingsExample'),

Просмотреть файл

@ -0,0 +1,8 @@
//
// Debug-IntegrationTests-macOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester-macOSIntegrationTests/Pods-RNTester-macOSIntegrationTests.debug.xcconfig"
ENABLE_ADDRESS_SANITIZER = YES

Просмотреть файл

@ -0,0 +1,8 @@
//
// Debug-UnitTests-macOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester-macOSUnitTests/Pods-RNTester-macOSUnitTests.debug.xcconfig"
ENABLE_ADDRESS_SANITIZER = YES

Просмотреть файл

@ -0,0 +1,8 @@
//
// Debug.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"
ENABLE_ADDRESS_SANITIZER[sdk=iphonesimulator*] = YES

Просмотреть файл

@ -0,0 +1,8 @@
//
// Debug-macOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester-macOS/Pods-RNTester-macOS.debug.xcconfig"
ENABLE_ADDRESS_SANITIZER = YES

Просмотреть файл

@ -0,0 +1,8 @@
//
// Debug_IntegrationTests-iOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"
ENABLE_ADDRESS_SANITIZER[sdk=iphonesimulator*] = YES

Просмотреть файл

@ -0,0 +1,8 @@
//
// Debug_UnitTests-iOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"
ENABLE_ADDRESS_SANITIZER[sdk=iphonesimulator*] = YES

Просмотреть файл

@ -0,0 +1,21 @@
//
// Debug-IntegrationTests-macOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester-macOSIntegrationTests/Pods-RNTester-macOSIntegrationTests.release.xcconfig"
ENABLE_ADDRESS_SANITIZER = NO
RUN_CLANG_STATIC_ANALYZER = YES
CLANG_STATIC_ANALYZER_MODE = deep
// Required security settings for production code (do not override at target/project level, with the possible
// exception of legacy test code)
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES

Просмотреть файл

@ -0,0 +1,21 @@
//
// Debug-UnitTests-macOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester-macOSUnitTests/Pods-RNTester-macOSUnitTests.release.xcconfig"
ENABLE_ADDRESS_SANITIZER = NO
RUN_CLANG_STATIC_ANALYZER = YES
CLANG_STATIC_ANALYZER_MODE = deep
// Required security settings for production code (do not override at target/project level, with the possible
// exception of legacy test code)
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES

Просмотреть файл

@ -0,0 +1,21 @@
//
// Debug.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"
ENABLE_ADDRESS_SANITIZER = NO
RUN_CLANG_STATIC_ANALYZER = YES
CLANG_STATIC_ANALYZER_MODE = deep
// Required security settings for production code (do not override at target/project level, with the possible
// exception of legacy test code)
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES

Просмотреть файл

@ -0,0 +1,21 @@
//
// Debug-macOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTester-macOS/Pods-RNTester-macOS.release.xcconfig"
ENABLE_ADDRESS_SANITIZER = NO
RUN_CLANG_STATIC_ANALYZER = YES
CLANG_STATIC_ANALYZER_MODE[sdk=iphonesimulator*] = deep
// Required security settings for production code (do not override at target/project level, with the possible
// exception of legacy test code)
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_KEYCHAIN_API[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY[sdk=iphonesimulator*] = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK[sdk=iphonesimulator*] = YES

Просмотреть файл

@ -0,0 +1,21 @@
//
// Debug_IntegrationTests-iOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"
ENABLE_ADDRESS_SANITIZER = NO
RUN_CLANG_STATIC_ANALYZER = YES
CLANG_STATIC_ANALYZER_MODE = deep
// Required security settings for production code (do not override at target/project level, with the possible
// exception of legacy test code)
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES

Просмотреть файл

@ -0,0 +1,21 @@
//
// Debug_UnitTests-iOS.xcconfig
// RNTesterPods
//
#include "../../Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"
ENABLE_ADDRESS_SANITIZER = NO
RUN_CLANG_STATIC_ANALYZER = YES
CLANG_STATIC_ANALYZER_MODE = deep
// Required security settings for production code (do not override at target/project level, with the possible
// exception of legacy test code)
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES