Heavy SMB Workloads causing kernel to hang

Hello everyone,

I'm developing a small open source utility to synchronise M3U playlists and associated media to devices such as network shares and USB devices. During testing though, it routinely crashes my machine.

It appears that heavy SMB workloads on Monterey 12.5.1 and 12.4 eventually cause the kernel to completely hang, even when run as an unprivileged user. For reference, I am mounting an SMB3 share via Finder and using Python's shutils copy2 function to copy around 3000 ALAC files to a Synology NAS. This is on an M1 MacBook Pro with 16GB of RAM.

The process starts well, but after about 20 minutes, the machine will become increasingly unresponsive. After 30 minutes, it will become completely unresponsive - even the touchbar and haptic feedback on the touchpad will be dead by then, requiring a complete cold boot to restore.

Activity monitor and ps don't show anything out of the ordinary in terms of open file handles or memory usage, however the CPU usage of kernel_task steadily grows to around ~300%. If I can regain control of the system and stop the file copying process, eventually that figure will fall, but it takes around 10 minutes for the system to become stable again.

In any event, it shouldn't be possible for a user task in userspace to completely destroy the system in this way, especially not doing something as benign as copying files. For the record, NFS works flawlessly, presumably because it's a robust and mature implementation vs Apple's implementation of SMB which has never really worked well in my experience.

Has anyone else experienced anything similar? Is NFS the recommended protocol for people who don't want to brick their machine? Or should I just be using iCloud and Apple Music and give up with files?

In any event, it shouldn't be possible for a user task in userspace to completely destroy the system in this way, especially not doing something as benign as copying files.

Agreed. You should definitely file a bug about this. Please post your bug number, just for the record.

Apropos that, are you able to trigger the hang if you use Apple’s SMB server? That matters because, if you are, your can cast your bug report in terms of just Apple software, which avoids any ambiguity as to who’s responsible (-:

Is NFS the recommended protocol … ?

Personally I avoid NFS like the plague but… well… *shrug*

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Heavy SMB Workloads causing kernel to hang
 
 
Q