EXC_GUARD
The process violated a guarded resource protection, often related to file descriptors.
Overview
There are multiple types of guarded system resources, however most guarded resource crashes are from guarded file descriptors, which have the GUARD_TYPE_FD value in the Exception Subtype field. The operating system marks a file descriptor as guarded so that normal file descriptor APIs can’t modify them. For example, if an app closes the file descriptor used to access the SQLite file backing a Core Data store, Core Data could mysteriously crash much later on. The guard file description identifies these problems when they happen, making them easier to identify and address.
The Exception Message field contains the specific violation:
CLOSEThe process attempted to invoke
close()on a guarded file descriptor.DUPThe process attempted to invoke
dup(),dup2(), orfcntl()with theF_DUPFDorF_DUPFD_CLOEXECcommands on a guarded file descriptor.NOCLOEXECThe process attempted to remove the
FD_CLOEXECflag from a guarded file descriptor.SOCKET_IPCThe process attempted to send a guarded file descriptor through a socket.
FILEPORTThe process attempted to obtain a Mach send right for a guarded file descriptor.
WRITEThe process attempted to write to a guarded file descriptor.
The Exception Message field also identifies the specific guarded file descriptor that the process attempted to modify. To understand the context triggering this exception, consult the backtrace of the crashed thread.