From owner-freebsd-threads@FreeBSD.ORG Mon May 16 11:02:05 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DCA016A4E4 for ; Mon, 16 May 2005 11:02:05 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 034FB43D41 for ; Mon, 16 May 2005 11:02:05 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4GB23Xd021411 for ; Mon, 16 May 2005 11:02:03 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4GB22dV021405 for freebsd-threads@freebsd.org; Mon, 16 May 2005 11:02:02 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 16 May 2005 11:02:02 GMT Message-Id: <200505161102.j4GB22dV021405@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 11:02:05 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/01/26] threads/76690threads fork hang in child for (-lc_r & -lthr) o [2005/05/11] threads/80887threads ULE with SMP broke libpthread/libthr on 5 2 problems total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] kern/20861 threads libc_r does not honor socket timeouts o [2001/01/20] threads/24472threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] threads/24632threads libc_r delicate deviation from libc in ha o [2001/01/25] kern/24641 threads pthread_rwlock_rdlock can deadlock o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] threads/34536threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] threads/39922threads [PATCH?] Threaded applications executed w o [2002/08/04] kern/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] threads/48856threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] threads/49087threads Signals lost in programs linked with libc o [2003/05/08] threads/51949threads thread in accept cannot be cancelled s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/08/26] threads/70975threads unexpected and unreliable behaviour when o [2004/09/14] threads/71725threads Mysql Crashes frequently giving Sock Erro o [2004/10/05] threads/72353threads Assertion fails in /usr/src/lib/libpthrea o [2004/10/07] threads/72429threads threads blocked in stdio (fgets, etc) are o [2004/10/21] threads/72953threads fork() unblocks blocked signals w/o PTHRE o [2004/12/19] threads/75273threads FBSD 5.3 libpthread (KSE) bug o [2004/12/21] threads/75374threads pthread_kill() ignores SA_SIGINFO flag o [2005/01/04] threads/75795threads applications linked with -lc_r can't clos o [2005/01/26] threads/76694threads fork cause hang in dup()/close() function o [2005/03/10] threads/78660threads Java hangs unkillably in STOP state after o [2005/04/08] threads/79683threads svctcp_create() fails if multiple threads o [2005/04/28] threads/80435threads panic on high loads 26 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/26] kern/18824 threads gethostbyname is not thread safe o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2000/10/21] kern/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] threads/30464threads pthread mutex attributes -- pshared o [2002/05/02] threads/37676threads libc_r: msgsnd(), msgrcv(), pread(), pwri s [2002/07/16] threads/40671threads pthread_cancel doesn't remove thread from o [2004/07/13] threads/69020threads pthreads library leaks _gc_mutex o [2004/09/21] threads/71966threads Mlnet Core Dumped : Fatal error '_pq_inse o [2004/11/21] threads/74180threads KSE problem. Applications those riched ma o [2005/01/20] threads/76513threads libpthread is not working o [2005/04/13] threads/79887threads [patch] freopen() isn't thread-safe o [2005/05/13] threads/80992threads abort() sometimes not caught by gdb depen 12 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue May 17 06:17:43 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 653CE16A4D0 for ; Tue, 17 May 2005 06:17:43 +0000 (GMT) Received: from udciscan05.udc.trendmicro.com (udciscan05.udc.trendmicro.com [66.35.255.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id C67BC43D6B for ; Tue, 17 May 2005 06:17:37 +0000 (GMT) (envelope-from Ady_Li@trendmicro.com.cn) Received: from localhost-imss.udc.trendmicro.com (localhost [127.0.0.1]) by udciscan05.udc.trendmicro.com (Postfix) with ESMTP id 3E42818264A for ; Mon, 16 May 2005 23:16:31 -0700 (PDT) Received: from udcexbh04-vs2.us.trendnet.org (udcexbh04.udc.trendmicro.com [66.35.252.74]) by udciscan05.udc.trendmicro.com (Postfix) with ESMTP id EF491182680 for ; Mon, 16 May 2005 23:16:30 -0700 (PDT) Received: from adcexbh01.tw.trendnet.org ([202.133.236.201]) by udcexbh04-vs2.us.trendnet.org with Microsoft SMTPSVC(6.0.3790.211); Mon, 16 May 2005 23:17:31 -0700 Received: from cnexmail02.cn.trendnet.org ([10.28.144.3]) by adcexbh01.tw.trendnet.org with Microsoft SMTPSVC(6.0.3790.211); Tue, 17 May 2005 14:17:26 +0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Date: Tue, 17 May 2005 14:17:25 +0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: malloc(): error: malloc recursive Thread-Index: AcVaqBduMkAxi+SkRv2eXp0CG9hiCw== From: To: X-OriginalArrivalTime: 17 May 2005 06:17:26.0217 (UTC) FILETIME=[1882FB90:01C55AA8] Subject: malloc(): error: malloc recursive X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2005 06:17:43 -0000 when i wrote a multi-pthread program in fbsd,=0D at the first few second, it would core out with "malloc(): error: malloc= recursive" or=0D "free(): error: malloc recursive", there are more similar question in the= maillist,=0D but i still do not know how to solved it=2E CC_FLAGS=3D -g -O -fPIC #-DTHREAD -DDEBUG LPTHREAD=3D-lpthread -D_THREAD_SAFE -D_REENTRANT VCC_FLAGS=3D -g -O -fPIC -DFBSD -DFBSD2 -DFBSD3 -DFBSD4 -DIMPORT_VSAPI= $(LPTHREAD) #-DTHREAD -DDEBUG LD=3Dg++ LD_FLAGS=3D -g -O -fPIC -shared #-DTHREAD -DDEBUG kernel: FreeBSD ady_li_fbsd=2Eclient=2Ecn=2Etrendnet=2Eorg 5=2E3-RELEASE= FreeBSD 5=2E3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004 root@harlow= =2Ecse=2Ebuffalo=2Eedu:/usr/obj/usr/src/sys/GENERIC i386 Best Regards, Ady Li [TEL](86)25-84510988-656 =0D TREND MICRO EMAIL NOTICE The information contained in this email and any attachments is confidential= and may be subject to copyright or other intellectual property protection= =2E If you are not the intended recipient, you are not authorized to use or= disclose this information, and we request that you notify us by reply mail= or telephone and delete the original message from your mail system=2E From owner-freebsd-threads@FreeBSD.ORG Tue May 17 06:54:09 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5953E16A4CE for ; Tue, 17 May 2005 06:54:09 +0000 (GMT) Received: from udciscan05.udc.trendmicro.com (udciscan05.udc.trendmicro.com [66.35.255.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDEB343D73 for ; Tue, 17 May 2005 06:54:08 +0000 (GMT) (envelope-from Ady_Li@trendmicro.com.cn) Received: from localhost-imss.udc.trendmicro.com (localhost [127.0.0.1]) by udciscan05.udc.trendmicro.com (Postfix) with ESMTP id B39DF182764 for ; Mon, 16 May 2005 23:53:07 -0700 (PDT) Received: from udcexbh04-vs2.us.trendnet.org (udcexbh04.udc.trendmicro.com [66.35.252.74]) by udciscan05.udc.trendmicro.com (Postfix) with ESMTP id 86640182758 for ; Mon, 16 May 2005 23:53:07 -0700 (PDT) Received: from adcexbh02.tw.trendnet.org ([202.133.236.202]) by udcexbh04-vs2.us.trendnet.org with Microsoft SMTPSVC(6.0.3790.211); Mon, 16 May 2005 23:54:07 -0700 Received: from cnexmail01.cn.trendnet.org ([10.28.128.10]) by adcexbh02.tw.trendnet.org with Microsoft SMTPSVC(6.0.3790.211); Tue, 17 May 2005 14:54:19 +0800 Received: from cnexmail02.cn.trendnet.org ([10.28.144.3]) by cnexmail01.cn.trendnet.org with Microsoft SMTPSVC(5.0.2195.6713); Tue, 17 May 2005 14:54:03 +0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Date: Tue, 17 May 2005 14:54:03 +0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: malloc(): error: malloc recursive Thread-Index: AcVaqBduMkAxi+SkRv2eXp0CG9hiCwABObVw From: To: X-OriginalArrivalTime: 17 May 2005 06:54:03.0678 (UTC) FILETIME=[364CEBE0:01C55AAD] Subject: FW: malloc(): error: malloc recursive X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2005 06:54:09 -0000 hi all, > when i wrote a multi-pthread program in fbsd,=0D > at the first few second, it would core out with "malloc(): error: malloc= recursive" or=0D > "free(): error: malloc recursive", there are more similar question in= the maillist,=0D > but i still do not know how to solved it=2E >=0D > CC_FLAGS=3D -g -O -fPIC #-DTHREAD -DDEBUG > LPTHREAD=3D-lpthread -D_THREAD_SAFE -D_REENTRANT > VCC_FLAGS=3D -g -O -fPIC -DFBSD -DFBSD2 -DFBSD3 -DFBSD4 -DIMPORT_VSAPI= $(LPTHREAD) #-DTHREAD -DDEBUG > LD=3Dg++ > LD_FLAGS=3D -g -O -fPIC -shared #-DTHREAD -DDEB kernel: FreeBSD ady_li_fbsd=2Eclient=2Ecn=2Etrendnet=2Eorg 5=2E3-RELEASE= FreeBSD 5=2E3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004 root@harlow= =2Ecse=2Ebuffalo=2Eedu:/usr/obj/usr/src/sys/GENERIC i386 $ gdb dispatcher dispatcher=2Ecore GNU gdb 6=2E1=2E1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc=2E GDB is free software, covered by the GNU General Public License, and you= are welcome to change it and/or distribute copies of it under certain= conditions=2E Type "show copying" to see the conditions=2E There is absolutely no warranty for GDB=2E Type "show warranty" for= details=2E This GDB was configured as "i386-marcel-freebsd"=2E=2E=2E Core was generated by `dispatcher'=2E Program terminated with signal 6, Aborted=2E Reading symbols from /usr/lib/libstdc++=2Eso=2E4=2E=2E=2Edone=2E Loaded symbols for /usr/lib/libstdc++=2Eso=2E4 Reading symbols from /lib/libm=2Eso=2E3=2E=2E=2Edone=2E Loaded symbols for /lib/libm=2Eso=2E3 Reading symbols from /lib/libc=2Eso=2E5=2E=2E=2Edone=2E Loaded symbols for /lib/libc=2Eso=2E5 Reading symbols from /home/ady/SinaScanner2= =2E0/SinaScannerService/mailscanner/product/1=2E0=2E0000/dispatcher=2Eso=2E= =2E=2Edone=2E Loaded symbols for /home/ady/SinaScanner2= =2E0/SinaScannerService/mailscanner/product/1=2E0=2E0000/dispatcher=2Eso Reading symbols from /usr/lib/libpthread=2Eso=2E1=2E=2E=2Edone=2E Loaded symbols for /usr/lib/libpthread=2Eso=2E1 Reading symbols from /libexec/ld-elf=2Eso=2E1=2E=2E=2Edone=2E Loaded symbols for /libexec/ld-elf=2Eso=2E1 #0 0x281b11d7 in kill () from /lib/libc=2Eso=2E5 (gdb) where #0 0x281b11d7 in kill () from /lib/libc=2Eso=2E5 #1 0x281a627e in raise () from /lib/libc=2Eso=2E5 #2 0x28218627 in abort () from /lib/libc=2Eso=2E5 #3 0x28116a1d in __gnu_cxx::__verbose_terminate_handler () from= /usr/lib/libstdc++=2Eso=2E4 #4 0x2811b16e in __cxxabiv1::__terminate () from /usr/lib/libstdc++=2Eso= =2E4 #5 0x2811b1a4 in std::terminate () from /usr/lib/libstdc++=2Eso=2E4 #6 0x2811b0f9 in __cxa_throw () from /usr/lib/libstdc++=2Eso=2E4 #7 0x2811e0f2 in operator new () from /usr/lib/libstdc++=2Eso=2E4 #8 0x280c3aef in __gnu_cxx::new_allocator::allocate () from= /usr/lib/libstdc++=2Eso=2E4 #9 0x280d7a56 in std::string::_Rep::_S_create () from /usr/lib/libstdc++= =2Eso=2E4 #10 0x280d82ab in std::string::_S_construct () from= /usr/lib/libstdc++=2Eso=2E4 #11 0x280d5094 in std::basic_string,= std::allocator >::basic_string () from /usr/lib/libstdc++=2Eso=2E4 #12 0x28251c83 in CBasePolicies::SetPolicy (this=3D0xbf8f6ed4, pstrName= =3D0xbf8f6624 "FILE",=0D pstrValue=3D0xbf8f6214= "/home/ady/SinaScannerService/mailscanner/dispatcher") at /home/ady/SinaScanner2= =2E0/SinaScannerService/src/dispatcher/baseclass=2Ecpp:26 #13 0x282513b6 in CMsgWrapper::UnEncapsulate (this=3D0x28270b8c,=0D pstrMsg=3D0x806d01c "REQUEST/2= =2E0\r\nTASK:Single\r\nFILE:/home/ady/SinaScannerService/mailscanner/dispat= cher\r\nACTN:ScanOnly\r\nREQUEST/2= =2E0\r\nTASK:Single\r\nFILE:/home/ady/SinaScannerService/mailscanner/dispat= cher\r\nACTN:ScanOnly\r\n\r\n", nMsgSize=3D200, nMsgOffset=3D@0xbf8f6aac,= objPolicies=3D@0xbf8f6ed4) at /home/ady/SinaScanner2= =2E0/SinaScannerService/src/dispatcher/msgwrapper=2Ecpp:292 #14 0x28259407 in RecvRequest (p=3D0x0) at /home/ady/SinaScanner2= =2E0/SinaScannerService/src/dispatcher/dispatcher=2Ec:1427 #15 0x2828539f in pthread_mutexattr_init () from /usr/lib/libpthread=2Eso= =2E1 #16 0x00000000 in ?? () (gdb)=0D > Best Regards, > Ady Li > [TEL](86)25-84510988-656 > =0D >=0D TREND MICRO EMAIL NOTICE The information contained in this email and any attachments is confidential= and may be subject to copyright or other intellectual property protection= =2E If you are not the intended recipient, you are not authorized to use or= disclose this information, and we request that you notify us by reply mail= or telephone and delete the original message from your mail system=2E From owner-freebsd-threads@FreeBSD.ORG Thu May 19 07:26:33 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E010816A4CE for ; Thu, 19 May 2005 07:26:33 +0000 (GMT) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 235CF43D82 for ; Thu, 19 May 2005 07:26:33 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: from beastie.frontfree.net (unknown [219.239.99.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id DAFB4EB35DD for ; Thu, 19 May 2005 15:26:29 +0800 (CST) Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 83CA3139D91; Thu, 19 May 2005 15:26:20 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06856-18; Thu, 19 May 2005 15:26:13 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 84DA8132C1A; Thu, 19 May 2005 15:26:12 +0800 (CST) Date: Thu, 19 May 2005 15:26:12 +0800 From: Xin LI To: Ady_Li@trendmicro.com.cn Message-ID: <20050519072612.GA7922@frontfree.net> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.3-RELEASE-p2 FreeBSD 5.3-RELEASE-p2 #15: Wed Dec 15 10:43:16 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net cc: freebsd-threads@freebsd.org Subject: Re: malloc(): error: malloc recursive X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 07:26:34 -0000 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 17, 2005 at 02:17:25PM +0800, Ady_Li@trendmicro.com.cn wrote: > when i wrote a multi-pthread program in fbsd,=0D > at the first few second, it would core out with "malloc(): error: malloc= recursive" or=0D > "free(): error: malloc recursive", there are more similar question in th= e maillist,=0D > but i still do not know how to solved it. Do you use signal handlers in your program? I think this might happen if you call allocation function within signal handlers, which should be avoided. Would you please share a piece of the code which can trigger the situation if this does not help? Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCjD+U/cVsHxFZiIoRAi8/AJ0X8DWeXwmD3tFNXqcr5YthPRwKTQCeLrte eLHKgDusANFoWRQJwcCL+UQ= =FUEn -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/-- From owner-freebsd-threads@FreeBSD.ORG Thu May 19 11:40:08 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE6B716A4D5 for ; Thu, 19 May 2005 11:40:08 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52B9743D1D for ; Thu, 19 May 2005 11:40:08 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4JBe8WN003101 for ; Thu, 19 May 2005 11:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4JBe80s003099; Thu, 19 May 2005 11:40:08 GMT (envelope-from gnats) Resent-Date: Thu, 19 May 2005 11:40:08 GMT Resent-Message-Id: <200505191140.j4JBe80s003099@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jens Nilsson Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9E8216A4CE for ; Thu, 19 May 2005 11:38:35 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B2E6A43DB6 for ; Thu, 19 May 2005 11:38:35 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j4JBcZcD040532 for ; Thu, 19 May 2005 11:38:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j4JBcZCM040531; Thu, 19 May 2005 11:38:35 GMT (envelope-from nobody) Message-Id: <200505191138.j4JBcZCM040531@www.freebsd.org> Date: Thu, 19 May 2005 11:38:35 GMT From: Jens Nilsson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 11:40:08 -0000 >Number: 81258 >Category: threads >Synopsis: Thread specific data is sometimes assigned to multiple keys and/or threads >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 19 11:40:05 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Jens Nilsson >Release: FreeBSD 5.4-RELEASE i386 >Organization: >Environment: System: FreeBSD jalle.isg.local 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Wed May 11 09:32:42 CE ST 2005 root@jalle.isg.local:/usr/src/sys/i386/compile/SMP i386 I've seen the same problem in 5.3 too, but not in 4.10. >Description: Thread specific data is sometimes assinged to multiple keys and/or threads. In the attached test program two threads getting the same tsd for the same key seems to be the most usual. >How-To-Repeat: Run the attached test program a couple of times. One of the threads will wait for input, the bug is most likely to show up if enter is pressed in about half a second after the thread asked for data. I ran into the bug some time ago while developing a bit more complex application that involved a couple of threads all of them with TSD and some doing RPC-calls. In that application I had the same problem with any of the thread libs libpthread, libthr, and libc_r. This test program only seems to be able to repeat the problem with libpthread. uuencoded tared test program follows: begin 644 pthread_tsd_bug.tar.gz M'XL(`"QYC$(``^V=?7`<91W'G[[0]I:75AB8`4=]FMIR=STN]Y[2M)64%HA- MD]JF%(TU;NXVR2:;O>-V+VF(07$$A!%?!K0X^@>(#A:=40;$87`<%5\0$&'` M&=%ABJ@C(HCHJ(RB]?OL[MV^WVURA=)QG^'3RS[/[_>\O^RSN[^'BCI>%?C2 ML*J4AD=J8^3U<*E4JBN?I_A-=^73UM^&H^E4)I=-=>5RV2Z:2N?2J2RA^=P:AS2:C_]T-IW+F.,_G<'X[\KE"^'X?R-<9YRC<3HH M*"IE0[/*3U&U3)7Q\@Q5QWF5ZMV!*A6A*(Z*15KB59Z*"E7*4X(J3@D*4^<5 M11R3A1)3G:I)JEB1!#HIS"J4ETN=Y:H1BY*$,)/OI>/\M$`509`1)+"41R1A MBHHRO:0J"-OW[:#YY"$:G1'5<40Q2\NCFIPQT2`&21RI\E514&)TI*9269@6 MJK0FE_!O/89<\E"2#HXCK_6"E65IEBDCW2F%Y14!T^6BH,6-SDZU]!"U,0CJ MV1W4LZC%42H+BGR^6J\A,^\"7QRGK$:HJ)ZOT&I-1ATQ;:VH%5X5!;DH).F^ M>L5!#F%:/D8$3;XJEL1B32K7%&F63J'<3%V75OV(*HN_D^/TKG-@W-&(K&98X11!TENM M7%,K:*-ZIQD7Y3%4\J2>XF9N?=(YZ7".Z\V4C5&5Z:6;A&6:A&6;A.6:A.6; MA!6:A'6YPXSKT9JK M%[FR7.+-242\:CQEPR'C7GDO&H09>,1TVZ M9#QJM#*43=#401I-'=J4RA4+J52,;MU*KQPJ.+U]=-.F4-JB:_?VTHFOW]M$MF$(%BZ[=VT>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'S#V^PH8`!O!R]B; MWP-F0+?QWO]!<#W8!5:#)[''/@R&P#O`;['*W@DFP1@8!46P%OP#^^._@E?` MK\#3X"%P'[@=W`1FP2%0`D5C7]T#.L!:L'R5_IW`P^!^\%5P&%P':J`$]EF^ M&]@(S@(KP(LK"'D&_`3<#^X$MX)QL`FL`K\\!7&"0^`R<"XX!YP-?K&JL3NM"%+G2A.T'N?PM`VHL`>``` ` end >Fix: None known at the moment. >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Thu May 19 12:52:25 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8341B16A4CF; Thu, 19 May 2005 12:52:25 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0209443D91; Thu, 19 May 2005 12:52:25 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) j4JCqN65003884; Thu, 19 May 2005 08:52:23 -0400 (EDT) Date: Thu, 19 May 2005 08:52:23 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Jens Nilsson In-Reply-To: <200505191138.j4JBcZCM040531@www.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: freebsd-gnats-submit@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 12:52:25 -0000 On Thu, 19 May 2005, Jens Nilsson wrote: > Thread specific data is sometimes assinged to multiple keys > and/or threads. In the attached test program two threads getting > the same tsd for the same key seems to be the most usual. > > >How-To-Repeat: > Run the attached test program a couple of times. One of the > threads will wait for input, the bug is most likely to show up if > enter is pressed in about half a second after the thread asked > for data. > > I ran into the bug some time ago while developing a bit more > complex application that involved a couple of threads all of them > with TSD and some doing RPC-calls. In that application I had the > same problem with any of the thread libs libpthread, libthr, and > libc_r. This test program only seems to be able to repeat the > problem with libpthread. Thread-specific data is destroyed when the thread exits. Your TSD is allocated using malloc() and destroyed using free(). Your test program does nothing to ensure that all threads have started running and have all created/initialized their TSD before the first thread exits. malloc() is probably reusing a prior allocation that has been free()'d. Thread exiting != Thread being joined. -- DE From owner-freebsd-threads@FreeBSD.ORG Thu May 19 13:00:21 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A50DC16A4D0 for ; Thu, 19 May 2005 13:00:21 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7650743DA2 for ; Thu, 19 May 2005 13:00:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4JD0LuM011393 for ; Thu, 19 May 2005 13:00:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4JD0L8B011392; Thu, 19 May 2005 13:00:21 GMT (envelope-from gnats) Date: Thu, 19 May 2005 13:00:21 GMT Message-Id: <200505191300.j4JD0L8B011392@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Daniel Eischen Subject: Re: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 13:00:21 -0000 The following reply was made to PR threads/81258; it has been noted by GNATS. From: Daniel Eischen To: Jens Nilsson Cc: freebsd-gnats-submit@freebsd.org, Subject: Re: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads Date: Thu, 19 May 2005 08:52:23 -0400 (EDT) On Thu, 19 May 2005, Jens Nilsson wrote: > Thread specific data is sometimes assinged to multiple keys > and/or threads. In the attached test program two threads getting > the same tsd for the same key seems to be the most usual. > > >How-To-Repeat: > Run the attached test program a couple of times. One of the > threads will wait for input, the bug is most likely to show up if > enter is pressed in about half a second after the thread asked > for data. > > I ran into the bug some time ago while developing a bit more > complex application that involved a couple of threads all of them > with TSD and some doing RPC-calls. In that application I had the > same problem with any of the thread libs libpthread, libthr, and > libc_r. This test program only seems to be able to repeat the > problem with libpthread. Thread-specific data is destroyed when the thread exits. Your TSD is allocated using malloc() and destroyed using free(). Your test program does nothing to ensure that all threads have started running and have all created/initialized their TSD before the first thread exits. malloc() is probably reusing a prior allocation that has been free()'d. Thread exiting != Thread being joined. -- DE From owner-freebsd-threads@FreeBSD.ORG Fri May 20 06:36:03 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B66FD16A4CE; Fri, 20 May 2005 06:36:03 +0000 (GMT) Received: from mx1.luth.se (mx1.luth.se [130.240.42.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3B1343DA8; Fri, 20 May 2005 06:36:01 +0000 (GMT) (envelope-from jnilsson@ludd.ltu.se) Received: from speedy.ludd.ltu.se (speedy.ludd.ltu.se [130.240.16.13]) by mx1.luth.se (8.12.11/8.12.11) with ESMTP id j4K6ZolF002414; Fri, 20 May 2005 08:35:51 +0200 Received: (jnilsson@localhost) by speedy.ludd.ltu.se (8.12.8p1/8.6.11) id j4K4Appv003604; Fri, 20 May 2005 06:10:51 +0200 (CEST) Date: Fri, 20 May 2005 06:10:51 +0200 From: Jens A Nilsson To: Daniel Eischen Message-ID: <20050520041051.GA761@speedy.ludd.ltu.se> References: <200505191138.j4JBcZCM040531@www.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Organization: Be-Bop Originalaskkopp X-ltu-MailScanner-Information: Please contact the ISP for more information X-ltu-MailScanner: Found to be clean X-MailScanner-From: jnilsson@ludd.ltu.se cc: freebsd-gnats-submit@freebsd.org cc: Jens Nilsson cc: freebsd-threads@freebsd.org Subject: Re: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jnilsson@ludd.ltu.se List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 06:36:03 -0000 On Thu, May 19, 2005 at 08:52:23AM -0400, Daniel Eischen wrote: > On Thu, 19 May 2005, Jens Nilsson wrote: > > Thread specific data is sometimes assinged to multiple keys > > and/or threads. In the attached test program two threads getting > > the same tsd for the same key seems to be the most usual. > > > > >How-To-Repeat: > > Run the attached test program a couple of times. One of the > > threads will wait for input, the bug is most likely to show up if > > enter is pressed in about half a second after the thread asked > > for data. > > > > I ran into the bug some time ago while developing a bit more > > complex application that involved a couple of threads all of them > > with TSD and some doing RPC-calls. In that application I had the > > same problem with any of the thread libs libpthread, libthr, and > > libc_r. This test program only seems to be able to repeat the > > problem with libpthread. > > Thread-specific data is destroyed when the thread exits. Your > TSD is allocated using malloc() and destroyed using free(). Your > test program does nothing to ensure that all threads have started > running and have all created/initialized their TSD before the > first thread exits. malloc() is probably reusing a prior > allocation that has been free()'d. > > Thread exiting != Thread being joined. I see, sorry to have bothered you. -- Regards Jens From owner-freebsd-threads@FreeBSD.ORG Fri May 20 06:40:08 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04D4116A4CE for ; Fri, 20 May 2005 06:40:08 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF39B43D6D for ; Fri, 20 May 2005 06:40:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4K6e7gM094401 for ; Fri, 20 May 2005 06:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4K6e7oc094400; Fri, 20 May 2005 06:40:07 GMT (envelope-from gnats) Date: Fri, 20 May 2005 06:40:07 GMT Message-Id: <200505200640.j4K6e7oc094400@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Jens A Nilsson Subject: Re: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jens A Nilsson List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 06:40:08 -0000 The following reply was made to PR threads/81258; it has been noted by GNATS. From: Jens A Nilsson To: Daniel Eischen Cc: Jens Nilsson , freebsd-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/81258: Thread specific data is sometimes assigned to multiple keys and/or threads Date: Fri, 20 May 2005 06:10:51 +0200 On Thu, May 19, 2005 at 08:52:23AM -0400, Daniel Eischen wrote: > On Thu, 19 May 2005, Jens Nilsson wrote: > > Thread specific data is sometimes assinged to multiple keys > > and/or threads. In the attached test program two threads getting > > the same tsd for the same key seems to be the most usual. > > > > >How-To-Repeat: > > Run the attached test program a couple of times. One of the > > threads will wait for input, the bug is most likely to show up if > > enter is pressed in about half a second after the thread asked > > for data. > > > > I ran into the bug some time ago while developing a bit more > > complex application that involved a couple of threads all of them > > with TSD and some doing RPC-calls. In that application I had the > > same problem with any of the thread libs libpthread, libthr, and > > libc_r. This test program only seems to be able to repeat the > > problem with libpthread. > > Thread-specific data is destroyed when the thread exits. Your > TSD is allocated using malloc() and destroyed using free(). Your > test program does nothing to ensure that all threads have started > running and have all created/initialized their TSD before the > first thread exits. malloc() is probably reusing a prior > allocation that has been free()'d. > > Thread exiting != Thread being joined. I see, sorry to have bothered you. -- Regards Jens From owner-freebsd-threads@FreeBSD.ORG Fri May 20 07:44:47 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAFC616A4CE for ; Fri, 20 May 2005 07:44:47 +0000 (GMT) Received: from mail.elcat.kg (imap.elcat.kg [212.42.96.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2536743D7B for ; Fri, 20 May 2005 07:44:46 +0000 (GMT) (envelope-from rstreltsov@elcat.kg) Received: from localhost (localhost [127.0.0.1]) by mail.elcat.kg (Postfix) with ESMTP id 73C8C40A874 for ; Fri, 20 May 2005 13:44:39 +0600 (KGST) Received: from mail.elcat.kg ([127.0.0.1]) by localhost (imap.elcat.kg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 60172-20 for ; Fri, 20 May 2005 13:44:38 +0600 (KGST) Received: from warcomp.elcat.kg (warcomp.elcat.kg [212.42.96.26]) by mail.elcat.kg (Postfix) with ESMTP id C6E4640A8B3 for ; Fri, 20 May 2005 13:44:38 +0600 (KGST) From: Roman Streltsov Organization: Elcat To: freebsd-threads@freebsd.org Date: Fri, 20 May 2005 13:44:37 +0600 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505201344.38037.rstreltsov@elcat.kg> X-Virus-Scanned: by amavisd-new at elcat.kg Subject: Strange backtrace X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 07:44:48 -0000 Hello list, I've faced with odd thing. Some time my multhithread demon crahes with signal 11, Segmentation fault. After backtrace I see: (gdb) backtrace #0 0x28c4e31b in pthread_testcancel () from /usr/lib/libpthread.so.1 #1 0x28c46902 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1 #2 0x00000000 in ?? () I haven't direct call those functions. ldd gets only one thread library linked with the binary file. Can anybody hint me about path for resolve the issue? Please, CC me Regards -- Roman Streltsov rstrletsov@elcat.kg Elcat, Kyrgyzstan www.elcat.kg VoIP department www.voip.kg +996312664400 +996312666287 (direct line) From owner-freebsd-threads@FreeBSD.ORG Fri May 20 19:35:11 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C43A716A4CE for ; Fri, 20 May 2005 19:35:11 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7755B43D5E for ; Fri, 20 May 2005 19:35:10 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [193.64.42.172] (hac.vuokselantie10.fi [193.64.42.172]) by silver.he.iki.fi (Postfix) with ESMTP id E6F94BC46; Fri, 20 May 2005 22:35:02 +0300 (EEST) Message-ID: <428E3C12.2030904@he.iki.fi> Date: Fri, 20 May 2005 22:35:46 +0300 From: Petri Helenius User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roman Streltsov References: <200505201344.38037.rstreltsov@elcat.kg> In-Reply-To: <200505201344.38037.rstreltsov@elcat.kg> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Strange backtrace X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 19:35:11 -0000 Roman Streltsov wrote: >Hello list, > >I've faced with odd thing. Some time my multhithread demon crahes with signal 11, Segmentation fault. > >After backtrace I see: >(gdb) backtrace >#0 0x28c4e31b in pthread_testcancel () from /usr/lib/libpthread.so.1 >#1 0x28c46902 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1 >#2 0x00000000 in ?? () > >I haven't direct call those functions. >ldd gets only one thread library linked with the binary file. > >Can anybody hint me about path for resolve the issue? > > > Look at "info threads" to see all threads you had executing at the time of the crash. Pete >Please, CC me > >Regards > >