From owner-freebsd-questions@FreeBSD.ORG Sun Dec 2 13:26:31 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4927316A417 for ; Sun, 2 Dec 2007 13:26:31 +0000 (UTC) (envelope-from dmw@unete.cl) Received: from mail09.ifxnetworks.com (mail09.ifxnetworks.com [190.61.128.39]) by mx1.freebsd.org (Postfix) with ESMTP id DE17B13C459 for ; Sun, 2 Dec 2007 13:26:30 +0000 (UTC) (envelope-from dmw@unete.cl) Received: (qmail 30758 invoked from network); 2 Dec 2007 13:26:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on mail09.ifxnetworks.com X-Spam-Level: X-Spam-Status: No, score=0.1 required=7.0 tests=RDNS_NONE autolearn=disabled version=3.2.3 Received: from unknown (HELO quake) (dmw@unete.cl@[200.73.29.12]) (envelope-sender ) by mail09.ifxnetworks.com (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 2 Dec 2007 13:26:29 -0000 From: Daniel Molina Wegener Organization: DMW To: FreeBSD Questions Date: Sun, 2 Dec 2007 10:26:16 -0300 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712021026.16840.dmw@unete.cl> Subject: problems with pthread_testcancel X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dmw@unete.cl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 13:26:31 -0000 Hello, I'm looking a common problem in many programs with pthread_testcancel(3). When creating new threads some programs craches in pthread_testcancel(3). Now, I'm coding a daemon in C++ using pthreads, but I don't know where is my mistake or the mistake on the programs that I run. Here's the backtrace... -----8<----------8<----------8<----------8<----------8<----- #0 0x2819a0ef in pthread_testcancel () from /lib/libpthread.so.2 [New Thread 0x8053c00 (LWP 100197)] [New Thread 0x8053a00 (sleeping)] [New Thread 0x8053800 (sleeping)] [New Thread 0x8053600 (sleeping)] [New Thread 0x8053400 (runnable)] [New Thread 0x8053200 (LWP 100191)] [New Thread 0x8053000 (sleeping)] [New LWP 100182] (gdb) (gdb) info threads * 8 LWP 100182 0x2819a0ef in pthread_testcancel () from /lib/libpthread.so.2 7 Thread 0x8053000 (sleeping) 0x2818fb51 in pthread_mutexattr_init () from /lib/libpthread.so.2 6 Thread 0x8053200 (LWP 100191) 0x2819a0af in pthread_testcancel () from /lib/libpthread.so.2 5 Thread 0x8053400 (runnable) 0x280e8a40 in GCT::ServiceTCP::getSocket ( this=0x0) at /work/dmw/CXX/gctserver/libgct/src/ServiceTCP.cxx:72 4 Thread 0x8053600 (sleeping) 0x2818fb51 in pthread_mutexattr_init () from /lib/libpthread.so.2 3 Thread 0x8053800 (sleeping) 0x2818fb51 in pthread_mutexattr_init () from /lib/libpthread.so.2 2 Thread 0x8053a00 (sleeping) 0x2818fb51 in pthread_mutexattr_init () from /lib/libpthread.so.2 1 Thread 0x8053c00 (LWP 100197) 0x2819b893 in __error () from /lib/libpthread.so.2 Current language: auto; currently c++ (gdb) thread 8 [Switching to thread 8 (LWP 100182)]#0 0x2819a0af in pthread_testcancel () from /lib/libpthread.so.2 (gdb) backtrace #0 0x2819a0af in pthread_testcancel () from /lib/libpthread.so.2 #1 0x2819042f in pthread_mutexattr_init () from /lib/libpthread.so.2 #2 0x28170450 in ?? () (gdb) -----8<----------8<----------8<----------8<----------8<----- Thanks in advance... -- .O. | Daniel Molina Wegener | C/C++ Developer ..O | dmw [at] unete [dot] cl | FOSS Coding Adict OOO | FreeBSD & Linux User | Standards Rocks!