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

Post

Replies

Boosts

Views

Activity

Standard C++ thread sleep timers exceed expected time on ARM based Mac Mini
When executing timing benchmarks on macOs we see a much more variable sleep time relative to Linux on arm64 or Linux on x86_64 . If we have a timing loop firing every 16ms, we frequently see timings of 20+ms. We have turned off timer coalescing using sudo /usr/sbin/sysctl -w kern.timer.coalescing_enabled=0 But we are still seeing lots of spikes in expected period as compared to Linux. Is there anything we can further do to stabilize the timing of our macOs host and improve timer performance? Are there any settings we can alter (similar to the one above) to get more accurate timing performance? Example: These are sleeps that are used with standard C++ functions like std::this_thread::sleep_until() This is measured by having a loop printing the current system time and sleeping as above for (int i = 0; i < ITERATIONS; i++) { printf("%llu\n", current_time_ns()); std::this_thread::sleep_until(std::chrono::steady_clock::now() + std::chrono::milliseconds(16)) } The same code was compiled for arm64 macOS arm64 Linux x86_x64 Linux And was found to be far more variable in the macOS arm64 case.
0
0
32
4h
MacOS 15.X upgrade has ruined my built-in camera quality
MacBook Pro, 16-inch, Apple M1 Max, Sequoia 15.1 — Latest MacOS upgrade has ruined my built-in camera image quality. Before the update, Photo Booth video, Zoom, video, Slack, video image quality was great. How it look like I have a $200 POS computer. $3500 for a relatively new laptop and your uopgrade has ruined my appearance to the digirtal world. Fix this ASAP please!
1
0
39
6h
Bonjour Print - Credential retention Issue with iOS 17 and higher.
Scenario: While doing an IPP based iOS printing from an iOS 17 device, the device keeps on asking for credentials (once the phone is idle). On entering the credentials, the Print is successful. Similar issue is there with iOS 18, where they are constantly getting prompts asking for credentials. The issue is not observed in iOS 16, even after 2-3days if we print it’s not asking for any credentials in iOS16. So, we would like some help to understand the difference in this behavior and possible solution or fix for this issue been identified. STEPS TO REPRODUCE Configured native printing. Installed bonjour on server. Printer is displayed on iOS devices. Users see the printer and are asked for credentials and can print Phone and the Server/Printer used for printing are all on same network
1
0
25
11h
copyfile causes NSPOSIXErrorDomain 12 "Cannot allocate memory" when copying symbolic link from NTFS partition
I was able to confirm with a customer of mine that calling copyfile with a source file that is a symbolic link on a NTFS partition always causes the error NSPOSIXErrorDomain 12 Cannot allocate memory They use NTFS drivers from Paragon. They tried copying a symbolic link from NTFS to both APFS and NTFS with the same result. Is this an issue with macOS, or with the NTFS driver? Copying regular files on the other hand always works. Copying manually from the Finder also seems to always work, both with regular files and symbolic links, so I'm wondering how the Finder does it. Here is the sample app that they used to reproduce the issue. The first open panel allows to select the source directory and the second one the destination directory. The variable filename holds the name of the symbolic link to be copied from the source to the destination. Apparently it's not possible to select a symbolic link directly in NSOpenPanel, as it always resolves to the linked file. @main class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ notification: Notification) { let openPanel = NSOpenPanel() openPanel.canChooseDirectories = true openPanel.canChooseFiles = false openPanel.runModal() let filename = "Modules" let source = openPanel.urls[0].appendingPathComponent(filename) openPanel.runModal() let destination = openPanel.urls[0].appendingPathComponent(filename) do { let state = copyfile_state_alloc() defer { copyfile_state_free(state) } var bsize = UInt32(16_777_216) if copyfile_state_set(state, UInt32(COPYFILE_STATE_BSIZE), &amp;bsize) != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } if copyfile_state_set(state, UInt32(COPYFILE_STATE_STATUS_CB), unsafeBitCast(copyfileCallback, to: UnsafeRawPointer.self)) != 0 || copyfile_state_set(state, UInt32(COPYFILE_STATE_STATUS_CTX), unsafeBitCast(self, to: UnsafeRawPointer.self)) != 0 || copyfile(source.path, destination.path, state, copyfile_flags_t(COPYFILE_NOFOLLOW)) != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } } catch { let error = error as NSError let alert = NSAlert() alert.messageText = "\(error.localizedDescription)\n\(error.domain) \(error.code)" alert.runModal() } } private let copyfileCallback: copyfile_callback_t = { what, stage, state, src, dst, ctx in if what == COPYFILE_COPY_DATA { if stage == COPYFILE_ERR { return COPYFILE_QUIT } var size: off_t = 0 copyfile_state_get(state, UInt32(COPYFILE_STATE_COPIED), &amp;size) } return COPYFILE_CONTINUE } }
1
0
86
1d
Rossetta Linux fails with recent kernels>=6.11
Hi, please see detailed findings on: https://github.com/utmapp/UTM/discussions/6799 basically apps that runned via Rosetta Linux now fail in kernels>=6.11 like the included in Ubuntu 24.10 with: /media/rosetta/rosetta hello assertion failed [hash_table != nullptr]: Failed to find vdso DT_HASH (Vdso.cpp:78 get_vdso_dynamic_data) Trace/breakpoint trap the issue seems to be due to this commit. https://github.com/torvalds/linux/commit/48f6430505c0b0498ee9020ce3cf9558b1caaaeb
1
0
49
1d
Call Blocking and Identification Issue in iOS 18
When Call Blocking and Identification is enabled, information such as Caller Name, number and Call Identification Label is displayed correctly in the incoming call screen. But in Recents screen the call record is not displaying any name or number but instead displays only the Call Identification label that was passed in CXCallDirectoryProvider is displayed. Note: This issue is not observed when the call blocking and identification permission is not granted and the same code is working fine in iOS 17.x
0
0
59
2d
Background fetching data not work
Hello, I have a some problem with background fetch. In my app I use background modes for fetch data and display on my home widget iPhone. Its working correct when I built app on my phone from Xcode but when I distribute my app on TestFlight my home widget not updating at all. Help me understand if this issue is only due to TestFlight resources, or should I try releasing the app and hope that it will work in the release version?
1
0
141
2d
Does iOS Automatically Reconnect to Disconnected BLE Devices, or Is It App-Driven?
Does iOS Automatically Reconnect to Disconnected BLE Devices, or Is It App-Driven? I have a few questions regarding BLE device reconnections in iOS: When a BLE device gets disconnected, does iOS automatically attempt to reconnect to it, or is it the app’s responsibility to handle the reconnection logic? If the app doesn’t initiate a BLE scan, will the OS still attempt to reconnect to previously paired devices, or is manual intervention by the app necessary? What is the recommended approach to re-establish a BLE connection when: The app has been deleted. The BLE device remains connected in the iPhone's Bluetooth settings. The app is reinstalled later. Any insights or best practices would be greatly appreciated!
0
0
38
2d
Kernel panic in mac_label_verify()
Accessing a directory on my custom distributed filesystem results in a kernel panic. According to the backtrace, the last function called before the panic is triggered is mac_label_verify(). See the backtrace file attached. mac_label_verify-panic.txt The panic manifests itself given the following conditions: Machine-a: make a directory in Finder. Machine-b: remove the directory created on machine-a in Finder. Machine-a: access the directory removed on machine-b in Finder. Kernel panic ensues. The panic is reproducible on both Apple Silicon and x86-64. The backtrace is for x86-64 as I wasn't able to symbolicate it on Apple Silicon. Not sure how to tackle this one. Any pointers would be much appreciated.
2
0
100
3d
Getting process info for other processes?
I'd like to be able to do the equivalent of getrusage(3) for some of our other processes. These are daemons, so they're not connected in any way. Obviously, Activity Monitor and top can do the things I want, but I'm not Apple. 😄 I went down a maze of twisty APIs, all a-Mach, and have decided to ask. (We're trying to keep track of the processes in the field. We also want to know what's going on if a process has stopped responding but hasn't died. I suppose I could, absolute worst case, periodically send getrusage(3) info to the monitoring process.)
5
0
87
3d
iOS Application Bluetooth Permission
Is it possible for the Bluetooth permissions of an app to be turned off due to changes in the iOS application's Bluetooth library, possibly because of Apple's security requirements or OS-related factors? There are two applications, Application A and Application B, that control Bluetooth devices. Application A uses a third-party Bluetooth library to control the Bluetooth devices. Application B also uses a third-party Bluetooth library to control the Bluetooth devices. The Bluetooth libraries used by Application A and Application B are different, but both applications work without any issues. However, when the Bluetooth library used in Application B was changed to the one used in Application A, the Bluetooth permissions for Application B sometimes turned off. Since Application A and Application B operate without any issues on their own, we believe the problem is not with the Bluetooth libraries themselves. Given the above situation, is it possible that changing the Bluetooth library used could cause the Bluetooth permissions of the app to be turned off due to Apple's security requirements or OS-related factors?
1
0
78
3d
Developing a driver to read HFS disks on MacOS Sonoma and newer
Capability to read and write ofd HFS disks on Mac has been removed since a long time. Capability to simply read was also removed since Catalina I think. That is surprising and sometimes frustrating. I still use a 90's MacBook for a few tasks and need from time to time to transfer files to newer Mac or read some old files stored on 3.5" disks. Solution I use is to read the disk on an old Mac with MacOS 10.6 (I'm lucky enough to have kept one) and transfer to USB stick or airdrop… As there is no USB port on the Macbook of course (and I have no more a working 56k modem to transfer by mail), only option if not 3,5" disk is using PCMCIA port on the MacBook for writing to an SD Card to be read in Mac Sonoma. But reading directly 3.5" disk would be great. Hence my questions for the forum: how hard would it be to write such a driver for READING only HFS on Mac Sonoma? There are some software like FuseHFS. Did anyone experience it ? Did anyone have a look at the source code (said to be open source). does anyone know why Apple removed such capability (I thought it was a tiny piece of code compared to the GB of present MacOS)? Thanks for any insights on the matter.
2
0
128
4d
Nested Hyper-V Support for VM's
Hello! I am wondering about the status of Nested Hyper-V Support for VM's? This is specifically regarding this issue with Parallels Desktop, which claims the issue is on Apple's side: Parallels Article: https://kb.parallels.com/en/116239 Within the Article, the no longer accessible previous Apple discussion post for this issue (at least I cannot access it): https://discussions.apple.com/thread/255546412 Is this something that will be fixed and supported soon? Thank you! (If this should be posted somewhere else please just let me know where!)
1
0
92
5d
Unexpected Permission denied error on file sharing volume
I am getting recurring errors running code on macOS 15.1 on arm that is using a volume mounted from a machine running macOS 14.7.1 on x86. The code I am running copies files to the remote volume and deletes files and directories on the remote volume. The files and directories it deletes are typically files it previously had copied. The problem is that I get permission failures trying to delete certain directories. After this happens, if I try to list the directory using Terminal on the 15.1 system, I get a strange error: ls -lA TestVAppearances.app/Contents/runtime-arm/Contents total 0 ls: fts_read: Permission denied If I try to list the directory on the target (14.7.1) system, there is no error: TestVAppearances.app/Contents/runtime-arm/Contents: total 0
2
0
111
5d
APFS snapshot revert
I'm trying to restore an APFS volume to its previous state using a snapshot created with the tmutil command. The only native Apple tool I've found for this purpose is apfs.util. According to the documentation, the correct command for this task is /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -R </dev/diskXsY>. However, this command is not working for me. It returns the error "No such file or directory" for any existing . If I use a valid file/dir path instead of the as an experiment, I get an "Invalid argument" error. To investigate the issue, I decided to debug apfs.util and found that the fsctl() function is responsible for these errors (ENOENT and EINVAL). The first argument passed to fsctl() is the (or file/dir path in my experiment), and the second argument is the value 0x80084A01, which corresponds to the APFSIOC_REVERT_TO_SNAPSHOT command according to xnu's source code (https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/vfs/vfs_syscalls.c#L174). It seems that this command is not supported by the latest versions of macOS (see https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/vfs/vfs_syscalls.c#L12984) and always returns EINVAL error. Is this correct? Are there any other tools available that can be used to revert APFS snapshots?
3
0
128
1w
Memory leak when using OSLogStore in a loop
Hello, I am currently working on a project that involves periodically querying OSLog to forward system log entries to a backend. While the functionality generally operates as expected, I have encountered a memory leak in my application. Through testing, I have isolated the issue to the following simplified code example: #import <Foundation/Foundation.h> #import <OSLog/OSLog.h> int main(int argc, const char * argv[]) { @autoreleasepool { while(1) { NSError *error = nil; OSLogStore *logStore = [OSLogStore storeWithScope:OSLogStoreSystem error:&error]; if (!logStore) NSLog(@"Failed to create log store: %@", error); sleep(1); } } return 0; } When running this example, the application exhibits increasing memory usage, consuming an additional 100 to 200 KB per iteration, depending on whether the build is Debug or Release. Given that Automatic Reference Counting is enabled, I anticipated that the resources utilized by logStore would be automatically released at the end of each iteration. However, this does not appear to be the case. Am I using the API wrong? I would appreciate any insights or suggestions on how to resolve this issue. Thank you.
2
0
119
1w
M4 devices - VMs pre 13.4 fail to boot
Hi, It seems that on M4 devices any virtual machine with macOS version older than 13.4 fail to boot, they stuck with a black screen. This is regardless of the virtualization software used (UTM, VirtualBuddy, Viable, etc...). After talking to many people everyone experiences the same. At least for me, this is a massive limitation of the platform, I really hope this is a bug which can be fixed. Thanks, Csaba
6
6
470
1w
Kernel Panic after update of macOS
Hi I have some problems with my macOS after updating to Sonoma. I am running a intel based MacBookPro 2018. After update to Sonoma I had some Kernel panic. Log attached. Also I had some problems running my LaunchDaemon for starting macFUSE and connecting to SSHFS. This used to work before. Now, my plan forward is to restore a backup from the MacBook before update. I will restore the backup and remove any redundant/not in use .plist jobs ( especially ) LaunchDaemon jobs. When this is done I will try to update macOS again. I have many .plist jobs also Daemon. Please supply information on how I can remove any redundant / not in use .plist jobs. I belive the reason for the kernel panic was the io.macfuse.filesystems.macfuse.23 4.7.2. ( attached log ) I want to keep the io.macfuse.filesystems.macfuse.23 4.7.2 , but I want to remove other kexts not in use and other .plist not in use. Please supply info in how to identify redundant kexts not in use and redundant .plist not in use. How do I know if the induvidual kexts is needed or not ? Best regards Tormod Willassen Kernel_Panic.rtf log-file log-file
0
0
99
1w