Date: Tue, 17 May 2005 14:54:03 +0800 From: <Ady_Li@trendmicro.com.cn> To: <freebsd-threads@freebsd.org> Subject: FW: malloc(): error: malloc recursive Message-ID: <AD9B6482801412429301B750AB4B9983013629CE@cnexmail02.cn.trendnet.org>
index | next in thread | raw e-mail
hi all,
> when i wrote a multi-pthread program in fbsd,
> at the first few second, it would core out with "malloc(): error: malloc recursive" or
> "free(): error: malloc recursive", there are more similar question in the maillist,
> but i still do not know how to solved it.
>
> CC_FLAGS= -g -O -fPIC #-DTHREAD -DDEBUG
> LPTHREAD=-lpthread -D_THREAD_SAFE -D_REENTRANT
> VCC_FLAGS= -g -O -fPIC -DFBSD -DFBSD2 -DFBSD3 -DFBSD4 -DIMPORT_VSAPI $(LPTHREAD) #-DTHREAD -DDEBUG
> LD=g++
> LD_FLAGS= -g -O -fPIC -shared #-DTHREAD -DDEB
kernel: FreeBSD ady_li_fbsd.client.cn.trendnet.org 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
$ gdb dispatcher dispatcher.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
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.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `dispatcher'.
Program terminated with signal 6, Aborted.
Reading symbols from /usr/lib/libstdc++.so.4...done.
Loaded symbols for /usr/lib/libstdc++.so.4
Reading symbols from /lib/libm.so.3...done.
Loaded symbols for /lib/libm.so.3
Reading symbols from /lib/libc.so.5...done.
Loaded symbols for /lib/libc.so.5
Reading symbols from /home/ady/SinaScanner2.0/SinaScannerService/mailscanner/product/1.0.0000/dispatcher.so...done.
Loaded symbols for /home/ady/SinaScanner2.0/SinaScannerService/mailscanner/product/1.0.0000/dispatcher.so
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x281b11d7 in kill () from /lib/libc.so.5
(gdb) where
#0 0x281b11d7 in kill () from /lib/libc.so.5
#1 0x281a627e in raise () from /lib/libc.so.5
#2 0x28218627 in abort () from /lib/libc.so.5
#3 0x28116a1d in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.4
#4 0x2811b16e in __cxxabiv1::__terminate () from /usr/lib/libstdc++.so.4
#5 0x2811b1a4 in std::terminate () from /usr/lib/libstdc++.so.4
#6 0x2811b0f9 in __cxa_throw () from /usr/lib/libstdc++.so.4
#7 0x2811e0f2 in operator new () from /usr/lib/libstdc++.so.4
#8 0x280c3aef in __gnu_cxx::new_allocator<char>::allocate () from /usr/lib/libstdc++.so.4
#9 0x280d7a56 in std::string::_Rep::_S_create () from /usr/lib/libstdc++.so.4
#10 0x280d82ab in std::string::_S_construct<char const*> () from /usr/lib/libstdc++.so.4
#11 0x280d5094 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string ()
from /usr/lib/libstdc++.so.4
#12 0x28251c83 in CBasePolicies::SetPolicy (this=0xbf8f6ed4, pstrName=0xbf8f6624 "FILE",
pstrValue=0xbf8f6214 "/home/ady/SinaScannerService/mailscanner/dispatcher")
at /home/ady/SinaScanner2.0/SinaScannerService/src/dispatcher/baseclass.cpp:26
#13 0x282513b6 in CMsgWrapper::UnEncapsulate (this=0x28270b8c,
pstrMsg=0x806d01c "REQUEST/2.0\r\nTASK:Single\r\nFILE:/home/ady/SinaScannerService/mailscanner/dispatcher\r\nACTN:ScanOnly\r\nREQUEST/2.0\r\nTASK:Single\r\nFILE:/home/ady/SinaScannerService/mailscanner/dispatcher\r\nACTN:ScanOnly\r\n\r\n", nMsgSize=200, nMsgOffset=@0xbf8f6aac, objPolicies=@0xbf8f6ed4)
at /home/ady/SinaScanner2.0/SinaScannerService/src/dispatcher/msgwrapper.cpp:292
#14 0x28259407 in RecvRequest (p=0x0)
at /home/ady/SinaScanner2.0/SinaScannerService/src/dispatcher/dispatcher.c:1427
#15 0x2828539f in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
#16 0x00000000 in ?? ()
(gdb)
> Best Regards,
> Ady Li
> [TEL](86)25-84510988-656
>
>
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. 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.
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AD9B6482801412429301B750AB4B9983013629CE>
