From owner-freebsd-current@FreeBSD.ORG Thu Apr 29 08:49:55 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E56E16A4CE for ; Thu, 29 Apr 2004 08:49:55 -0700 (PDT) Received: from mail.a-quadrat.at (mail.a-quadrat.at [81.223.141.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2C6F43D5C for ; Thu, 29 Apr 2004 08:49:54 -0700 (PDT) (envelope-from mbretter@a-quadrat.at) Received: from localhost (localhost.a-quadrat.at [127.0.0.1]) by mail.a-quadrat.at (Postfix) with ESMTP id 0E11C5D025 for ; Thu, 29 Apr 2004 17:49:54 +0200 (CEST) Received: from mail.a-quadrat.at ([127.0.0.1]) by localhost (files.a-quadrat.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 37379-09 for ; Thu, 29 Apr 2004 17:49:52 +0200 (CEST) Received: from a-quadrat.at (files.a-quadrat.at [192.168.90.9]) by mail.a-quadrat.at (Postfix) with ESMTP id 909C75C3CA for ; Thu, 29 Apr 2004 17:49:52 +0200 (CEST) Message-ID: <4091241D.7020501@a-quadrat.at> Date: Thu, 29 Apr 2004 17:49:49 +0200 From: Michael Bretterklieber User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.6) Gecko/20040113 X-Accept-Language: de-at, de, en-us, en MIME-Version: 1.0 To: current@FreeBSD.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at a-quadrat.at Subject: libthr, libpthread problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2004 15:49:55 -0000 Hi, currently I'm testing Mpd-4 on -current and It ran into deadlock, therefore I changed the lib mapping via libmap.conf. When using libc_r everything is ok, when using libpthread a deadlock occurs under some circumstances, when using libthr, then: elvis:/home/mbretter/mpd/src# ./mpd Multi-link PPP for FreeBSD, by Archie L. Cobbs. Based on iij-ppp, by Toshiharu OHNO. The mutex recurse count cannot be less than zero Abnormal termination, file: /usr/src/lib/libthr/thread/thr_mutex.c, line: 677 Abort trap (core dumped) #0 0x282dd48b in thr_kill () from /lib/libc.so.5 (gdb) bt #0 0x282dd48b in thr_kill () from /lib/libc.so.5 #1 0x28287e9f in _pthread_kill (pthread=0x808e000, sig=6) at /usr/src/lib/libthr/thread/thr_sig.c:94 #2 0x28287aab in _raise (sig=6) at /usr/src/lib/libthr/thread/thr_syscalls.c:282 #3 0x2833ff4f in abort () from /lib/libc.so.5 #4 0x2828a9bf in mutex_unlock_common (mutex=0x281460b0, add_reference=0) at /usr/src/lib/libthr/thread/thr_mutex.c:712 #5 0x2828a664 in __pthread_mutex_unlock (mutex=0x281460b0) at /usr/src/lib/libthr/thread/thr_mutex.c:587 #6 0x28127251 in typed_mem_realloc () from /usr/local/lib/libpdel.so.0 #7 0x281275b2 in typed_mem_strdup () from /usr/local/lib/libpdel.so.0 #8 0x28127672 in typed_mem_vasprintf () from /usr/local/lib/libpdel.so.0 #9 0x2812b4b1 in valog () from /usr/local/lib/libpdel.so.0 #10 0x0806b610 in vlogprintf (fmt=0x0, ap=0x0) at log.c:516 #11 0x0806af9e in LogPrintf (fmt=0x80824c0 "mpd: pid %lu, version %s") at log.c:273 #12 0x0806ba56 in Greetings () at main.c:249 #13 0x0806b71a in main (ac=-1077941372, av=0xbfbfecf0) at main.c:159 #14 0x0804b23e in _start () any ideas, is this a bug in the application itself or libthr specific? If I'm using libpthread, then it works, but sometimes Mpd gets deadlocked (after terminating a thread and acquiring Mpd's internal "giant mutex"). elvis:/home/mbretter/mpd/src# ps -p 7558 -H PID TT STAT TIME COMMAND 7558 p0 SL 0:00.12 ./mpd 7558 p0 SL 0:00.12 ./mpd 7558 p0 SL 0:00.12 ./mpd and state of the process is "kserel". When Using libc_r everything works fine. I also tried to attach gdb to the running process (when Mpd was deadlocked), but this didn't worked, gdb als gets locked then. The machine has installed a -current dated of yesterday, using a non-smp kernel. bye, -- ------------------------------- ---------------------------------- Michael Bretterklieber - http://www.bretterklieber.com A-Quadrat Automation GmbH - http://www.a-quadrat.at Tel: ++43-(0)3172-41679 - GSM: ++43-(0)699 12861847 ------------------------------- ---------------------------------- "...the number of UNIX installations has grown to 10, with more expected..." - Dennis Ritchie and Ken Thompson, June 1972