Code Diagnostics

RSS for tag

Enable runtime checks to detect and avoid bugs in your code using Code Diagnostics.

Posts under Code Diagnostics tag

39 Posts

Post

Replies

Boosts

Views

Activity

Crash Xcode 14 with Swift -> Objective-C framework; AutoreleasingUnsafeMutablePointer; -O Optimize for Speed
I am having a crash with a Swift -> Objective-C interoperability under Xcode 14 / Swift 5.7 but only when Optimize for Speed is part of the build. There was no issue with this under Xcode 13.4.1 / Swift 5.6 under the same conditions. Typically, this compiler option is disabled for Debug builds so this was only detected once we provided release builds to beta users using Test Flight.  The interoperability is with using a proprietary, third-party framework. I am not privy to the Objective-C code that makes up the public API for this framework. As the framework had worked with Xcode 13.4.1 (with and without the speed optimization) and also works in Debug mode with Xcode 14.x (I have tried 14.1 as well) but crashes with the speed optimization turned on, I suspect the optimization may be at fault. But it is hard to say. I am hoping someone with better knowledge than I of this can guide me as to why this is happening…and only now. Here is an example of the code. Note: there are multiple instances of this same pattern in the API. There are vendor supplied structures (as well as NSArray as in this example) that cause similar failure. The vendor has supplied only Objective-C sample code and documentation.     func listItems() {         var availableItems: NSMutableArray? = NSMutableArray()         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } The header file provides: - (ITEM_RESULT) getAvailableItemList:(NSMutableArray**)getAvailableItemList; The derived Swift interface for this is: func getAvailableItemList(_ availableItemsList: AutoreleasingUnsafeMutablePointer<NSMutableArray?>!) -> ITEM_RESULT The crash occurs when calling the API and/or attempting to use the value associated with the AutoreleasingUnsafeMutablePointer. I have turned on all memory management diagnostics for the run phase of the scheme. When I do so, I see the following in the console when I get a fatal Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1d66e8a88) presented in the caller to the listItems() method. *** -[__NSArrayM retain]: message sent to deallocated instance 0x28bd15200 My assumption is that this indicates the memory was released (aggressively?) and so this causes the crash. Again, only with the -O (Optimize for Speed) option is enabled. I have been able to code a potential solution to this issue. Maybe this should have been the solution for prior Swift versions…but I had no reason (as it had worked without issue up until Xcode 14).     func listItems() {         let itemsArray = NSMutableArray()          var availableItems: NSMutableArray? = itemsArray         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } This solution assigns the array to an immutable variable and then assigns that reference to an optional that is passed for the AutoreleasingUnsafeMutablePointer. My assumption is that adds an additional retain to keep the optimization from removing the memory for the array until the itemsArray is no longer referenced. I am reaching out to see if this is a known issue by others and/or expected (but new) behavior as I do not have much experience with AutoreleasingUnsafeMutablePointer. Also, if this is not a bug but is the new normal, is the potential solution the proper way to use the AutoreleasingUnsafeMutablePointer with Objective-C framework APIs? Or should I be doing something different? Thanks for any insight or pointers (even if unsafe).
5
0
2.9k
Nov ’22
Error Cannot find « » in scope XCODE
Hello I made an app and I have this error: Cannot find string in scope I post my code under the message please help me: Photo: ("https://developer.apple.com/forums/content/attachment/3253bf72-d034-475e-a69e-a73f32388f84" "title=Capture d’écran 2022-11-21 à 19.16.00.png;width=2036;height=1380") // //  AuthviewModel.swift //  iSpeak // //  Created by Sayan on 21.11.22. // import Foundation import Firebase class AuthViewModel: ObservableObject {     var manager = FirebaseManager.shared          @Published var isFinishedConnecting: Bool = false     @Published var isAuth: Bool = false     @Published var showError: Bool = false          var errorString: String = ""     var datas: [String: Any] = [:]          var auth: Auth {         return manager.auth     }          init() {         observeAuthentication()     }          func observeAuthentication() {         auth.addStateDidChangeListener(handleChangeListener)     }          func handleChangeListener(auth: Auth, user: User?) {         self.isFinishedConnecting = true         self.isAuth = user != nil     }          func signIn(email: String, password: String) {         guard checkValue(_string: email, value: "adresse email") else { return }         guard checkValue(_string: password, value: "Mot de passe") else { return }              }          func createUser() {              }          func checkValue(_string: String, value: String) -> Bool {       let isNotEmpty = string != "" Error : Cannot find « string » in scope          self.errorString = !isNotEmpty ? "" : "Merci d'entrer (value) pour continuer"         self.showError = !isNotEmpty         return isNotEmpty     } }
1
0
2.3k
Nov ’22
Is git already installed when buying a new Macbook?
Greetings, due to the current situation (Corona-Virus) I had to download Xcode, MS Visual Studio and Visual StudioCode on my personal MacBook Pro (2017; no Touch Bar). These applications were all asking for git (git-scm) and I have accepted. After some regrets I have decided to delete all applications again. I was able to delete Xcode, MS VS and VS Code but there was no program with the name git“, but hundreds of files with a big red „h“ on them, that I have never seen before. I used the function for a secured system restart and at the end I was reinstalling MacOS BigSur. Every time I logged in my entire display was black and my cursor in a neon blue I installed a new MacOS again and now everything seems to be fine (at least no black screen). I used some codes, I got from google, on my terminal (sudo rm -rf /usr/bin/git/), I am afraid that it has done more damage than it was helpful. Any idea how I can reverse the last 24 hours? Summary: Is Git already installed when I buy a new MacBook? If not, how can I delete all unnecessary files? Has „sudo rm -rf /usr/bin/git/„ changed anything? My terminal said that I was having Apple Git 128. After deleting XCodes there seems to be no git $ which git /usr/bin/git $ git --version xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Sorry for all the questions, but I am totally unskilled when it is about using git. Kind Regards,
4
0
17k
Nov ’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.5k
Jun ’22
Receiving this error 'EXC_BREAKPOINT (code=1, subcode=0x1051904b8)' when trying to use a PhotoPicker.
I'm going insane over this, I'm using Xcode 13 beta 6 on the M1 MacBook Air. Every time I pick an image, I receive this error message. At this point I don't know what I can do because the message is so vague. Please help me.     @Binding var image: UIImage          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.delegate = context.coordinator         return imagePicker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {              }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {                   var parent: PhotoPicker                  init(parent: PhotoPicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.originalImage] as? UIImage {                 parent.image = image             }else{                              }             picker.dismiss(animated: true, completion: nil)         }     } }          @State private var isPresented: Bool = false     @State private var avatarImage = UIImage(systemName: "person") ?? UIImage()          var body: some View {         VStack {             Image(uiImage: avatarImage)                 .resizable()                 .scaledToFill()                 .frame(width: 150, height: 150)                 .clipShape(Circle())                 .padding()                 .onTapGesture {                     isPresented = true                 }                          Spacer()         }         .navigationTitle("Profile")         .sheet(isPresented: $isPresented) {             PhotoPicker(image: $avatarImage)         }     } }
4
0
5.7k
May ’22
Failed to produce diagnostic for expression; please submit a bug report
i did " // customslidebar.swift // chatbot // // Created by AndrewLee on 2022/05/04. // import SwiftUI enum Tab: String, CaseIterable {     case house     case message     case person     case gearshape } struct customslidebar: View {   @Binding var selectedTab: Tab   private var fillimage: String {     selectedTab.rawValue + ".fill"   }       var body: some View {     VStack {       HStack {         ForEach(Tab.allCases, id: .rawValue) { tab in           Spacer()           image(systemName: selectedTab == tab ? fillimage : tab.rawValue)           Spacer()                                 }       }       .frame(width: nil, height: 60)       .background(.thinMaterial)       .cornerRadius(10)       .padding()             }   } } struct customslidebar_Previews: PreviewProvider {   static var previews: some View {     customslidebar(selectedTab: .constant(.house))   } } this but it says Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
1
0
1.2k
May ’22
Integrating Fyber SKAdNetwork ID Auto Updater - Xcode
Hi I'm finding it really difficult to integrate this tool in my Xcode project. The Fyber SKAdNetwork ID auto-updater is a tool for publishers to integrate into their build system and manage SKAdnetwork IDs into their Info.plist with each build job automatically. This will allow them to keep the Info.plist file up to date, even if some partners make changes to their IDs. Here's the link to the instructions: https://developer.fyber.com/hc/en-us/articles/360015298038-SKAdNetwork-ID-Auto-Updater I have installed the tool using Terminal but the rest is very confusing to me as I am not very familiar with some of the instructions/commands I'm being asked to do. Any help would be greatly appreciated - thank you so much in advance :) Ermes
1
0
1.7k
May ’22
App auto-closes on launch
Hello. I have developed an app: Kedeo.es: https://apps.apple.com/us/app/kedeo-es/id1609942690 Use external libraries to connect to Google Firebase Auth and Notifications. Also use Storekit for in-app purchase. It works perfectly, and it has also passed the tests and is published in the store, however, my client says that there are between 20% and 40% of users who are automatically closed just by opening. Does anyone else have this bug? It doesn't happen to me, and that's why I can't get any log to know more about the problem. If anyone can help I'd appreciate it. Greetings.
4
0
2.1k
May ’22
"Failed to produce a diagnostic for expression; please file a bug report" error.
İ am getting "Failed to produce a diagnostic for expression; please file a bug report" error. import SwiftUI struct ContentView: View {     let lifeformanalyzer = Lifeformanalyzer()     @State var text = ""     @State var title = "Merhaba insan!"          var body: some View { ————> error is here         VStack {             Image(systemName: "face.smiling.fill")                 .imageScale(.large)                 .foregroundColor(.accentColor)                 .padding(.top, 50)             Text(title)                 .font(.largeTitle)                          Spacer()                          TextField("Birşey yazın", text: $text)                 .multilineTextAlignment(.center)                 .frame(width: 300)                          Spacer()                          Button("Gönder") {                 submit()             }                          Spacer()                      }                                   .padding()         .frame(maxWidth: .infinity, maxHeight: .infinity)         .background(Color(red: 0.024, green: 0.392, blue: 0.549))         .ignoresSafeArea()                  func submit() {                      }     var title = "Merhaba \(lifeformanalyzer.processLifeform(text: text))!"                       }                     } The other swift file Lifeformanalyzer: class Lifeformanalyzer {          func processLifeform(text: String) -> String{                  text.lowercased().contains("vak")         ? "ördek" : "insan"     } }
2
0
1.3k
Apr ’22
Xcode 13.2.1 - Simulator works, Preview doesn't
Curious to know if anyone understands why I'm getting the following error "Cannot preview in this file" - [appname] crashed" Running the code on my (wirelessly) attached iPhone XR works, but the in-Xcode Preview window doesn't. Here's the log produced by the Diagnostics option: <Well, I tried to attach the zip file created from the previews-diagnostics-##-## folder, but this text field wouldn't accept that file type. Is there a particular file within the folder that I should upload instead?> Here's the code from the ContentView file for my (very basic) project: import SwiftUI struct ContentView: View { @FocusState private var amountIsFocused: Bool @State private var checkAmount = 0.0 @State private var numberOfPeople = 0 @State private var tipPercentage = 0 let tipPercentages = [0, 10, 15, 20, 25] var totalPerPerson: Double { let peopleCount = Double(numberOfPeople + 2) let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue let amountPerPerson = grandTotal / peopleCount return amountPerPerson } var totalAmount: Double { let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue return grandTotal } var body: some View { NavigationView { Form { Section { TextField("Amount", value: $checkAmount, format: .currency(code: Locale.current.currencyCode ?? "USD")) .keyboardType(.decimalPad) .focused($amountIsFocused) Picker("Number of people", selection: $numberOfPeople) { ForEach(2 ..< 100) { Text("\($0) people") } } } Section { Picker("Tip percentage", selection: $tipPercentage) { ForEach(0 ..< 101) { Text($0, format: .percent) } } } header: { Text("Select tip percentage") } Section { Text("Grand total: \(totalAmount, format: .currency(code: Locale.current.currencyCode ?? "USD"))") } Section { Text(totalPerPerson, format: .currency(code: Locale.current.currencyCode ?? "USD")) } header: { Text("Amount per person") } .navigationTitle("WeSplit") .navigationBarTitleDisplayMode(.inline) } .toolbar { ToolbarItemGroup(placement: .keyboard) { Spacer() Button("Done") { amountIsFocused = false } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
5
0
2.3k
Mar ’22
python grasshopper in Rhino crash
When I use python grasshopper in Rhino, it crashes like insane. Does anyone know the reason? I'm using the new mac book pro with M1 chip Translated Report (Full Report Below) Process: Rhinoceros [20538] Path: /Applications/Rhino 7.app/Contents/MacOS/Rhinoceros Identifier: com.mcneel.rhinoceros.7 Version: 7.12 (7.12.21313.06342) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2021-11-30 15:48:24.5855 -0500 OS Version: macOS 12.0.1 (21A559) Report Version: 12 Anonymous UUID: AC464397-1C9E-4BEB-4E85-83E599FD5779 Sleep/Wake UUID: AB02ED2A-4CB9-4E90-B21B-C8C7DF6FFAFC Time Awake Since Boot: 130000 seconds Time Since Wake: 9093 seconds System Integrity Protection: enabled Crashed Thread: 2 SGen worker Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: Rhinoceros [20538] Model: MacBookPro18,2, BootROM 7429.41.5, proc 10:8:2 processors, 64 GB, SMC Graphics: Apple M1 Max, Apple M1 Max, Built-In Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online Memory Module: LPDDR5 AirPort: Wi-Fi, wl0: Sep 24 2021 15:49:44 version 20.10.853.23.8.7.106 FWID 01-78e271b2 Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB31Bus USB Device: USB31Bus Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc.
1
0
1.5k
Dec ’21
MallocCheckHeap is stack address or symbol address ?
Target Platform: iphone xr XCode: 12.4 After setting "Enable Malloc Scribble" "Malloc Guard Edges" "Goard Malloc" in Diagnostics and "MallocCheckHeapEach=1" "MallocCheckHeapSleep=100" "MallocCheckHeapStart=100000" in Environment Variables Start up the app on iphone and I get the following information: xxxx(1394,0x16f933000) malloc: *** MallocCheckHeap: FAILED check at operation #7444968 Stack for last operation where the malloc check succeeded: 0x1aefaed70 0x1aefa2f94 0x112f20540 0x1e904e76c 0x1e905a5e8 0x1e9054bf4 0x1e9035fc0 0x1b5ec57c4 0x112f216c0 0x112f25000 0x112f24e7c 0x1b5ec5268 0x1b5ed1348 0x1b5ed0e40 0x1a0b103f8 0x1a0b0e9a4 0x1a07a751c 0x1a0aef310 0x1a07afb74 0x1a07b6d38 0x1a0b1511c 0x1a0b12b28 0x1a02c2cc8 0x1a02bbac4 0x1a02bc7b0 0x1a0336028 0x1a02bb3c0 0x1a0336b60 0x1a0335344 0x1a03354c0 0x112f1fbcc 0x112f216c0 0x112f29354 0x112f2a0f4 0x112f2b5e4 0x112f36644 0x1e901c804 0x1e902375c  (Use 'atos' for a symbolic stack) xxxx(1394,0x16f933000) malloc: *** Will sleep for 100 seconds to leave time to attach xxxx(1394,0x16f933000) malloc: *** check: incorrect tiny region 44, counter=28255155 *** invariant broken for tiny block 0x13628fea0 this msize=0 - size is too small xxxx(1394,0x16f933000) malloc: *** set a breakpoint in malloc_error_break to debug xxxx(1394,0x16f933000) malloc: *** sleeping to help debug Q.1 "Stack for last operation where the malloc check succeeded" means what ? Q.2 the address is 'stack address' ? e.g 0x1aefaed70. Following the hints "(Use 'atos' for a symbolic stack) ", I get nothing for 0x1aefaed70 $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x10225c000 0x0000000100000000 (in xxxx) $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x1aefaed70 0x1aefaed70 (nothing) 0x10225c000 is load adress getting from AppDelegate after app start up.   uint32_t numImages = _dyld_image_count();   for (uint32_t i = 0; i < numImages; i++) {     const struct mach_header *header = _dyld_get_image_header(i);     const char *name = _dyld_get_image_name(i);     const char *p = strrchr(name, '/');     if (p && (strcmp(p + 1, "xxxx") == 0 || strcmp(p + 1, "libXxx.dylib") == 0)) {       NSLog(@"module=%s, address=%p", p + 1, header);     }   }    ```
2
0
1.8k
Dec ’21
Crash Xcode 14 with Swift -> Objective-C framework; AutoreleasingUnsafeMutablePointer; -O Optimize for Speed
I am having a crash with a Swift -> Objective-C interoperability under Xcode 14 / Swift 5.7 but only when Optimize for Speed is part of the build. There was no issue with this under Xcode 13.4.1 / Swift 5.6 under the same conditions. Typically, this compiler option is disabled for Debug builds so this was only detected once we provided release builds to beta users using Test Flight.  The interoperability is with using a proprietary, third-party framework. I am not privy to the Objective-C code that makes up the public API for this framework. As the framework had worked with Xcode 13.4.1 (with and without the speed optimization) and also works in Debug mode with Xcode 14.x (I have tried 14.1 as well) but crashes with the speed optimization turned on, I suspect the optimization may be at fault. But it is hard to say. I am hoping someone with better knowledge than I of this can guide me as to why this is happening…and only now. Here is an example of the code. Note: there are multiple instances of this same pattern in the API. There are vendor supplied structures (as well as NSArray as in this example) that cause similar failure. The vendor has supplied only Objective-C sample code and documentation.     func listItems() {         var availableItems: NSMutableArray? = NSMutableArray()         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } The header file provides: - (ITEM_RESULT) getAvailableItemList:(NSMutableArray**)getAvailableItemList; The derived Swift interface for this is: func getAvailableItemList(_ availableItemsList: AutoreleasingUnsafeMutablePointer<NSMutableArray?>!) -> ITEM_RESULT The crash occurs when calling the API and/or attempting to use the value associated with the AutoreleasingUnsafeMutablePointer. I have turned on all memory management diagnostics for the run phase of the scheme. When I do so, I see the following in the console when I get a fatal Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1d66e8a88) presented in the caller to the listItems() method. *** -[__NSArrayM retain]: message sent to deallocated instance 0x28bd15200 My assumption is that this indicates the memory was released (aggressively?) and so this causes the crash. Again, only with the -O (Optimize for Speed) option is enabled. I have been able to code a potential solution to this issue. Maybe this should have been the solution for prior Swift versions…but I had no reason (as it had worked without issue up until Xcode 14).     func listItems() {         let itemsArray = NSMutableArray()          var availableItems: NSMutableArray? = itemsArray         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } This solution assigns the array to an immutable variable and then assigns that reference to an optional that is passed for the AutoreleasingUnsafeMutablePointer. My assumption is that adds an additional retain to keep the optimization from removing the memory for the array until the itemsArray is no longer referenced. I am reaching out to see if this is a known issue by others and/or expected (but new) behavior as I do not have much experience with AutoreleasingUnsafeMutablePointer. Also, if this is not a bug but is the new normal, is the potential solution the proper way to use the AutoreleasingUnsafeMutablePointer with Objective-C framework APIs? Or should I be doing something different? Thanks for any insight or pointers (even if unsafe).
Replies
5
Boosts
0
Views
2.9k
Activity
Nov ’22
Error Cannot find « » in scope XCODE
Hello I made an app and I have this error: Cannot find string in scope I post my code under the message please help me: Photo: ("https://developer.apple.com/forums/content/attachment/3253bf72-d034-475e-a69e-a73f32388f84" "title=Capture d’écran 2022-11-21 à 19.16.00.png;width=2036;height=1380") // //  AuthviewModel.swift //  iSpeak // //  Created by Sayan on 21.11.22. // import Foundation import Firebase class AuthViewModel: ObservableObject {     var manager = FirebaseManager.shared          @Published var isFinishedConnecting: Bool = false     @Published var isAuth: Bool = false     @Published var showError: Bool = false          var errorString: String = ""     var datas: [String: Any] = [:]          var auth: Auth {         return manager.auth     }          init() {         observeAuthentication()     }          func observeAuthentication() {         auth.addStateDidChangeListener(handleChangeListener)     }          func handleChangeListener(auth: Auth, user: User?) {         self.isFinishedConnecting = true         self.isAuth = user != nil     }          func signIn(email: String, password: String) {         guard checkValue(_string: email, value: "adresse email") else { return }         guard checkValue(_string: password, value: "Mot de passe") else { return }              }          func createUser() {              }          func checkValue(_string: String, value: String) -> Bool {       let isNotEmpty = string != "" Error : Cannot find « string » in scope          self.errorString = !isNotEmpty ? "" : "Merci d'entrer (value) pour continuer"         self.showError = !isNotEmpty         return isNotEmpty     } }
Replies
1
Boosts
0
Views
2.3k
Activity
Nov ’22
Is git already installed when buying a new Macbook?
Greetings, due to the current situation (Corona-Virus) I had to download Xcode, MS Visual Studio and Visual StudioCode on my personal MacBook Pro (2017; no Touch Bar). These applications were all asking for git (git-scm) and I have accepted. After some regrets I have decided to delete all applications again. I was able to delete Xcode, MS VS and VS Code but there was no program with the name git“, but hundreds of files with a big red „h“ on them, that I have never seen before. I used the function for a secured system restart and at the end I was reinstalling MacOS BigSur. Every time I logged in my entire display was black and my cursor in a neon blue I installed a new MacOS again and now everything seems to be fine (at least no black screen). I used some codes, I got from google, on my terminal (sudo rm -rf /usr/bin/git/), I am afraid that it has done more damage than it was helpful. Any idea how I can reverse the last 24 hours? Summary: Is Git already installed when I buy a new MacBook? If not, how can I delete all unnecessary files? Has „sudo rm -rf /usr/bin/git/„ changed anything? My terminal said that I was having Apple Git 128. After deleting XCodes there seems to be no git $ which git /usr/bin/git $ git --version xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Sorry for all the questions, but I am totally unskilled when it is about using git. Kind Regards,
Replies
4
Boosts
0
Views
17k
Activity
Nov ’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.5k
Activity
Jun ’22
Receiving this error 'EXC_BREAKPOINT (code=1, subcode=0x1051904b8)' when trying to use a PhotoPicker.
I'm going insane over this, I'm using Xcode 13 beta 6 on the M1 MacBook Air. Every time I pick an image, I receive this error message. At this point I don't know what I can do because the message is so vague. Please help me.     @Binding var image: UIImage          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.delegate = context.coordinator         return imagePicker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {              }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {                   var parent: PhotoPicker                  init(parent: PhotoPicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.originalImage] as? UIImage {                 parent.image = image             }else{                              }             picker.dismiss(animated: true, completion: nil)         }     } }          @State private var isPresented: Bool = false     @State private var avatarImage = UIImage(systemName: "person") ?? UIImage()          var body: some View {         VStack {             Image(uiImage: avatarImage)                 .resizable()                 .scaledToFill()                 .frame(width: 150, height: 150)                 .clipShape(Circle())                 .padding()                 .onTapGesture {                     isPresented = true                 }                          Spacer()         }         .navigationTitle("Profile")         .sheet(isPresented: $isPresented) {             PhotoPicker(image: $avatarImage)         }     } }
Replies
4
Boosts
0
Views
5.7k
Activity
May ’22
Failed to produce diagnostic for expression; please submit a bug report
i did " // customslidebar.swift // chatbot // // Created by AndrewLee on 2022/05/04. // import SwiftUI enum Tab: String, CaseIterable {     case house     case message     case person     case gearshape } struct customslidebar: View {   @Binding var selectedTab: Tab   private var fillimage: String {     selectedTab.rawValue + ".fill"   }       var body: some View {     VStack {       HStack {         ForEach(Tab.allCases, id: .rawValue) { tab in           Spacer()           image(systemName: selectedTab == tab ? fillimage : tab.rawValue)           Spacer()                                 }       }       .frame(width: nil, height: 60)       .background(.thinMaterial)       .cornerRadius(10)       .padding()             }   } } struct customslidebar_Previews: PreviewProvider {   static var previews: some View {     customslidebar(selectedTab: .constant(.house))   } } this but it says Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
Replies
1
Boosts
0
Views
1.2k
Activity
May ’22
Integrating Fyber SKAdNetwork ID Auto Updater - Xcode
Hi I'm finding it really difficult to integrate this tool in my Xcode project. The Fyber SKAdNetwork ID auto-updater is a tool for publishers to integrate into their build system and manage SKAdnetwork IDs into their Info.plist with each build job automatically. This will allow them to keep the Info.plist file up to date, even if some partners make changes to their IDs. Here's the link to the instructions: https://developer.fyber.com/hc/en-us/articles/360015298038-SKAdNetwork-ID-Auto-Updater I have installed the tool using Terminal but the rest is very confusing to me as I am not very familiar with some of the instructions/commands I'm being asked to do. Any help would be greatly appreciated - thank you so much in advance :) Ermes
Replies
1
Boosts
0
Views
1.7k
Activity
May ’22
App auto-closes on launch
Hello. I have developed an app: Kedeo.es: https://apps.apple.com/us/app/kedeo-es/id1609942690 Use external libraries to connect to Google Firebase Auth and Notifications. Also use Storekit for in-app purchase. It works perfectly, and it has also passed the tests and is published in the store, however, my client says that there are between 20% and 40% of users who are automatically closed just by opening. Does anyone else have this bug? It doesn't happen to me, and that's why I can't get any log to know more about the problem. If anyone can help I'd appreciate it. Greetings.
Replies
4
Boosts
0
Views
2.1k
Activity
May ’22
"Failed to produce a diagnostic for expression; please file a bug report" error.
İ am getting "Failed to produce a diagnostic for expression; please file a bug report" error. import SwiftUI struct ContentView: View {     let lifeformanalyzer = Lifeformanalyzer()     @State var text = ""     @State var title = "Merhaba insan!"          var body: some View { ————> error is here         VStack {             Image(systemName: "face.smiling.fill")                 .imageScale(.large)                 .foregroundColor(.accentColor)                 .padding(.top, 50)             Text(title)                 .font(.largeTitle)                          Spacer()                          TextField("Birşey yazın", text: $text)                 .multilineTextAlignment(.center)                 .frame(width: 300)                          Spacer()                          Button("Gönder") {                 submit()             }                          Spacer()                      }                                   .padding()         .frame(maxWidth: .infinity, maxHeight: .infinity)         .background(Color(red: 0.024, green: 0.392, blue: 0.549))         .ignoresSafeArea()                  func submit() {                      }     var title = "Merhaba \(lifeformanalyzer.processLifeform(text: text))!"                       }                     } The other swift file Lifeformanalyzer: class Lifeformanalyzer {          func processLifeform(text: String) -> String{                  text.lowercased().contains("vak")         ? "ördek" : "insan"     } }
Replies
2
Boosts
0
Views
1.3k
Activity
Apr ’22
Xcode 13.2.1 - Simulator works, Preview doesn't
Curious to know if anyone understands why I'm getting the following error "Cannot preview in this file" - [appname] crashed" Running the code on my (wirelessly) attached iPhone XR works, but the in-Xcode Preview window doesn't. Here's the log produced by the Diagnostics option: <Well, I tried to attach the zip file created from the previews-diagnostics-##-## folder, but this text field wouldn't accept that file type. Is there a particular file within the folder that I should upload instead?> Here's the code from the ContentView file for my (very basic) project: import SwiftUI struct ContentView: View { @FocusState private var amountIsFocused: Bool @State private var checkAmount = 0.0 @State private var numberOfPeople = 0 @State private var tipPercentage = 0 let tipPercentages = [0, 10, 15, 20, 25] var totalPerPerson: Double { let peopleCount = Double(numberOfPeople + 2) let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue let amountPerPerson = grandTotal / peopleCount return amountPerPerson } var totalAmount: Double { let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue return grandTotal } var body: some View { NavigationView { Form { Section { TextField("Amount", value: $checkAmount, format: .currency(code: Locale.current.currencyCode ?? "USD")) .keyboardType(.decimalPad) .focused($amountIsFocused) Picker("Number of people", selection: $numberOfPeople) { ForEach(2 ..< 100) { Text("\($0) people") } } } Section { Picker("Tip percentage", selection: $tipPercentage) { ForEach(0 ..< 101) { Text($0, format: .percent) } } } header: { Text("Select tip percentage") } Section { Text("Grand total: \(totalAmount, format: .currency(code: Locale.current.currencyCode ?? "USD"))") } Section { Text(totalPerPerson, format: .currency(code: Locale.current.currencyCode ?? "USD")) } header: { Text("Amount per person") } .navigationTitle("WeSplit") .navigationBarTitleDisplayMode(.inline) } .toolbar { ToolbarItemGroup(placement: .keyboard) { Spacer() Button("Done") { amountIsFocused = false } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Replies
5
Boosts
0
Views
2.3k
Activity
Mar ’22
python grasshopper in Rhino crash
When I use python grasshopper in Rhino, it crashes like insane. Does anyone know the reason? I'm using the new mac book pro with M1 chip Translated Report (Full Report Below) Process: Rhinoceros [20538] Path: /Applications/Rhino 7.app/Contents/MacOS/Rhinoceros Identifier: com.mcneel.rhinoceros.7 Version: 7.12 (7.12.21313.06342) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2021-11-30 15:48:24.5855 -0500 OS Version: macOS 12.0.1 (21A559) Report Version: 12 Anonymous UUID: AC464397-1C9E-4BEB-4E85-83E599FD5779 Sleep/Wake UUID: AB02ED2A-4CB9-4E90-B21B-C8C7DF6FFAFC Time Awake Since Boot: 130000 seconds Time Since Wake: 9093 seconds System Integrity Protection: enabled Crashed Thread: 2 SGen worker Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: Rhinoceros [20538] Model: MacBookPro18,2, BootROM 7429.41.5, proc 10:8:2 processors, 64 GB, SMC Graphics: Apple M1 Max, Apple M1 Max, Built-In Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online Memory Module: LPDDR5 AirPort: Wi-Fi, wl0: Sep 24 2021 15:49:44 version 20.10.853.23.8.7.106 FWID 01-78e271b2 Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB31Bus USB Device: USB31Bus Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc.
Replies
1
Boosts
0
Views
1.5k
Activity
Dec ’21
MallocCheckHeap is stack address or symbol address ?
Target Platform: iphone xr XCode: 12.4 After setting "Enable Malloc Scribble" "Malloc Guard Edges" "Goard Malloc" in Diagnostics and "MallocCheckHeapEach=1" "MallocCheckHeapSleep=100" "MallocCheckHeapStart=100000" in Environment Variables Start up the app on iphone and I get the following information: xxxx(1394,0x16f933000) malloc: *** MallocCheckHeap: FAILED check at operation #7444968 Stack for last operation where the malloc check succeeded: 0x1aefaed70 0x1aefa2f94 0x112f20540 0x1e904e76c 0x1e905a5e8 0x1e9054bf4 0x1e9035fc0 0x1b5ec57c4 0x112f216c0 0x112f25000 0x112f24e7c 0x1b5ec5268 0x1b5ed1348 0x1b5ed0e40 0x1a0b103f8 0x1a0b0e9a4 0x1a07a751c 0x1a0aef310 0x1a07afb74 0x1a07b6d38 0x1a0b1511c 0x1a0b12b28 0x1a02c2cc8 0x1a02bbac4 0x1a02bc7b0 0x1a0336028 0x1a02bb3c0 0x1a0336b60 0x1a0335344 0x1a03354c0 0x112f1fbcc 0x112f216c0 0x112f29354 0x112f2a0f4 0x112f2b5e4 0x112f36644 0x1e901c804 0x1e902375c  (Use 'atos' for a symbolic stack) xxxx(1394,0x16f933000) malloc: *** Will sleep for 100 seconds to leave time to attach xxxx(1394,0x16f933000) malloc: *** check: incorrect tiny region 44, counter=28255155 *** invariant broken for tiny block 0x13628fea0 this msize=0 - size is too small xxxx(1394,0x16f933000) malloc: *** set a breakpoint in malloc_error_break to debug xxxx(1394,0x16f933000) malloc: *** sleeping to help debug Q.1 "Stack for last operation where the malloc check succeeded" means what ? Q.2 the address is 'stack address' ? e.g 0x1aefaed70. Following the hints "(Use 'atos' for a symbolic stack) ", I get nothing for 0x1aefaed70 $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x10225c000 0x0000000100000000 (in xxxx) $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x1aefaed70 0x1aefaed70 (nothing) 0x10225c000 is load adress getting from AppDelegate after app start up.   uint32_t numImages = _dyld_image_count();   for (uint32_t i = 0; i < numImages; i++) {     const struct mach_header *header = _dyld_get_image_header(i);     const char *name = _dyld_get_image_name(i);     const char *p = strrchr(name, '/');     if (p && (strcmp(p + 1, "xxxx") == 0 || strcmp(p + 1, "libXxx.dylib") == 0)) {       NSLog(@"module=%s, address=%p", p + 1, header);     }   }    ```
Replies
2
Boosts
0
Views
1.8k
Activity
Dec ’21