Explore the core architecture of the operating system, including the kernel, memory management, and process scheduling.

Post

Replies

Boosts

Views

Activity

When two memset struct with the same name will crash on ios18 beta1
1.The code structure is as follows: The main project imports an SDK. 2.The main project defines a struct A with a length of 1400 bytes, and the SDK also defines a struct A with a length of 1000 bytes. 3.The SDK does not expose the definition of struct A, but it is used in the implementation of the exposed API in the SDK. 4.In the usage process, the main project first calls the SDK's API, which uses struct A of SDK's and initializes it with memset. Then, in the main project, memset is used again to initialize the struct A declared in the main project. In the above scenario, it works fine on iOS versions lower than iOS18, but on iOS18 beat1, the app crashes randomly, and the crash scenarios are not fixed. We need to know whether iOS18 has made any improvements to the API for operating memory such as memset. Is memory management more stringent? Why do versions below iOS18 not cause problems? Thanks!
4
0
246
4w
Including a prefpane in App bundle?
Somewhere in the back of my head, I seem to remember that we can include prefPanes in our app store distributed apps these days (much like we can now include driverkit extensions). I can't for the life of me find this in the documentation again though. Can we do this? Or do I need to copy it from my app bundle to ~/Library/PreferencePanes? Thanks!
3
0
193
4w
open (1) fails with fnfErr while open (2) succeeds on custom filesystem
Hello, I have developed a custom filesystem in golang, that relies on macFUSE. High-level apps on osx (TextEdit, Numbers, Preview) rely on syscall.renamex_np with the flag RENAME_SWAP in order to save edits. In golang, the sys call renamex_np and renameat2 are not supported, thus I had to implement the logic for it it. The discussion opened on the google group for macFUSE can be followed here: https://groups.google.com/g/osxfuse-group/c/Kh0qVRGIVv4 On my mounted filesystem, edits work and performing system calls work. However after I perform a series of edits in TextEdit, and completely exit TextEdit. When I call open (1) on the file I get the following error: The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-43 "fnfErr: File not found" UserInfo={_LSLine=4129, _LSFunction=_LSOpenStuffCallLocal} From the logs of my app, there is no open (2) called on the file. I have tried to (trace) dtruss the open call for Numbers/TextEdit, but when I perform the above scenario, my Mac system freezes and the piped output from dtruss is 0 bytes after rebooting my system. How can I debug my issue? Where can I find more documentation of the order of system calls for open (1)? I couldn't find the source code for renamex_np thus my implementation relied on the linux kernel implementation of renameat2, does renamex_np do something different? I note that, if I open TextEdit for example, and then open my file, there is no problem. Also calling cat for example on the terminal it displays the content correctly. The problem seems to be from open (1). Furthermore, if I perform a rename of the file, open (1) succeeds in opening the file, until I perform at least another edit from a high-level app (that calls rename with the swap flag). Also if I unmount my filesystem and mount it again, open (1) behaves correctly. How can I understand what open (1) is doing under the hood? For the high-level apps I could trace the system calls and figure out why they didn't work, but now I reached a point (scenario) where I can't trace the system calls for open (1) due to my whole system freezing. Any input is appreciated.
8
0
249
Jun ’24
bluetooth control
I am learning about endpoint security and other system extensions, while I was handling ES_EVENT_TYPE_AUTH_IOKIT_OPEN event I realized that I cannot auth deny any bluetooth events. I tried to deny any open or execute events related to com.apple.bluetoothd but it did not work. I searched google and found out that I can use CoreBluetooth to control bluetooth. But when I get connected to bluetooth keyboard or mouse, didConnectPeripheral dose not get called or when I call [central cancelPeripheralConnection:peripheral] disconnection never happens. Is there any recommendation for handling or controlling events related to bluetooth connection?
3
0
278
Jun ’24
MacOS Sonoma Wallpapers Issues
Two problems: The wallpapers available in MacOS Sonoma (public/GA release) are not working/downloading. The 'Shuffle Aerials' option to rotate through different wallpapers does not work (presumably because the wallpapers aren't downloading) and the shuffle 'Continuously' option 1) doesn't state how frequently this rotates, and 2) doesn't allow users to configure the interval.
22
10
13k
Sep ’23
Files in AppGroup secure container not accessible in FamilySharing context
I have published an application that makes use of AppGroup containers to share an sqlite database between the main application and a notification service extension. I have taken into account special file access coordination requirements for an sqlite database shared between processes (WAL, https://github.com/andpor/react-native-sqlite-storage/issues/308#issuecomment-522250831). The application is part of an educational study involving several hundred students of young age. As such, many devices are enrolled in FamilySharing where parents control access of their children. In production, records are added to the database by the main application. The notification service extension reads the database and syncs metadata with a server. Unfortunately, I'm seeing issues with database access from the extension on devices where FamilySharing is enabled. I cannot see detailed information about the issue, because Crash reporting is disabled as per guidelines of the participating institutions. Moreover, I have implemented logging in the extension such that any conventional error (do, catch) thrown by database access code would be visible to me in server logs. I cannot see errors in my log, which leads me to believe something is crashing the extension process when it tries to access the database in the AppGroup container. I cannot find any information in Apple documentation or the pertinent online forums about a special case for AppGroups in FamilySharing context. However, since I've only ever seen the issue on devices where FamilySharing is enabled, I have to assume the error lies there. Is there any undocumented special consideration for AppGroup access in FamilySharing contexts? Is an AppGroup that was created while the app was running under the child's account no longer accessible by the same application when it's running under the parent's account?
1
0
168
4w
Maximum stack space
According https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html maximum stack size is 512 KB for secondary threads, 8 MB for OS X main thread and 1 MB for iOS main thread. Can someone tell actual information about maximum stack size on different OS?
2
0
157
4w
dyld not load library with rpath if SIP disabled
I'm working on a macOS app. Due to security requirement, I add the following line in XCode other linker flags: -Wl,-sectcreate,__RESTRICT,__restrict,/dev/null But after testing, we found that app crashed at launch if system integrity protection disabled. Here is the report: System Integrity Protection: disabled Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace DYLD, Code 1 Library missing Library not loaded: @rpath/MyLib.framework/Versions/A/MyLib Referenced from: <845E83E4-9526-36F0-8A2D-ADD407697F4D> /Applications/MyApp/MyApp.app/Contents/MacOS/MyApp Reason: tried: '/System/Library/Frameworks/MyLib.framework/Versions/A/MyLib' (no such file, not in dyld cache), (security policy does not allow @ path expansion) (terminated at launch; ignore backtrace) Thread 0 Crashed: 0 dyld 0x185f3a55c __abort_with_payload + 8 1 dyld 0x185f46b10 abort_with_payload_wrapper_internal + 104 2 dyld 0x185f46b44 abort_with_payload + 16 3 dyld 0x185ecd584 dyld4::halt(char const*, dyld4::StructuredError const*) + 304 4 dyld 0x185eca254 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3884 5 dyld 0x185ec8edc start + 1844 Looks like dyld can't load rpath if restrict segment exist & SIP disabled. Is there a way to fix it? The framework & dylib files needs to be in the bundle to avoid other app using them, so point to /usr/lib is not an option. Thanks.
1
0
261
Jun ’24
App Intent Cannot Insert SwiftData items
When using App Intents, I can edit already existing SwiftData items, but I cannot insert new ones. Below are the two app intents I've used, both function in their entirety other than the model context insertion at the end of the second one. struct LinkViewedIntent: AppIntent { static var title: LocalizedStringResource = "Mark Link Viewed" @Parameter(title: "Link") var link: LinkEntity? init(link: Link) { self.link = LinkEntity(link: link) } init() {} func perform() async throws -> some IntentResult & ProvidesDialog { let entities = try await LinkEntityQuery().suggestedEntities().filter({$0.viewed == false}) guard !entities.isEmpty else { return .result(dialog: "There are no unviewed links to mark.") } var enteredLink: LinkEntity if let link = link { enteredLink = link } else { enteredLink = try await $link.requestDisambiguation( among: LinkEntityQuery().suggestedEntities(), dialog: "Which link would you like to mark viewed?" ) } let context = ModelContext(ConfigureModelContainer()) let links = try? context.fetch(FetchDescriptor<Link>()) guard let link = links?.filter({ $0.id == enteredLink.id }).first else { return .result(dialog: "An Error Occured") } if link.viewed == true { return .result(dialog: "Link is already viewed") } link.viewed = true try context.save() return .result(dialog: "Okay, \(enteredLink.name ?? enteredLink.link) has been marked as viewed.") } static var parameterSummary: some ParameterSummary { Summary("Mark \(\.$link) as viewed.") } } struct SaveLinkIntent: AppIntent { static var title: LocalizedStringResource = "Save Link" @Parameter(title: "URL") var url: URL? func perform() async throws -> some IntentResult & ProvidesDialog { let modelContext = ModelContext(ConfigureModelContainer()) var fullurl: URL if let url = url { fullurl = url } else { fullurl = try await $url.requestValue() } print(fullurl.absoluteString) guard let link = await makeLink(address: fullurl.absoluteString) else { return .result(dialog: "") } modelContext.insert(link) return .result(dialog: "I've added \(link.metadata?.title ?? link.address) to Memento") } }
1
0
297
4w
macOS15 enable system extensions failed
We have developed a system extension based on the Endpoint Security framework, but after upgrading to macOS 15 beta, the system extension fails to enable in Login Items & Extensions. The specific prompt is shown in the image , and the system log indicates an XPC connection failure. When we use the command to check the extension status, it is [activated waiting for user]. We have tried some other products that use system extensions, and they are also unable to load the system extension.
1
0
209
4w
Sequoia: Is saving print settings fixed in the beta?
Ever since the advent of Ventura, saved print settings don’t save detailed selections. Even with Sonoma, almost 2 years later, this issue is still a problem! There is a plethora of Apple Support Community topics to that end: Print settings don't work any more when upgraded to Ventura Updated to Ventura—printer presets won’t save Ventura—Custom Printer Settings not being saved Printer Not working after Ventura 13.0 update Problem saving print presets in Ventura Ventura is not saving printing presets (fully) Printing Problem with Ventura macOS Ventura (13.1) print settings don’t save—any resolution? Printer presets don’t save in Ventura Print settings are a MESS in Ventura
1
0
189
Jun ’24
where is macOS APIs including user space file system support?
Hi there, From "Platforms State of the Union" Video macOS section I know macOS has new API of user space file system and iPhone mirroring, and delivers new APIs including user space file system support and major improvements to MapKit. But I lookup the API diff, I don't find any added API. Where can I find the user space file system API ? I really want to develop an APP which need user space file system API. Platforms State of the Union Video corresponding timeline detail: https://youtu.be/YJZ5YcMsgD4?t=3153
7
1
286
Jun ’24
Issue running app when SIP disabled.
I've been developing an MacOS app for a while and everything was going smoothly until one of the testers reported that the app was crashing on launch. After investigation, we discovered that he had System Integrity Protection disabled. I could reproduce the error by disabling SIP: Library not loaded: @rpath/myframework.framework/myframework Referenced from: <4C129258-1BF8-3D30-9AFE-BF4206D0A767> /Applications/MyApp.app/Contents/MacOS/MyApp Reason: , (security policy does not allow @ path expansion) (terminated at launch; ignore backtrace) The app launches normally if I reenable SIP. I can't find information about "security policy does not allow @ path expansion". I'll appreciate if someone can point me in the right direction.
2
0
253
Jun ’24
How to Install a Binary in SIP-Protected Locations in macOS without Recovery Mode
I'm looking for a solution to install a binary on a macOS system where System Integrity Protection (SIP) is enabled, and the target installation location is protected by SIP. I need to achieve this without booting into recovery mode to disable SIP. Is there any method to achieve this, such as by creating separate packages that can handle SIP-protected locations, developing or using installer applications capable of navigating SIP constraints, leveraging specific entitlements or permissions to facilitate the installation, or utilising Mobile Device Management (MDM) solutions for deployment? If anyone has experience or insights on any reliable ways to accomplish this, please share any detailed steps, tools, or best practices that could be useful.
3
0
331
Jun ’24
NO_CRASH_STACK error on launch
After our update for Xcode 15, we got a notable increase in crashes on our React Native apps on the app launch. The logs said it's a NO_CRASH_STACK (logs attached). And it's weirdly happening mostly on iOS 16 only (we're just assuming in this part) Notes that we are using Sentry for our crash reporter, but since this crash happened at the beginning, we believe the Sentry hasn't even finished initialized yet. So we don't get any data out of it. f73729d3325dbc472c6a7c5fe2e11f0671e14b63.crash 04bf10e9a11bdd5f47f462d0e22eeec2226413fc.crash 6cdc0334d1673c66a117572b314422c15673fbef.crash
3
0
179
Jun ’24
CrashDoctor Diagnosis: Application threw exception NSInvalidArgumentException: -[_UIRemoteInputViewController _alignsToContentViewController]: unrecognized selector sent to instance 0x122917200
CrashDoctor Diagnosis: Application threw exception NSInvalidArgumentException: -[_UIRemoteInputViewController _alignsToContentViewController]: unrecognized selector sent to instance 0x122917200 Thread 0 Crashed: 0 CoreFoundation 0x00000001aa1c9e48 __exceptionPreprocess + [ : 164] 1 libobjc.A.dylib 0x00000001a34938d8 objc_exception_throw + [ : 60] 2 CoreFoundation 0x00000001aa33e82c +[NSObject(NSObject) copyDescription] 3 UIKitCore 0x00000001ad0e9d18 -[UIResponder doesNotRecognizeSelector:] + [ : 260] 4 CoreFoundation 0x00000001aa1dff60 forwarding + [ : 1592] 5 CoreFoundation 0x00000001aa248330 forwarding_prep_0 + [ : 96] 6 UIKitCore 0x00000001ac6010f0 -[UIInputWindowControllerHostingItem _aligningInsetsForChildInputViewController:includeSceneBounds:] + [ : 60] 7 UIKitCore 0x00000001ac687e7c -[UIInputWindowControllerHostingItem updateViewConstraints] + [ : 4648] 8 UIKitCore 0x00000001ac686bec -[UIInputWindowControllerHosting updateViewConstraints] + [ : 184] 9 UIKitCore 0x00000001ac706c80 -[UIInputWindowController updateViewConstraints] + [ : 84] 10 UIKitCore 0x00000001ac8c8740 -[UIInputWindowController updateForKeyplaneChangeWithContext:] + [ : 264] 11 UIKitCore 0x00000001ac901ee8 -[UIInputWindowControllerHostingItem updateForKeyplaneChangeWithContext:] + [ : 56] 12 UIKitCore 0x00000001ac59a528 -[_UIRemoteKeyboards performOnControllers:] + [ : 256] 13 UIKitCore 0x00000001ac9061d8 -[UIInputSetHostView _didChangeKeyplaneWithContext:] + [ : 148] 14 UIKitCore 0x00000001ace0ed50 __51-[UICompatibilityInputViewController setInputMode:]_block_invoke_4 + [ : 732] 15 UIKitCore 0x00000001ac8a51ec __146-[NSExtension(UIViewControllerAdditions) _instantiateViewControllerWithInputItems:asAccessory:traitCollection:listenerEndpoint:connectionHandler:]_block_invoke_3 + [ : 220] 16 libdispatch.dylib 0x00000001b17db4b4 _dispatch_call_block_and_release + [ : 32] 17 libdispatch.dylib 0x00000001b17dcfdc _dispatch_client_callout + [ : 20] 18 libdispatch.dylib 0x00000001b17eb7f4 _dispatch_main_queue_drain + [ : 928] 19 libdispatch.dylib 0x00000001b17eb444 _dispatch_main_queue_callback_4CF + [ : 44] 20 CoreFoundation 0x00000001aa25a6d8 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + [ : 16] 21 CoreFoundation 0x00000001aa23c03c __CFRunLoopRun + [ : 2036] 22 CoreFoundation 0x00000001aa240ec0 CFRunLoopRunSpecific + [ : 612] 23 GraphicsServices 0x00000001e4297368 GSEventRunModal + [ : 164] 24 UIKitCore 0x00000001ac73686c -[UIApplication _run] + [ : 888] 25 UIKitCore 0x00000001ac7364d0 UIApplicationMain + [ : 340] 26 KYE_iOS 0x0000000104c5b71c main + [main.m : 14] 27 (null) 0x00000001c8a62960 0x0 + 7661300064
5
0
331
Jan ’24