From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7754 invoked by alias); 15 Aug 2006 08:15:10 -0000 Received: (qmail 7741 invoked by uid 22791); 15 Aug 2006 08:15:09 -0000 X-Spam-Check-By: sourceware.org Received: from mail.imc-berlin.de (HELO mail.imc-berlin.de) (217.110.46.186) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 15 Aug 2006 08:15:06 +0000 Received: from mailserver.berlin.imc-berlin.de (mailserver.berlin.imc-berlin.de [10.0.0.19]) by mail.imc-berlin.de (Postfix) with ESMTP id A24DB2F025 for ; Tue, 15 Aug 2006 11:09:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailserver.berlin.imc-berlin.de (Postfix) with ESMTP id D58CAA328 for ; Tue, 15 Aug 2006 10:15:00 +0200 (CEST) Received: from [10.0.2.29] (zarges.berlin.imc-berlin.de [10.0.2.29]) by mailserver.berlin.imc-berlin.de (Postfix) with ESMTP id F3E96A1A3 for ; Tue, 15 Aug 2006 10:14:59 +0200 (CEST) Message-ID: <44E181DE.7040905@imc-berlin.de> Date: Tue, 15 Aug 2006 08:15:00 -0000 From: "Zarges, Olav" User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: "gdb@sourceware.org" Subject: gdb-6.5 produces infinite backtrace on ARM Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00126.txt.bz2 Hi all, Environment: cross gdb-6.5 running on cygwin, gcc-3.4.4-glibc-2.3.5 for ARM, Eclipse and CDT as a front end. When debugging a multithreaded application on ARM I get inifinite backtrace showing pthread_start_thread(). When using Eclipse as a GDB front-end I had to use "set backtrace limit" to limit the backtrace to a sensible value, otherwise the Eclipse debugger hangs forever when the program hits a breakpoint. While the thread with the breakpoint has inifinite backtrace the other thread shows "Previous frame identical to this frame (corrupt stack?)" (Eclipse doesn't show a call stack at all; command line GDB shows the frames up to this message). Reading the newsgroups I found that many people had similar problems (is there a solution available?). I found the hint to use DWARF CFI to set the function called by pthread_create() or maybe pthread_create() itself to non-unwindable. Can anybody tell me how to do it for this sample program? Regards Olav >>>> compiler-run: arm-softfloat-linux-gnu-g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"threads.d" -MT"threads.d" -o"threads.o" "../threads.cpp" linker-run: arm-softfloat-linux-gnu-g++ -o"threads" ./threads.o -lpthread >>>> #include #include #include void* thread_function1(void*) { int a = 0; while (1) { for (int i=0 ; i<100; i++) { a += i; } printf("Thread 1: %d\n", a); sleep(3); } return NULL; } void* thread_function2(void*) { int a = 0; while (1) { for (int i=0 ; i<100; i++) { a += i; } printf("Thread 2: %d\n", a); sleep(2); } return NULL; } int main(int argc, char **argv) { pthread_t thread1, thread2; // create all the threads pthread_create( &thread1, NULL, thread_function1, NULL ); pthread_create( &thread2, NULL, thread_function2, NULL ); sleep(1); // wait for threads to end (.. I know this can't happen) pthread_join( thread1, NULL ); pthread_join( thread2, NULL ); return 0; } -- Olav A. Zarges imc Meßsysteme GmbH Voltastr. 5 13355 Berlin Deutschland Tel: 030 / 467090-68 Fax: 030 / 4631576