MacOS freeze when call "NSFileCoordinator :: addFilePresenter" repeatedly

MacOS freeze when call "NSFileCoordinator :: addFilePresenter" repeatedly.


Step:

1 We call the function NSFileCoordinator :: addFilePresenter to add monitoring files, the number of monitoring files exceeds 30,000, and the function addFilePresenter cannot return error code,

2 All applications cannot be opened, the command line prompts "Too many open files in system" in terminal, the system freeze

3 Root process "filecoordinationd" open many files


I have two questions:

1 Function “addFilePresenter” need to return error code when failure

2 I think this may be a system vulnerability. If the code calls function “addFilePresenter” repeatedly, the system may freeze

Replies

2 I think this may be a system vulnerability. If the code calls function “addFilePresenter” repeatedly, the system may freeze

If you think you’ve found a security problem, you should report it as a bug. Please post your bug number, just for the record.

1 Function “addFilePresenter” need to return error code when failure

You could certainly file an enhancement request requesting that, but I think you need to adjust your expectations here.

NSFileCoordinator
was not designed for monitoring 30,000 files.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"