Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jun 2017 09:46:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 220151] [libc] syslog() thread unsafety: mutex lock leak
Message-ID:  <bug-220151-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220151

            Bug ID: 220151
           Summary: [libc] syslog() thread unsafety: mutex lock leak
           Product: Base System
           Version: 11.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: eugen@freebsd.org

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 th=
e PR
186114: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D183537

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-220151-8>