Skip to content

Commit

Permalink
Added a multi-target hanging app to test against
Browse files Browse the repository at this point in the history
  • Loading branch information
inket committed Sep 18, 2022
1 parent 63f436c commit af0aa44
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 1 deletion.
16 changes: 16 additions & 0 deletions MacSymbolicatorTests/TestProject/AnotherTarget/HangingClass.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// HangingClass.swift
// AnotherTarget
//

import Foundation

@objc
public class HangingClass: NSObject {
@objc
public static func hang() {
DispatchQueue.global().async {
sleep(3600)
}
}
}
33 changes: 33 additions & 0 deletions MacSymbolicatorTests/TestProject/MultiTargetHangingTest/main.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// main.m
// MultiTargetHangingTest
//

@import Foundation;
#import "AnotherTarget/AnotherTarget-Swift.h"

@interface MyClass: NSObject
@end

@implementation MyClass

- (void)start {
NSLog(@"Multi-target hanging… sample/spindump this process using Activity Monitor");
[HangingClass hang];
[self hangingMethod]; // to stop it from exiting
}

- (void)hangingMethod {
NSLock *lock = [[NSLock alloc] init];
[lock lock];
[lock lock];
}

@end

int main(int argc, const char * argv[]) {
@autoreleasepool {
[[[MyClass alloc] init] start];
}
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
B236464A2617F8E800AB9486 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B23646482617F8E800AB9486 /* Main.storyboard */; };
B236464C2617F8E800AB9486 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B236464B2617F8E800AB9486 /* Assets.xcassets */; };
B236464F2617F8E800AB9486 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B236464D2617F8E800AB9486 /* LaunchScreen.storyboard */; };
B24BB96B28ADC3BF00610CF0 /* HangingClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = B24BB96A28ADC3BF00610CF0 /* HangingClass.swift */; };
B24BB97C28AF17F200610CF0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B24BB97B28AF17F200610CF0 /* main.m */; };
B24BB98028AF1CC500610CF0 /* AnotherTarget.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B23646082617F70A00AB9486 /* AnotherTarget.framework */; };
B24BB98128AF1CC500610CF0 /* AnotherTarget.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B23646082617F70A00AB9486 /* AnotherTarget.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -29,6 +33,13 @@
remoteGlobalIDString = B23646072617F70A00AB9486;
remoteInfo = AnotherTarget;
};
B24BB98228AF1CC500610CF0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B23645C72617F68700AB9486 /* Project object */;
proxyType = 1;
remoteGlobalIDString = B23646072617F70A00AB9486;
remoteInfo = AnotherTarget;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -79,6 +90,26 @@
);
runOnlyForDeploymentPostprocessing = 1;
};
B24BB97728AF17F200610CF0 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
B24BB98428AF1CC500610CF0 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
B24BB98128AF1CC500610CF0 /* AnotherTarget.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
Expand All @@ -100,6 +131,9 @@
B236464B2617F8E800AB9486 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
B236464E2617F8E800AB9486 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
B23646502617F8E800AB9486 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B24BB96A28ADC3BF00610CF0 /* HangingClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HangingClass.swift; sourceTree = "<group>"; };
B24BB97928AF17F200610CF0 /* MultiTargetHangingTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MultiTargetHangingTest; sourceTree = BUILT_PRODUCTS_DIR; };
B24BB97B28AF17F200610CF0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -146,6 +180,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
B24BB97628AF17F200610CF0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B24BB98028AF1CC500610CF0 /* AnotherTarget.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand All @@ -158,6 +200,7 @@
B23645ED2617F6C600AB9486 /* SingleThreadHangingTest */,
B236462D2617F81A00AB9486 /* MultiThreadHangingTest */,
B23646412617F8E800AB9486 /* iOSCrashingTest */,
B24BB97A28AF17F200610CF0 /* MultiTargetHangingTest */,
B23645D02617F68700AB9486 /* Products */,
B23646142617F71000AB9486 /* Frameworks */,
);
Expand All @@ -172,6 +215,7 @@
B23646082617F70A00AB9486 /* AnotherTarget.framework */,
B236462C2617F81A00AB9486 /* MultiThreadHangingTest */,
B23646402617F8E700AB9486 /* iOSCrashingTest.app */,
B24BB97928AF17F200610CF0 /* MultiTargetHangingTest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -206,6 +250,7 @@
B236460A2617F70A00AB9486 /* AnotherTarget.h */,
B236460B2617F70A00AB9486 /* Info.plist */,
B236461D2617F7CA00AB9486 /* CrashingClass.swift */,
B24BB96A28ADC3BF00610CF0 /* HangingClass.swift */,
);
path = AnotherTarget;
sourceTree = "<group>";
Expand Down Expand Up @@ -237,6 +282,14 @@
path = iOSCrashingTest;
sourceTree = "<group>";
};
B24BB97A28AF17F200610CF0 /* MultiTargetHangingTest */ = {
isa = PBXGroup;
children = (
B24BB97B28AF17F200610CF0 /* main.m */,
);
path = MultiTargetHangingTest;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -356,13 +409,32 @@
productReference = B23646402617F8E700AB9486 /* iOSCrashingTest.app */;
productType = "com.apple.product-type.application";
};
B24BB97828AF17F200610CF0 /* MultiTargetHangingTest */ = {
isa = PBXNativeTarget;
buildConfigurationList = B24BB97D28AF17F200610CF0 /* Build configuration list for PBXNativeTarget "MultiTargetHangingTest" */;
buildPhases = (
B24BB97528AF17F200610CF0 /* Sources */,
B24BB97628AF17F200610CF0 /* Frameworks */,
B24BB97728AF17F200610CF0 /* CopyFiles */,
B24BB98428AF1CC500610CF0 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
B24BB98328AF1CC500610CF0 /* PBXTargetDependency */,
);
name = MultiTargetHangingTest;
productName = MultiTargetHangingTest;
productReference = B24BB97928AF17F200610CF0 /* MultiTargetHangingTest */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
B23645C72617F68700AB9486 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1230;
LastSwiftUpdateCheck = 1340;
LastUpgradeCheck = 1230;
TargetAttributes = {
B23645DF2617F6BA00AB9486 = {
Expand All @@ -384,6 +456,9 @@
B236463F2617F8E700AB9486 = {
CreatedOnToolsVersion = 12.3;
};
B24BB97828AF17F200610CF0 = {
CreatedOnToolsVersion = 13.4.1;
};
};
};
buildConfigurationList = B23645CA2617F68700AB9486 /* Build configuration list for PBXProject "TestProject" */;
Expand All @@ -404,6 +479,7 @@
B23645F82617F6F800AB9486 /* CrashingInAnotherTargetTest */,
B23646072617F70A00AB9486 /* AnotherTarget */,
B236462B2617F81A00AB9486 /* MultiThreadHangingTest */,
B24BB97828AF17F200610CF0 /* MultiTargetHangingTest */,
B236463F2617F8E700AB9486 /* iOSCrashingTest */,
);
};
Expand Down Expand Up @@ -459,6 +535,7 @@
buildActionMask = 2147483647;
files = (
B236461E2617F7CA00AB9486 /* CrashingClass.swift in Sources */,
B24BB96B28ADC3BF00610CF0 /* HangingClass.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -478,6 +555,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
B24BB97528AF17F200610CF0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B24BB97C28AF17F200610CF0 /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
Expand All @@ -486,6 +571,11 @@
target = B23646072617F70A00AB9486 /* AnotherTarget */;
targetProxy = B23646172617F71000AB9486 /* PBXContainerItemProxy */;
};
B24BB98328AF1CC500610CF0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = B23646072617F70A00AB9486 /* AnotherTarget */;
targetProxy = B24BB98228AF1CC500610CF0 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down Expand Up @@ -810,6 +900,34 @@
};
name = Release;
};
B24BB97E28AF17F200610CF0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = PP5UYHJQCD;
ENABLE_HARDENED_RUNTIME = YES;
LD_RUNPATH_SEARCH_PATHS = "@executable_path";
MACOSX_DEPLOYMENT_TARGET = 12.3;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
B24BB97F28AF17F200610CF0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = PP5UYHJQCD;
ENABLE_HARDENED_RUNTIME = YES;
LD_RUNPATH_SEARCH_PATHS = "@executable_path";
MACOSX_DEPLOYMENT_TARGET = 12.3;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -876,6 +994,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
B24BB97D28AF17F200610CF0 /* Build configuration list for PBXNativeTarget "MultiTargetHangingTest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B24BB97E28AF17F200610CF0 /* Debug */,
B24BB97F28AF17F200610CF0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = B23645C72617F68700AB9486 /* Project object */;
Expand Down

0 comments on commit af0aa44

Please sign in to comment.