I have a sandboxed app in /Applications.
I'm attempting to shoot a problem with LLDB, so I cd to /Applications/app-name/Contents/MacOS and do lldb programname.
However, once I fire it off with "r" it dies instantly with:
error: process exited with status -1 (lost connection)
Should this work? Should I try signing the lldb executable?
Thanks!
General
RSS for tagDive into the world of programming languages used for app development.
Post
Replies
Boosts
Views
Activity
Hello,
I have received 3 almost identical crash reports from the App Store. They all come from the same user, and they are spaced just ± 45 seconds apart.
This is the backtrace of the crashed thread:
Crashed Thread: 3
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process: Ssssssss [46033]
Thread 3 Crashed:
0 libsystem_kernel.dylib 0x00007ff81b90f196 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007ff81b946ee6 pthread_kill + 263 (pthread.c:1670)
2 libsystem_c.dylib 0x00007ff81b86dbdf __abort + 139 (abort.c:155)
3 libsystem_c.dylib 0x00007ff81b86db54 abort + 138 (abort.c:126)
4 libc++abi.dylib 0x00007ff81b901282 abort_message + 241
5 libc++abi.dylib 0x00007ff81b8f33fb demangling_terminate_handler() + 267
6 libobjc.A.dylib 0x00007ff81b5c67ca _objc_terminate() + 96 (objc-exception.mm:498)
7 libc++abi.dylib 0x00007ff81b9006db std::__terminate(void (*)()) + 6
8 libc++abi.dylib 0x00007ff81b900696 std::terminate() + 54
9 libdispatch.dylib 0x00007ff81b7a6047 _dispatch_client_callout + 28 (object.m:563)
10 libdispatch.dylib 0x00007ff81b7a87c4 _dispatch_queue_override_invoke + 800 (queue.c:4882)
11 libdispatch.dylib 0x00007ff81b7b5fa2 _dispatch_root_queue_drain + 343 (queue.c:7051)
12 libdispatch.dylib 0x00007ff81b7b6768 _dispatch_worker_thread2 + 170 (queue.c:7119)
13 libsystem_pthread.dylib 0x00007ff81b943c0f _pthread_wqthread + 257 (pthread.c:2631)
14 libsystem_pthread.dylib 0x00007ff81b942bbf start_wqthread + 15 (:-1)
In the backtrace of the main thread, I can see that the error is caught by the app delegate which tries to display an alert, but obviously the message has no time to appear. Incidentally (but it's not my main question), I would like to know if it would be possible in such a case to block the background thread for the time the alert is displayed (e.g. using a dispatch queue)?
... (many other related lines)
72 SSUuuuIIIIIIIIIUUuuuu 0x000000010e8089f2 +[NSAlert(Ssssssss) fatalError:] + 32
73 Ssssssss 0x000000010dd5e75b __universalExceptionHandler_block_invoke (in Ssssssss) (SQAppDelegate.m:421) + 333659
74 libdispatch.dylib 0x00007ff81b7a4d91 _dispatch_call_block_and_release + 12 (init.c:1518)
75 libdispatch.dylib 0x00007ff81b7a6033 _dispatch_client_callout + 8 (object.m:560)
76 libdispatch.dylib 0x00007ff81b7b2fcf _dispatch_main_queue_drain + 954 (queue.c:7794)
77 libdispatch.dylib 0x00007ff81b7b2c07 _dispatch_main_queue_callback_4CF + 31 (queue.c:7954)
78 CoreFoundation 0x00007ff81ba62195 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 (CFRunLoop.c:1780)
79 CoreFoundation 0x00007ff81ba21ebf __CFRunLoopRun + 2452 (CFRunLoop.c:3147)
80 CoreFoundation 0x00007ff81ba20ec1 CFRunLoopRunSpecific + 560 (CFRunLoop.c:3418)
81 HIToolbox 0x00007ff8254a5f3d RunCurrentEventLoopInMode + 292 (EventLoop.c:455)
82 HIToolbox 0x00007ff8254a5d4e ReceiveNextEventCommon + 657 (EventBlocking.c:384)
83 HIToolbox 0x00007ff8254a5aa8 _BlockUntilNextEventMatchingListInModeWithFilter + 64 (EventBlocking.c:171)
84 AppKit 0x00007ff81eabfb18 _DPSNextEvent + 858 (CGDPSReplacement.m:818)
85 AppKit 0x00007ff81eabe9c2 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214 (appEventRouting.m:407)
86 AppKit 0x00007ff81eab1037 -[NSApplication run] + 586 (NSApplication.m:3432)
87 AppKit 0x00007ff81ea85251 NSApplicationMain + 817 (NSApplication.m:9427)
88 dyld 0x00007ff81b5ec41f start + 1903 (dyldMain.cpp:1165)
In all 3 reports, another thread indicates that it is sending or receiving a MIDI data (it's exactly the same backtrace in the 3 reports):
Thread 1:
0 libsystem_kernel.dylib 0x00007ff81b908552 mach_msg2_trap + 10
1 libsystem_kernel.dylib 0x00007ff81b9166cd mach_msg2_internal + 78 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00007ff81b90f584 mach_msg_overwrite + 692 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00007ff81b90883a mach_msg + 19 (mach_msg.c:323)
4 CoreMIDI 0x00007ff834adfd50 XServerMachPort::ReceiveMessage(int&, void*, int&) + 94 (XMachPort.cpp:62)
5 CoreMIDI 0x00007ff834b118c5 MIDIProcess::MIDIInPortThread::Run() + 105 (MIDIClientLib.cpp:204)
6 CoreMIDI 0x00007ff834af9c44 CADeprecated::XThread::RunHelper(void*) + 10 (XThread.cpp:21)
7 CoreMIDI 0x00007ff834afae9f CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 77 (CAPThread.cpp:324)
8 libsystem_pthread.dylib 0x00007ff81b9471d3 _pthread_start + 125 (pthread.c:893)
9 libsystem_pthread.dylib 0x00007ff81b942bd3 thread_start + 15 (:-1)
I wonder if this MIDI activity may be related to the crash, even if it doesn't occur in the crashed thread.
I also wonder if the dispatch block starting the backtrace of the thread 3 is the same that leads to the thread 1 (to open the NSAlert), which would mean that it's after the error, or if it's a dispatch block into which the error occurs.
Finally,
2024-03-25_13-04-40.6314.crash
I wonder if std::terminate() could indicate a problem in C++ codes because I have some part of the application written in C++, and it would be a clue.
More generally, is it something in these backtraces that can help me to find what's the problem ?
Any help greatly appreciated, thanks!
-dp
Domain: com.apple.dt.CoreDeviceError
Code: 3002
User Info: {
DVTErrorCreationDateKey = "2024-04-12 13:00:55 +0000";
IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker;
NSURL = "file:///Users/Username/Library/Developer/Xcode/DerivedData/project-dwlcjztonmnjygafwwnxdjtbzkwe/Build/Products/Debug-iphoneos/target.app/";
}
--
Failed to install the app on the device.
Domain: com.apple.dt.CoreDeviceError
Code: 3002
User Info: {
IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker;
NSURL = "file:///Users/Username/Library/Developer/Xcode/DerivedData/project-dwlcjztonmnjygafwwnxdjtbzkwe/Build/Products/Debug-iphoneos/target.app/";
}
--
The item at target.app is not a valid bundle.
Domain: com.apple.dt.CoreDeviceError
Code: 3000
Failure Reason: The path to the provided bundle's main executable could not be determined.
Recovery Suggestion: Ensure that your bundle's Info.plist contains a value for the key CFBundleExecutable.
User Info: {
NSURL = "file:///Users/Username/Library/Developer/Xcode/DerivedData/project-dwlcjztonmnjygafwwnxdjtbzkwe/Build/Products/Debug-iphoneos/target.app/";
ProvidedBundle = "file:///Users/Username/Library/Developer/Xcode/DerivedData/project-dwlcjztonmnjygafwwnxdjtbzkwe/Build/Products/Debug-iphoneos/target.app/";
}
--
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
"device_isCoreDevice" = 1;
"device_model" = "iPhone12,1";
"device_osBuild" = "17.4.1 (21E236)";
"device_platform" = "com.apple.platform.iphoneos";
"dvt_coredevice_version" = "355.24";
"dvt_mobiledevice_version" = "1643.100.58";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 2486;
"operation_errorCode" = 3000;
"operation_errorDomain" = "com.apple.dt.CoreDeviceError.3002.com.apple.dt.CoreDeviceError";
"operation_errorWorker" = IDEInstallCoreDeviceWorker;
"operation_name" = IDERunOperationWorkerGroup;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphoneos";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 99;
"param_launcher_substyle" = 8192;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_structuredConsoleMode" = 1;
"par[tag:am_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphoneos17.4";
"sdk_osVersion" = "17.4";
"sdk_variant" = iphoneos;
}
System Information
macOS Version 14.4.1 (Build 23E224) Xcode 15.3 (22618) (Build 15E204a) Timestamp: 2024-04-12T18:30:55+05:30
The project is running on the simulator properly with no errors.
But while running on the real device (the iPhone), the build is successful but getting the mentioned issue.
Also, while creating the.ipa file, we are getting the error mentioned below.
I have tried following thing to resolve the issue but nothing is worked.
Clean project and try to run the app on the real device.
Disconnect iPhone from Mac On iPhone: Settings > Developer > Clear Trusted Computers Uninstall the application Reconnect iPhone to Mac In Xcode Window > Devices & Simulators You should see your device in the left sidebar Re-pair the device
In the project Target -> Build Settings search for: search for Excluded Architectures add arm64 there.
Change the archive destination directory to a location on the local SSD (and not an external HDD).
Go to settings >> Select Privacy & Security >> Turn developer mode off if on >> Turn developer mode back on an follow instrctions >> The run your app on xcode `
Please help me find the solution.
Thank you in advance.
Instruments reveals that the following simple code leaks memory on each delegate invoke:
- (void)start {
[_urlSession dataTaskWithURL:_url];
}
- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data {
[_data appendData:data];
}
I don't have any clue on this leak, it should not happen. What should I do to avoid this?
Compiler: XCode12/13/14
Tested On: iPhoneXS+iOS15.4 / iPhone11+iOS16.5
I tried to compile following code with arch=arm64e and run, it crashed with EXC_BAD_ACCESS at 'LDRAA', seems occur when trying to access c++ v-table. And this bug will not occur in following conditions. c++ I/O api is easy to trigger the bug.
compile with arch=arm64 and run on arm64e device
compile with arch=arm64e and run on arm64e device with iOS<=14
#include <fstream>
#include <stringstream>
int main(int argc, char** argv) {
std::ifstream MyReadFile("/System/Library/CoreServices/SystemVersion.plist"); // crash1
std::stringstream stream;
stream << std::hex << 0; // crash2
}
I also tried c++11/14/17/20, it makes no difference.
For many years, I programmed for Windows desktops (Visual Basic and C# on Microsoft Visual Studio).
What is a good way to start progrmming for an iOS or iPadOS device. What programming apps can you recommend and what books or courses can I get (online or otherwise) to start with? Can I make code with Microsoft Visual Studio or do I need specific programming tools for writing code?
Thank you for your help.
Michel
White-label messaging is like a pre-made chat app that one company creates, but other companies can make it look like it’s their own by changing its appearance and name. Basically, it’s a chat tool that businesses can buy and use with their own branding.
if we define a property in the following way:
@property (atomic) NSString *latestObject;
Can we assume that the read write to that value is thread safe?
i.e the value will be correct.
Or it is better to write our own setter/getter with Locks?
Is it possible to access the RoomPlan API from Objective-C? I cannot figure out how to include the RoomPlan framework into some legacy Objective-C code I have. I can include the RoomPlan.h header but it still does not recognize any of the API classes. I also could not figure out if there was a way to use RoomPlan-Swift.h to expose the API to the Objective-C code.
When I Run Php Artisan Command in PhpStorm Laravel Project The below results show in the terminal.
dyld[11387]: Library not loaded: @loader_path/../../../../opt/icu4c/lib/libicuio.73.dylib
Referenced from: <27B43AEF-470B-32CD-9521-AA834300394F> /usr/local/Cellar/php/8.2.10/bin/php
Reason: tried: '/usr/local/Cellar/php/8.2.10/bin/../../../../opt/icu4c/lib/libicuio.73.dylib' (no such file), '/usr/local/lib/libicuio.73.dylib' (no such file), '/usr/lib/libicuio.73.dylib' (no such file, not in dyld cache)
zsh: abort php artisan
I had code compiling with C++20 using XCode 14.3.
I now updated to XCode 15.4, and that feature is not available anymore...
No member named 'join' in namespace 'std::ranges::views'
Why is join got dropped?
In a completely new project using Objective-C, when using "NSDateFormatter" under the conditions mentioned, setting initWithLocaleIdentifier to "NSCalendarIdentifierGregorian" results in "dateFromString" returning nil. This issue is occurring specifically in iOS 18 beta 1 and 2, and it's causing me significant trouble.
This process works correctly on iOS 17 and earlier versions.
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setTimeStyle:NSDateFormatterFullStyle];
[formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:NSCalendarIdentifierGregorian]];
[formatter setDateFormat:formatStr];
NSDate *date = [formatter dateFromString:formatStr];
"date" is nil.
Hi,
I am writing my own little toy programming language and when I try to link the binary object file (.o file) it requires a _main symbol. I wonder if there is a way to exclude this, presumably, a C runtime requirement?
Is it safe to provide a stub _main symbol, or provide a the _main as the entry point to my own little runtime?
What is the correct way to invoke the linker with the appropriate flags?
I'm the developer of 8th (https://8th-dev.com), which compiles the program at run-time, on the device. There used to be an iOS version which worked, but it seems things have changed since then.
I'm trying to distribute an iOS version of an app written in 8th, and am encountering "SIGKILL - CODESIGNING" when trying to execute freshly compiled code. I am doing the 'sys_icache_invalidate' thing after writing into a mmap'ed bit of memory (rwx).
I'm not writing into memory that was codesigned, so I don't know why the error is that.
Anyway, the question is: is it possible any more to do what I used to be able to do?
I am getting an following error while compiling the
Fortran file with "gfortran TEST_1_fortran_only_fixed.f"
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
Please help me to solve this issue
I think I found a bug in the Objective-C++ compiler, linker, or runtime. Here’s the scenario:
We have a macOS app written in Swift.
To control hardware from a 3rd party manufacturer, we use a couple SDKs provided by the manufacturer.
The SDKs use dynamically loaded libraries and the interface is defined in C++ headers.
To bridge between our Swift code and the C++ APIs we have a private Cocoapod that wraps the 3rd party interface with Objective-C++ classes.
The two SDKs each provide an interface for discovering attached devices using a callback class that the programmer provides. By accident we named both callback implementations DiscoveryCallback, but this was not a compiler error because neither class was publicly declared, and each was defined in the .mm file where it was used.
However, the problem we’re seeing is this:
We want to discover Videohub devices, so we register a new instance of DiscoveryCallback (defined in the same .mm file as this code) with the Videohub SDK.
A Videohub device is connected and the SDK calls a method on our callback.
Surprise! The callback we registered in step 1 was actually the one intended for Decklink devices, defined in a completely different .mm file.
This violates all sorts of assumptions and our app quickly crashes.
The funny thing is, the two implementations of DiscoveryCallback have completely different method names. The Videohub SDK is supposed to be calling NewVideohubDevice, yet somehow it successfully calls DeckLinkDeviceArrived on an instance of a class it shouldn’t even know about.
So the compiler has checked that our intended DiscoveryCallback matches the protocol that the SDK expects, but at runtime the compiled code instantiates a completely different implementation of DiscoveryCallback and somehow doesn’t immediately fail; we still call a method on it that doesn’t even share a name with the intended target. I imagine at this point the method names are long forgotten and are just pointers in a table.
I don’t know if this is a bug in the compiler, the Objective-C++ runtime, or if this is just “working as designed” undefined behavior that I should have avoided by not giving two private classes the same name. I know it’s possible to use a private API simply by redeclaring it in my own code, and this seems related to that, but I feel like the compiler or linker should have warned me that I had two implementations of the same class, or if that is not an error, then the runtime should have instantiated the class that was privately defined in the same source file where it was used.
Obviously I can’t share our entire project; I’d like to provide some sample code that replicates the issue, but I don’t have time to do that right now. I’m posting this to see if other developers have had a similar experience.
Hello! I have an application written in Objective-c/C++ and I would like it to have support for OTA updates.
I implemented the logic through two executable files, one of which was responsible for launching and updating the first, but this option did not pass Apple's review.
Could you tell me how this functionality can be implemented and so that it meets the requirements of the App Store.
Hey guys, so I have a problem regarding the testIDs on my react native that is reproducible only on iOS DOM meaning that I set the ids individually on the elements on a page but the problem is that somehow the ids are concatenated between them and inherits all the ids under the parent. As you can see and imagine in the accessibility inspector, this is what my DOM looks like. I want to point out that the problem does not reproduce on Android, only on iOS. Can somebody help me with this and tell me if there is a way to disable this concatenation? What's relevant to tell you it's the fact that I need each element to have an unique ID for browserstack automated tests. But as you can see in the image an element contains all IDs concatenated for some reason. And here is the code for the page with this issue
I'm investigating an odd problem that surfaced with macOS Sequoia related to CoreGraphics (CGColorSpaceCreateWithICCData()).
I couldn't find a reliable way to track the lifetime (retain/releases) of a CGColorSpaceRef (any pointers appreciated) so I was hoping to use objc_setAssociatedObject() to attach an instance of my own class that would be deallocated when the "owning" CGColorSpaceRef is deallocated. In this way I could set a breakpoint on my own code, presumably invoked when the CGColorSpaceRef is itself going away.
While objc_setAssociatedObject() does seem to work, the results don't seem deterministic. Is it because objc_setAssociatedObject() simply won't work reliably with CF types?
using assembly in xcode.