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