Hi! Our [v]syslog() implementation in src/lib/libc/gen/syslog.c tries to be thread-safe and uses "syslog_mutex". It may lock this mutex then call blocking system calls like sendto(). If a thread owning this mutex is pthread_cancel()'d in process, the mutex stays UMUTEX_CONTESTED and every other thread calling [v]syslog() deadlocks. I can reproduce this with net/mpd5 daemon reliably within some seconds from the beginning of my stress test involving RADIUS so mpd5 runs multi-threaded. This problem seems to be root cause of multiple complaints about mpd5 being unstable under FreeBSD 9.x+ version (PR: 186114, 214482). There is a patch by Konstantin Belousov solving this problem attached to the PR 186114: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=183537
If I understand correctly, this is already fixed in 12, 11, and 10 by r320052, r320311, and r320312, respectively.