Xcode Static Analyzer

RSS for tag

The Xcode Clang Static Analyzer finds bugs in Objective-C, C, and C++ code. It finds hard-to-produce, edge-case bugs without the need to run code and shows the sequence of steps along which the bug occurs.

Posts under Xcode Static Analyzer tag

60 Posts

Post

Replies

Boosts

Views

Activity

Compilation netcdf-cxx4-4.3.1 on Monterey V. 12.0.1
Hi, O ma trying to complile the netcdf-cxx4-4.3.1 on my Monterey. I have the error message as follows: g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT ncAtt.lo -MD -MP -MF .deps/ncAtt.Tpo -c ncAtt.cpp -fno-common -DPIC -o .libs/ncAtt.o In file included from ncAtt.cpp:1: In file included from ./ncAtt.h:1: In file included from ./ncType.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:519: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:21: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37: ../version:1:1: error: expected external declaration -n 4.3.1 What is it? Xcode Version 1: 3.4.1 (13F100) clang version: 13.1.6 (clang-1316.0.21.2.5)
0
1
723
Sep ’23
Compilation netcdf-cxx4-4.3.1 on Monterey V. 12.0.1
Hi, I am trying to compile the netcdf-cxx4-4.3.1 on my Monterey. I have the error message as follows: g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT ncAtt.lo -MD -MP -MF .deps/ncAtt.Tpo -c ncAtt.cpp -fno-common -DPIC -o .libs/ncAtt.o In file included from ncAtt.cpp:1: In file included from ./ncAtt.h:1: In file included from ./ncType.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:519: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:21: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37: ../version:1:1: error: expected external declaration -n 4.3.1 What is it? Xcode Version 1: 3.4.1 (13F100) clang version: 13.1.6 (clang-1316.0.21.2.5)
0
0
690
Sep ’23
≠ Filters in Issues Navigator documentation?
When viewing issues in the Issues Navigator, one can type text in the Filter field which seems to be interpreted as a file name pattern. The blue popup to the left also has pre-created options for “Issue Kind” and “≠Depreciation.” Is there documentation for how to create similar negative filters? I’m building a fork of LLVM, and would like to ignore some large classes of issues in the upstream code, e.g. implicit conversions. The local help for the Navigator Area, https://developer.apple.com/documentation/xcode/diagnosing-memory-thread-and-crash-issues-early, and https://developer.apple.com/documentation/xcode/build-system doesn’t seem to have anything relevant. Searching for “"Issues Navigator"” (in quotation marks) in the Forums is badly broken; the results are largely irrelevant, and seem identical to searching without the quotation marks. Searching in the web documentation returns no results.
2
0
1.2k
Aug ’23
XCode can't find SpriteKit?
This seems to be a pretty weird issue. I'm following along with a SpriteKit tutorial, and while I can build my project and run it on my phone, I keep getting this error in the IDE: Cannot load underlying module for SpriteKit It says it cannot load the module but that's weird because SpriteKit should be a native framework that must've been installed with my XCode. It is pretty annoying because XCode is not context-aware, and code completion doesn't work for any object that's derived from SpriteKit. Here's my system info: XCode version: Version 12.0 (12A7209) MacOS version: MacOS Catalina 10.15.7 (19H2) Is this a bug in XCode?
3
0
2.6k
Jun ’23
Xcode 14 update has bugs and my code in c++ is not compiling with memory issues.
Earlier my C++ was working on Xcode 13 versions but when updated to Xcode 14 it is now returning various errors (seems memory errors). The same code is compiling on other platforms such as windows and in online compilers. Error:- 0 0x1029141a0 __assert_rtn + 140 1 0x10279ba8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x10276dd38 mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 3 0x1027d64ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468 4 0x1027d9360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56 5 0x188b381f4 _dispatch_client_callout2 + 20 6 0x188b4b954 _dispatch_apply_invoke + 224 7 0x188b381b4 _dispatch_client_callout + 20 8 0x188b49a04 _dispatch_root_queue_drain + 680 9 0x188b4a104 _dispatch_worker_thread2 + 164 10 0x188cf8324 _pthread_wqthread + 228 A linker snapshot was created at: /tmp/solution-2022-09-14-105028.ld-snapshot ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061. collect2: error: ld returned 1 exit status Code : #include<bits/stdc++.h> using namespace std; #define int long long int #define vi vector<int> #define pii pair<int,int> #define fast() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define all(x) begin(x),end(x) #define rep(x,a,b) for(int x = a;x<(b+1);x++) #define F first #define S second const long long inf = 1e18, mod = 1e9 + 7; int pw(int x, int y, int p = mod) { if (y == 0) return 1; if (y == 1) return x; int res = pw(x, y / 2); if (y & 1) return ((res * res) % p * x) % p; return (res * res) % p; } int nu(vi & suff, int l, int r){ int n = suff.size(); int ans = suff[l] - ((r<n-1)?suff[r+1]:0); int di = pw(10, n-r-1); ans = (ans*pw(di, mod-2))%mod; return ans; } void test_case() { string s; cin>>s; int n = s.size(); int w,m; cin>>w>>m; vi suff(n+1,0); suff[n] = s[n-1]-'0'; for(int i = n-2;i>=0;i--){ suff[i+1] = ((s[i]-'0')*pw(10,n-i-1) + suff[i+2])%mod; } map<int, pii> mp; for(int i = n-w+1;i>0;i--){ int t = nu(suff, i, i+w-1)%9; mp[t] = {i, (mp.count(t)>0?mp[t].F:0)}; } while(m--){ int l,r,k; cin>>l>>r>>k; int ans1 = inf, ans2 = inf; rep(j,0,8){ int l1 = mp[j].F; int v = nu(suff, l, r); int p = (j*v)%9; int x = (k-p+9)%9; int l2 = mp[x].F; if(l2==l1) l2 = mp[x].S; if(l1>0 and l2>0){ if(l1<ans1){ ans1 = l1; ans2 = l2; }else if(l1==ans1){ ans2 = min(ans2, l2); } } } if(ans1<inf and ans2<inf){ cout<<ans1<<" "<<ans2<<endl; } else cout<<"-1 -1"<<endl; } } int32_t main() { fast(); int tt = 1; cin >> tt; for(int i = 1;i<=tt;i++) { // cout<<"Case #"<<i<<": "; test_case(); } return 0; } Give input to code: 5 1003004 4 1 1 2 1 179572007 4 2 2 7 3 2 7 4 111 2 1 2 2 6 0000 1 2 1 4 0 1 4 1 484 1 5 2 2 0 2 3 7 1 2 5 3 3 8 2 2 6
20
3
9.3k
Feb ’23
Link issues with Xcode13 not happening with lower version
When I use Xcode whose version lower than Xcode13, compilation succeeded. But use Xcode 13.2.1 , compilation failed. My project has opencv static library, and objc use them. In Xcode 12.5.1 compile ok, but in Xcode 13.2.1 compile, reports some issue like this: Undefined symbols for architecture arm64: "cv::DescriptorMatcher::match(cv::Mat const&, cv::Mat const&, std::__1::vector<cv::DMatch, std::__1::allocatorcv::DMatch >&, cv::Mat const&) const", referenced from: MXRRecognizeImp::queryImages(cv::Mat, int*, int*, int, bool, int) in MXRRecognizeImpl.o "cv::FeatureDetector::detect(cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat const&) const", referenced from: mxr_detectAndCompute(cv::Ptrcv::Feature2D&, cv::Mat&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat&, int) in MXRRecognizeImpl.o "cv::DescriptorExtractor::compute(cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat&) const", referenced from: mxr_detectAndCompute(cv::Ptrcv::Feature2D&, cv::Mat&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat&, int) in MXRRecognizeImpl.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I had tried many solutions for these undefined symbols issue, even help for google and stackoverflow, but failed yet. Could you help me ?
0
0
947
Jan ’23
Xcode 12 Crash unexpectedly
When compile project on Xcode 12 it Crash and gives error of XCBBuildService quit unexpectedly. This is the Crash Report Process: XCBBuildService [36862] Path: /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/MacOS/XCBBuildService Identifier: XCBBuildService Version: 12.1 (17140) Build Info: XCBuild-17140000000000000~69 (12A7403) Code Type: X86-64 (Native) Parent Process: Xcode [36853] Responsible: Xcode [36853] User ID: 501 Date/Time: 2020-11-10 17:28:57.608 +0500 OS Version: Mac OS X 10.15.7 (19H15) Report Version: 12 Anonymous UUID: 96D84FB1-AE33-8886-99E2-1CEB7C98F15F Sleep/Wake UUID: B518F282-98E3-4189-BA74-293ED19FFF59 Time Awake Since Boot: 40000 seconds Time Since Wake: 9100 seconds System Integrity Protection: enabled Crashed Thread: 14 Dispatch queue: XCBBuildSystem.OperationSystemAdaptor.queue Exception Type: EXCCRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXCCORPSE_NOTIFY Application Specific Information: abort() called
5
0
4.6k
Jun ’22
Xcode autocompletion doesn't show functions from Objective C headers Jump to Definition doesn't work either
I've just fixed very strange bug / error/ undocumented feature on my Xcode conf. When I was running the latest Xcode 13.4.1 and highlight / autocompletion stopped working as I believe since macOS Monterey upgrade (before I ran Xcode 12) since I "fixed" some conf values by running defaults write com.apple.dt.Xcode some keys. Now I fixed It by deleting that edited config and re-running Xcode again and now it shows me autocompletion suggestions and follows headers when I press @@ defaults delete com.apple.dt.Xcode I just prepared this post with the ending: What should I do to make it possible to work? Appreciate for any help (Show live issues is turned on). Since I solved it I leave these words to let anyone who needs it to fix the issue with this mini tutorial. It somehow doesn't affect Swift code. Here's the stripped version of my old broken conf produced by defaults read com.apple.dt.Xcode: { BuildSystemScheduleInherentlyParallelCommandsExclusively = 1; CurrentAlertPreferencesSelection = "Xcode.AlertEvent.BuildStart"; "DTDKCrashLogSortDescriptors4.5" = ( { NSAscending = 0; NSKey = processName; NSSelector = "compare:"; }, { NSAscending = 1; NSKey = type; NSSelector = "compare:"; }, { NSAscending = 0; NSKey = dateTime; NSSelector = "compare:"; } ); DVTTextAutoSuggestCompletions = 1; DVTTextCompletionRecentCompletions = ( NSString ); DVTTextIndentCase = 0; DVTTextIndentTabWidth = 2; DVTTextIndentWidth = 2; DVTTextShowMinimap = 0; DVTTextSoloBraceIndentWidth = 2; DVTTextWrappedLinesIndentWidth = 2; IBAppliesAutoResizingRulesWhileResizing = 0; IBDesktopImageCacheVersionKey = "12.4-13F17a"; IBGlobalLastEditorDocumentClassName = IBStoryboardDocument; IBGlobalLastEditorTargetRuntime = "IBCocoaTouchFramework-fifteenAndLater"; IBPreferencesMigrated = 1; IBShowingMinimapStoryboard = 0; IBViewSizeInspectorPreferredRectTypeName = frame; IDEActivityLogShowsAllBuildSteps = 1; IDEActivityLogShowsAnalyzerResults = 1; IDEActivityLogShowsErrors = 1; IDEActivityLogShowsWarnings = 1; "IDEAnalyticsMetricsNotifications.AnalyticsMetricsNotificationsController.lastRefreshAttemptDate" = "2022-06-08 04:27:07 +0000"; IDEAppearance = 0; IDEBuildLocationStyle = Unique; IDECopyFilesToTargetGroup = 0; IDECreateGroupsForFolders = 0; IDEDebugSessionShowDisassemblyWhenDebugging = 0; IDEDisableGitSupportForNewProjects = 1; IDEDisableStateRestoration = 1; IDEDocSearchSelectedReferenceIdentifier = occ; IDEExtensionsBuiltPriorToXcode12 = ( ); IDEFileExtensionDisplayMode = 1; "IDEFileTemplateChooserAssistantSelectedTemplateName_iOS" = "Source/Header File"; "IDEFileTemplateChooserAssistantSelectedTemplateName_macOS" = "Source/Header File"; IDEFileTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; IDEHasConvertedXcode3BuildPrefs = 1; IDEIndexDisable = 1; IDEIndexShowLog = 0; IDEKeyBindingCurrentPreferenceSet = "Default.idekeybindings"; IDEKeyBindingExcludedPreferenceSet = ( Default ); IDELastBreakpointActionClassName = IDESoundBreakpointAction; IDELogNavigatorGroupByKey = 0; IDEMaxParallelTestingWorkersMac = 0; IDEOpenQuicklyPreferSwiftGeneratedInterface = 0; "IDEOpenQuicklyWindowController.width" = 454; IDEProductsViewControllerSourceListSplitPosition = 215; IDEProfileActionSelectedTab = Info; IDEProvisioningTeamManagerLastSelectedTeamID = XXXXXXXXXX; IDEProvisioningTeams = { "my@email.com" = ( { isFreeProvisioningTeam = 1; teamID = XXXXXXXXXX; teamName = "Larry Moore (Personal Team)"; teamType = "Personal Team"; } ); }; IDEShowPrebuildLogs = 0; IDESoundBreakpointActionDefaultNameKey = Pop; IDESourceControlPreferencesVersion = 201; IDESuppressStandardArchitecturesUpgrade = 0; IDESuppressStopExecutionWarning = 1; IDESuppressStopExecutionWarningTarget = "IDESuppressStopExecutionWarningTargetValue_Stop"; IDESwiftPackageAdditionAssistantRecentlyUsedPackages = ( ); IDESwiftPackageCollectionsAddedDefaultCollectionsDVTToolsVersion = "Xcode 13.3.1"; IDETestActionSelectedTab = Info; IDETouchBarSimulatorIsVisible = 0; IDEUserWantsToEnableDeveloperSystemPolicyMode = 0; LastProcessNameAttachedTo = Riot; NSColorPanelMode = 1; NSColorPickerPreferredRGBEntryMode = 2; NSColorPickerSlidersDefaults = 1; NSNavPanelExpandedStateForSaveMode = 1; PBXNumberOfParallelBuildSubtasks = 10; PMPrintingExpandedStateForPrint2 = 0; PegasusMultipleCursorsEnabled = 1; ShowBuildOperationDuration = 1; Xcode3BuildSettingsEditorDisplayMode = 0; Xcode3BuildSettingsEditorMode = 0; Xcode3ProjectEditorSourceListVisible = 1; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/App"; Xcode3ProjectTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.iphoneos"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/Command Line Tool"; Xcode3TargetTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; } The only suspicious key is DVTTextAutoSuggestCompletions = 1; in this old config that might have stopped autocompletion.
2
0
2.0k
Jun ’22
section __TEXT/__const address out of range for architecture x86_64
I got this error building PyTorch 1.12 on OS X Monterey 12.4, XCode 13.4 in the linker: ld: in lib/libnnpack.a(conv1x1.py.o), section __TEXT/__const address out of range for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) % clang --version Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: x86_64-apple-darwin21.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin % lipo -info ./build/lib/*.a Non-fat file: ./build/lib/libXNNPACK.a is architecture: x86_64 Non-fat file: ./build/lib/libasmjit.a is architecture: x86_64 Non-fat file: ./build/lib/libbenchmark.a is architecture: x86_64 Non-fat file: ./build/lib/libbenchmark_main.a is architecture: x86_64 Non-fat file: ./build/lib/libcaffe2_protos.a is architecture: x86_64 Non-fat file: ./build/lib/libclog.a is architecture: x86_64 Non-fat file: ./build/lib/libcpuinfo.a is architecture: x86_64 Non-fat file: ./build/lib/libcpuinfo_internals.a is architecture: x86_64 Non-fat file: ./build/lib/libdnnl.a is architecture: x86_64 Non-fat file: ./build/lib/libfbgemm.a is architecture: x86_64 Non-fat file: ./build/lib/libfmt.a is architecture: x86_64 Non-fat file: ./build/lib/libfoxi_loader.a is architecture: x86_64 Non-fat file: ./build/lib/libgmock.a is architecture: x86_64 Non-fat file: ./build/lib/libgmock_main.a is architecture: x86_64 Non-fat file: ./build/lib/libgtest.a is architecture: x86_64 Non-fat file: ./build/lib/libgtest_main.a is architecture: x86_64 Non-fat file: ./build/lib/libkineto.a is architecture: x86_64 Non-fat file: ./build/lib/libnnpack.a is architecture: x86_64 Non-fat file: ./build/lib/libnnpack_reference_layers.a is architecture: x86_64 Non-fat file: ./build/lib/libonnx.a is architecture: x86_64 Non-fat file: ./build/lib/libonnx_proto.a is architecture: x86_64 Non-fat file: ./build/lib/libprotobuf-lite.a is architecture: x86_64 Non-fat file: ./build/lib/libprotobuf.a is architecture: x86_64 Non-fat file: ./build/lib/libprotoc.a is architecture: x86_64 Non-fat file: ./build/lib/libpthreadpool.a is architecture: x86_64 Non-fat file: ./build/lib/libpytorch_qnnpack.a is architecture: x86_64 Non-fat file: ./build/lib/libqnnpack.a is architecture: x86_64 (base) davidlaxer@x86_64-apple-darwin13 pytorch linkText linkText Any suggestions?
0
0
1.7k
May ’22
g++ version not updated after command line tools installation
Hello, I want use PyMC3 on my computer. I need g++ for that, which is installed via command line tools. I have command line tools installed together with xcode, but when I run my code, g++ headers are not found and I'm prompted to install g++ with command line tools. I redo the installation and when I re-run my code, I get the same message. Also when I do g++ --version I get the following message: ebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@" cannot be located. g++: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@' (errno=No such file or directory) g++: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@ -find g++ 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory) xcode-select: Failed to locate 'g++', requesting installation of command line developer tools. Another thing is that, the version of SKD in my directory is, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk@. But g++ is looking for MacOSX11.3.sdk@. How can I fix this problem? I currently have OS monterey 12.0.1.
0
0
1.1k
Apr ’22
What the differences of Option "Page In" and Option "File Backed Page In" in xCode Instrument?
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results. I did the test to open a file in 1KB size. The analysis results from xCode Instruments is as followings: In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached) In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png &amp; P3.png attached) That is, Size of "File Backed Page In" is around 4*16K=64KB. I did similar tests on different size of files. Every time the values of "Disk Usage"-&gt;"Page In" and "Virtual Memory Trace"-&gt;"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB). I think that both values represent disk IO size of the process and they should be in the same value for the same process. Why the values are different? What are the differences between this two options in xCode Instrument tool? Thanks.
0
0
810
Feb ’22
Meaning of "Page In" in xCode Instruments
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results. I did the test to open a file in 1KB size. The analysis results from xCode Instruments is as followings: In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached) In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png & P3.png attached) That is, Size of "File Backed Page In" is around 4*16K=64KB. I did similar tests on different size of files. Every time the values of "Disk Usage"->"Page In" and "Virtual Memory Trace"->"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB). I think that both values represent disk IO size of the process and they should be in the same value for the same process. Why the values are different? What are the differences between this two options in xCode Instrument tool? Thanks a lot.
0
1
1.1k
Feb ’22
Compilation netcdf-cxx4-4.3.1 on Monterey V. 12.0.1
Hi, O ma trying to complile the netcdf-cxx4-4.3.1 on my Monterey. I have the error message as follows: g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT ncAtt.lo -MD -MP -MF .deps/ncAtt.Tpo -c ncAtt.cpp -fno-common -DPIC -o .libs/ncAtt.o In file included from ncAtt.cpp:1: In file included from ./ncAtt.h:1: In file included from ./ncType.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:519: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:21: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37: ../version:1:1: error: expected external declaration -n 4.3.1 What is it? Xcode Version 1: 3.4.1 (13F100) clang version: 13.1.6 (clang-1316.0.21.2.5)
Replies
0
Boosts
1
Views
723
Activity
Sep ’23
Compilation netcdf-cxx4-4.3.1 on Monterey V. 12.0.1
Hi, I am trying to compile the netcdf-cxx4-4.3.1 on my Monterey. I have the error message as follows: g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT ncAtt.lo -MD -MP -MF .deps/ncAtt.Tpo -c ncAtt.cpp -fno-common -DPIC -o .libs/ncAtt.o In file included from ncAtt.cpp:1: In file included from ./ncAtt.h:1: In file included from ./ncType.h:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:519: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:21: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37: ../version:1:1: error: expected external declaration -n 4.3.1 What is it? Xcode Version 1: 3.4.1 (13F100) clang version: 13.1.6 (clang-1316.0.21.2.5)
Replies
0
Boosts
0
Views
690
Activity
Sep ’23
≠ Filters in Issues Navigator documentation?
When viewing issues in the Issues Navigator, one can type text in the Filter field which seems to be interpreted as a file name pattern. The blue popup to the left also has pre-created options for “Issue Kind” and “≠Depreciation.” Is there documentation for how to create similar negative filters? I’m building a fork of LLVM, and would like to ignore some large classes of issues in the upstream code, e.g. implicit conversions. The local help for the Navigator Area, https://developer.apple.com/documentation/xcode/diagnosing-memory-thread-and-crash-issues-early, and https://developer.apple.com/documentation/xcode/build-system doesn’t seem to have anything relevant. Searching for “"Issues Navigator"” (in quotation marks) in the Forums is badly broken; the results are largely irrelevant, and seem identical to searching without the quotation marks. Searching in the web documentation returns no results.
Replies
2
Boosts
0
Views
1.2k
Activity
Aug ’23
(iOS 17 Public Beta)UIButton with XIB drag is unavailable and freezes the app
The first time I used Xcode to run the app, it could run, but when I clicked the icon of the icon to run it, it got stuck. I found that when I deleted the UIButton that was dragged by XIB, I could start the app, but the button would freeze when clicked.
Replies
0
Boosts
0
Views
908
Activity
Jul ’23
clang-tidy vs. Xcode Static Analyzer
Does anyone know the relationship, if any, between Xcode's static analyzer and clang-tidy? I.e. is Xcode's Analyze feature actually invoking a built-in clang-tidy? If not, does anyone have any experience using upstream clang-tidy (homebrew?) with a mostly-Xcode development flow?
Replies
1
Boosts
0
Views
2.5k
Activity
Jun ’23
XCode can't find SpriteKit?
This seems to be a pretty weird issue. I'm following along with a SpriteKit tutorial, and while I can build my project and run it on my phone, I keep getting this error in the IDE: Cannot load underlying module for SpriteKit It says it cannot load the module but that's weird because SpriteKit should be a native framework that must've been installed with my XCode. It is pretty annoying because XCode is not context-aware, and code completion doesn't work for any object that's derived from SpriteKit. Here's my system info: XCode version: Version 12.0 (12A7209) MacOS version: MacOS Catalina 10.15.7 (19H2) Is this a bug in XCode?
Replies
3
Boosts
0
Views
2.6k
Activity
Jun ’23
'GCDWebServer/GCDWebServer.h' file not found
'GCDWebServer/GCDWebServer.h' file not found How to fix it?
Replies
0
Boosts
1
Views
1k
Activity
Apr ’23
Xcode 14 update has bugs and my code in c++ is not compiling with memory issues.
Earlier my C++ was working on Xcode 13 versions but when updated to Xcode 14 it is now returning various errors (seems memory errors). The same code is compiling on other platforms such as windows and in online compilers. Error:- 0 0x1029141a0 __assert_rtn + 140 1 0x10279ba8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x10276dd38 mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 3 0x1027d64ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468 4 0x1027d9360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56 5 0x188b381f4 _dispatch_client_callout2 + 20 6 0x188b4b954 _dispatch_apply_invoke + 224 7 0x188b381b4 _dispatch_client_callout + 20 8 0x188b49a04 _dispatch_root_queue_drain + 680 9 0x188b4a104 _dispatch_worker_thread2 + 164 10 0x188cf8324 _pthread_wqthread + 228 A linker snapshot was created at: /tmp/solution-2022-09-14-105028.ld-snapshot ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061. collect2: error: ld returned 1 exit status Code : #include<bits/stdc++.h> using namespace std; #define int long long int #define vi vector<int> #define pii pair<int,int> #define fast() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define all(x) begin(x),end(x) #define rep(x,a,b) for(int x = a;x<(b+1);x++) #define F first #define S second const long long inf = 1e18, mod = 1e9 + 7; int pw(int x, int y, int p = mod) { if (y == 0) return 1; if (y == 1) return x; int res = pw(x, y / 2); if (y & 1) return ((res * res) % p * x) % p; return (res * res) % p; } int nu(vi & suff, int l, int r){ int n = suff.size(); int ans = suff[l] - ((r<n-1)?suff[r+1]:0); int di = pw(10, n-r-1); ans = (ans*pw(di, mod-2))%mod; return ans; } void test_case() { string s; cin>>s; int n = s.size(); int w,m; cin>>w>>m; vi suff(n+1,0); suff[n] = s[n-1]-'0'; for(int i = n-2;i>=0;i--){ suff[i+1] = ((s[i]-'0')*pw(10,n-i-1) + suff[i+2])%mod; } map<int, pii> mp; for(int i = n-w+1;i>0;i--){ int t = nu(suff, i, i+w-1)%9; mp[t] = {i, (mp.count(t)>0?mp[t].F:0)}; } while(m--){ int l,r,k; cin>>l>>r>>k; int ans1 = inf, ans2 = inf; rep(j,0,8){ int l1 = mp[j].F; int v = nu(suff, l, r); int p = (j*v)%9; int x = (k-p+9)%9; int l2 = mp[x].F; if(l2==l1) l2 = mp[x].S; if(l1>0 and l2>0){ if(l1<ans1){ ans1 = l1; ans2 = l2; }else if(l1==ans1){ ans2 = min(ans2, l2); } } } if(ans1<inf and ans2<inf){ cout<<ans1<<" "<<ans2<<endl; } else cout<<"-1 -1"<<endl; } } int32_t main() { fast(); int tt = 1; cin >> tt; for(int i = 1;i<=tt;i++) { // cout<<"Case #"<<i<<": "; test_case(); } return 0; } Give input to code: 5 1003004 4 1 1 2 1 179572007 4 2 2 7 3 2 7 4 111 2 1 2 2 6 0000 1 2 1 4 0 1 4 1 484 1 5 2 2 0 2 3 7 1 2 5 3 3 8 2 2 6
Replies
20
Boosts
3
Views
9.3k
Activity
Feb ’23
Error while compiling in VS Code but not in Xcode
Hi, I am a student and I keep switching between VS Code and Xcode, but now every time I compile a code in VS Code it gives an error --> "clang: error: linker command failed with exit code 1" but the same code can be build successfully in Xcode. How do I fix this error?
Replies
4
Boosts
1
Views
3.5k
Activity
Jan ’23
Fix This Issues
Does someone knows how to fix this issues?
Replies
4
Boosts
0
Views
1.9k
Activity
Jan ’23
Link issues with Xcode13 not happening with lower version
When I use Xcode whose version lower than Xcode13, compilation succeeded. But use Xcode 13.2.1 , compilation failed. My project has opencv static library, and objc use them. In Xcode 12.5.1 compile ok, but in Xcode 13.2.1 compile, reports some issue like this: Undefined symbols for architecture arm64: "cv::DescriptorMatcher::match(cv::Mat const&, cv::Mat const&, std::__1::vector<cv::DMatch, std::__1::allocatorcv::DMatch >&, cv::Mat const&) const", referenced from: MXRRecognizeImp::queryImages(cv::Mat, int*, int*, int, bool, int) in MXRRecognizeImpl.o "cv::FeatureDetector::detect(cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat const&) const", referenced from: mxr_detectAndCompute(cv::Ptrcv::Feature2D&, cv::Mat&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat&, int) in MXRRecognizeImpl.o "cv::DescriptorExtractor::compute(cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat&) const", referenced from: mxr_detectAndCompute(cv::Ptrcv::Feature2D&, cv::Mat&, std::__1::vector<cv::KeyPoint, std::__1::allocatorcv::KeyPoint >&, cv::Mat&, int) in MXRRecognizeImpl.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I had tried many solutions for these undefined symbols issue, even help for google and stackoverflow, but failed yet. Could you help me ?
Replies
0
Boosts
0
Views
947
Activity
Jan ’23
Xcode 12 Crash unexpectedly
When compile project on Xcode 12 it Crash and gives error of XCBBuildService quit unexpectedly. This is the Crash Report Process: XCBBuildService [36862] Path: /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/MacOS/XCBBuildService Identifier: XCBBuildService Version: 12.1 (17140) Build Info: XCBuild-17140000000000000~69 (12A7403) Code Type: X86-64 (Native) Parent Process: Xcode [36853] Responsible: Xcode [36853] User ID: 501 Date/Time: 2020-11-10 17:28:57.608 +0500 OS Version: Mac OS X 10.15.7 (19H15) Report Version: 12 Anonymous UUID: 96D84FB1-AE33-8886-99E2-1CEB7C98F15F Sleep/Wake UUID: B518F282-98E3-4189-BA74-293ED19FFF59 Time Awake Since Boot: 40000 seconds Time Since Wake: 9100 seconds System Integrity Protection: enabled Crashed Thread: 14 Dispatch queue: XCBBuildSystem.OperationSystemAdaptor.queue Exception Type: EXCCRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXCCORPSE_NOTIFY Application Specific Information: abort() called
Replies
5
Boosts
0
Views
4.6k
Activity
Jun ’22
Xcode autocompletion doesn't show functions from Objective C headers Jump to Definition doesn't work either
I've just fixed very strange bug / error/ undocumented feature on my Xcode conf. When I was running the latest Xcode 13.4.1 and highlight / autocompletion stopped working as I believe since macOS Monterey upgrade (before I ran Xcode 12) since I "fixed" some conf values by running defaults write com.apple.dt.Xcode some keys. Now I fixed It by deleting that edited config and re-running Xcode again and now it shows me autocompletion suggestions and follows headers when I press @@ defaults delete com.apple.dt.Xcode I just prepared this post with the ending: What should I do to make it possible to work? Appreciate for any help (Show live issues is turned on). Since I solved it I leave these words to let anyone who needs it to fix the issue with this mini tutorial. It somehow doesn't affect Swift code. Here's the stripped version of my old broken conf produced by defaults read com.apple.dt.Xcode: { BuildSystemScheduleInherentlyParallelCommandsExclusively = 1; CurrentAlertPreferencesSelection = "Xcode.AlertEvent.BuildStart"; "DTDKCrashLogSortDescriptors4.5" = ( { NSAscending = 0; NSKey = processName; NSSelector = "compare:"; }, { NSAscending = 1; NSKey = type; NSSelector = "compare:"; }, { NSAscending = 0; NSKey = dateTime; NSSelector = "compare:"; } ); DVTTextAutoSuggestCompletions = 1; DVTTextCompletionRecentCompletions = ( NSString ); DVTTextIndentCase = 0; DVTTextIndentTabWidth = 2; DVTTextIndentWidth = 2; DVTTextShowMinimap = 0; DVTTextSoloBraceIndentWidth = 2; DVTTextWrappedLinesIndentWidth = 2; IBAppliesAutoResizingRulesWhileResizing = 0; IBDesktopImageCacheVersionKey = "12.4-13F17a"; IBGlobalLastEditorDocumentClassName = IBStoryboardDocument; IBGlobalLastEditorTargetRuntime = "IBCocoaTouchFramework-fifteenAndLater"; IBPreferencesMigrated = 1; IBShowingMinimapStoryboard = 0; IBViewSizeInspectorPreferredRectTypeName = frame; IDEActivityLogShowsAllBuildSteps = 1; IDEActivityLogShowsAnalyzerResults = 1; IDEActivityLogShowsErrors = 1; IDEActivityLogShowsWarnings = 1; "IDEAnalyticsMetricsNotifications.AnalyticsMetricsNotificationsController.lastRefreshAttemptDate" = "2022-06-08 04:27:07 +0000"; IDEAppearance = 0; IDEBuildLocationStyle = Unique; IDECopyFilesToTargetGroup = 0; IDECreateGroupsForFolders = 0; IDEDebugSessionShowDisassemblyWhenDebugging = 0; IDEDisableGitSupportForNewProjects = 1; IDEDisableStateRestoration = 1; IDEDocSearchSelectedReferenceIdentifier = occ; IDEExtensionsBuiltPriorToXcode12 = ( ); IDEFileExtensionDisplayMode = 1; "IDEFileTemplateChooserAssistantSelectedTemplateName_iOS" = "Source/Header File"; "IDEFileTemplateChooserAssistantSelectedTemplateName_macOS" = "Source/Header File"; IDEFileTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; IDEHasConvertedXcode3BuildPrefs = 1; IDEIndexDisable = 1; IDEIndexShowLog = 0; IDEKeyBindingCurrentPreferenceSet = "Default.idekeybindings"; IDEKeyBindingExcludedPreferenceSet = ( Default ); IDELastBreakpointActionClassName = IDESoundBreakpointAction; IDELogNavigatorGroupByKey = 0; IDEMaxParallelTestingWorkersMac = 0; IDEOpenQuicklyPreferSwiftGeneratedInterface = 0; "IDEOpenQuicklyWindowController.width" = 454; IDEProductsViewControllerSourceListSplitPosition = 215; IDEProfileActionSelectedTab = Info; IDEProvisioningTeamManagerLastSelectedTeamID = XXXXXXXXXX; IDEProvisioningTeams = { "my@email.com" = ( { isFreeProvisioningTeam = 1; teamID = XXXXXXXXXX; teamName = "Larry Moore (Personal Team)"; teamType = "Personal Team"; } ); }; IDEShowPrebuildLogs = 0; IDESoundBreakpointActionDefaultNameKey = Pop; IDESourceControlPreferencesVersion = 201; IDESuppressStandardArchitecturesUpgrade = 0; IDESuppressStopExecutionWarning = 1; IDESuppressStopExecutionWarningTarget = "IDESuppressStopExecutionWarningTargetValue_Stop"; IDESwiftPackageAdditionAssistantRecentlyUsedPackages = ( ); IDESwiftPackageCollectionsAddedDefaultCollectionsDVTToolsVersion = "Xcode 13.3.1"; IDETestActionSelectedTab = Info; IDETouchBarSimulatorIsVisible = 0; IDEUserWantsToEnableDeveloperSystemPolicyMode = 0; LastProcessNameAttachedTo = Riot; NSColorPanelMode = 1; NSColorPickerPreferredRGBEntryMode = 2; NSColorPickerSlidersDefaults = 1; NSNavPanelExpandedStateForSaveMode = 1; PBXNumberOfParallelBuildSubtasks = 10; PMPrintingExpandedStateForPrint2 = 0; PegasusMultipleCursorsEnabled = 1; ShowBuildOperationDuration = 1; Xcode3BuildSettingsEditorDisplayMode = 0; Xcode3BuildSettingsEditorMode = 0; Xcode3ProjectEditorSourceListVisible = 1; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/App"; Xcode3ProjectTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.iphoneos"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/Command Line Tool"; Xcode3TargetTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; } The only suspicious key is DVTTextAutoSuggestCompletions = 1; in this old config that might have stopped autocompletion.
Replies
2
Boosts
0
Views
2.0k
Activity
Jun ’22
section __TEXT/__const address out of range for architecture x86_64
I got this error building PyTorch 1.12 on OS X Monterey 12.4, XCode 13.4 in the linker: ld: in lib/libnnpack.a(conv1x1.py.o), section __TEXT/__const address out of range for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) % clang --version Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: x86_64-apple-darwin21.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin % lipo -info ./build/lib/*.a Non-fat file: ./build/lib/libXNNPACK.a is architecture: x86_64 Non-fat file: ./build/lib/libasmjit.a is architecture: x86_64 Non-fat file: ./build/lib/libbenchmark.a is architecture: x86_64 Non-fat file: ./build/lib/libbenchmark_main.a is architecture: x86_64 Non-fat file: ./build/lib/libcaffe2_protos.a is architecture: x86_64 Non-fat file: ./build/lib/libclog.a is architecture: x86_64 Non-fat file: ./build/lib/libcpuinfo.a is architecture: x86_64 Non-fat file: ./build/lib/libcpuinfo_internals.a is architecture: x86_64 Non-fat file: ./build/lib/libdnnl.a is architecture: x86_64 Non-fat file: ./build/lib/libfbgemm.a is architecture: x86_64 Non-fat file: ./build/lib/libfmt.a is architecture: x86_64 Non-fat file: ./build/lib/libfoxi_loader.a is architecture: x86_64 Non-fat file: ./build/lib/libgmock.a is architecture: x86_64 Non-fat file: ./build/lib/libgmock_main.a is architecture: x86_64 Non-fat file: ./build/lib/libgtest.a is architecture: x86_64 Non-fat file: ./build/lib/libgtest_main.a is architecture: x86_64 Non-fat file: ./build/lib/libkineto.a is architecture: x86_64 Non-fat file: ./build/lib/libnnpack.a is architecture: x86_64 Non-fat file: ./build/lib/libnnpack_reference_layers.a is architecture: x86_64 Non-fat file: ./build/lib/libonnx.a is architecture: x86_64 Non-fat file: ./build/lib/libonnx_proto.a is architecture: x86_64 Non-fat file: ./build/lib/libprotobuf-lite.a is architecture: x86_64 Non-fat file: ./build/lib/libprotobuf.a is architecture: x86_64 Non-fat file: ./build/lib/libprotoc.a is architecture: x86_64 Non-fat file: ./build/lib/libpthreadpool.a is architecture: x86_64 Non-fat file: ./build/lib/libpytorch_qnnpack.a is architecture: x86_64 Non-fat file: ./build/lib/libqnnpack.a is architecture: x86_64 (base) davidlaxer@x86_64-apple-darwin13 pytorch linkText linkText Any suggestions?
Replies
0
Boosts
0
Views
1.7k
Activity
May ’22
Xcode - How do I create my own library in xcode?
It's easy in Visual Studio. https://disk.yandex.ru/i/NML0t6lA_cMWhw https://disk.yandex.ru/i/dQ-uwkLKA_eAiQ
Replies
0
Boosts
0
Views
667
Activity
Apr ’22
how do i output system command C++ on xcode
i used dev c++ on windows before this and it works just fine when i use command like this system("color E0"); system("cls"); system("pause"); system("title test"); but in Xcode, when i run it they said the command is not found. may i know how to fix this ? thank you
Replies
1
Boosts
0
Views
1.2k
Activity
Apr ’22
g++ version not updated after command line tools installation
Hello, I want use PyMC3 on my computer. I need g++ for that, which is installed via command line tools. I have command line tools installed together with xcode, but when I run my code, g++ headers are not found and I'm prompted to install g++ with command line tools. I redo the installation and when I re-run my code, I get the same message. Also when I do g++ --version I get the following message: ebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@" cannot be located. g++: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@' (errno=No such file or directory) g++: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@ -find g++ 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory) xcode-select: Failed to locate 'g++', requesting installation of command line developer tools. Another thing is that, the version of SKD in my directory is, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk@. But g++ is looking for MacOSX11.3.sdk@. How can I fix this problem? I currently have OS monterey 12.0.1.
Replies
0
Boosts
0
Views
1.1k
Activity
Apr ’22
Random configuration
Hey guys I am starting to learn coding and I don't know how but I activate something and I don't know to turn it off and everytime I run a program this appears on the screen. Can someone help?
Replies
0
Boosts
0
Views
782
Activity
Feb ’22
What the differences of Option "Page In" and Option "File Backed Page In" in xCode Instrument?
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results. I did the test to open a file in 1KB size. The analysis results from xCode Instruments is as followings: In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached) In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png &amp; P3.png attached) That is, Size of "File Backed Page In" is around 4*16K=64KB. I did similar tests on different size of files. Every time the values of "Disk Usage"-&gt;"Page In" and "Virtual Memory Trace"-&gt;"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB). I think that both values represent disk IO size of the process and they should be in the same value for the same process. Why the values are different? What are the differences between this two options in xCode Instrument tool? Thanks.
Replies
0
Boosts
0
Views
810
Activity
Feb ’22
Meaning of "Page In" in xCode Instruments
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results. I did the test to open a file in 1KB size. The analysis results from xCode Instruments is as followings: In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached) In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png & P3.png attached) That is, Size of "File Backed Page In" is around 4*16K=64KB. I did similar tests on different size of files. Every time the values of "Disk Usage"->"Page In" and "Virtual Memory Trace"->"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB). I think that both values represent disk IO size of the process and they should be in the same value for the same process. Why the values are different? What are the differences between this two options in xCode Instrument tool? Thanks a lot.
Replies
0
Boosts
1
Views
1.1k
Activity
Feb ’22