From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9284 invoked by alias); 5 Apr 2007 05:58:15 -0000 Received: (qmail 9274 invoked by uid 22791); 5 Apr 2007 05:58:14 -0000 X-Spam-Check-By: sourceware.org Received: from topsns2.toshiba-tops.co.jp (HELO topsns2.toshiba-tops.co.jp) (202.230.225.126) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Apr 2007 06:58:10 +0100 Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp via smtpd (for sourceware.org [209.132.176.174]) with ESMTP; Thu, 5 Apr 2007 14:58:09 +0900 Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1]) by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id 236DE23A71; Thu, 5 Apr 2007 14:58:07 +0900 (JST) Received: from srd2sd.toshiba-tops.co.jp (srd2sd.toshiba-tops.co.jp [172.17.28.2]) by topsms.toshiba-tops.co.jp (Postfix) with ESMTP id 0CFE520268; Thu, 5 Apr 2007 14:58:07 +0900 (JST) Received: from localhost (fragile [172.17.28.65]) by srd2sd.toshiba-tops.co.jp (8.12.10/8.12.10) with ESMTP id l355w6W0024249; Thu, 5 Apr 2007 14:58:06 +0900 (JST) (envelope-from anemo@mba.ocn.ne.jp) Date: Thu, 05 Apr 2007 05:58:00 -0000 Message-Id: <20070405.145806.89068923.nemoto@toshiba-tops.co.jp> To: gdb@sourceware.org Subject: generic error with a statically linked multithreaded program From: Atsushi Nemoto X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A B746 CA77 FE94 2874 D52F X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F X-Mailer: Mew version 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00029.txt.bz2 I found gdb can not run a statically linked multithreaded program on Fedora Core 6. Tested with gdb 6.5-15.fc6rh (FC6), gdb-6.6 vanilla and gdb-6.6.50.20070405 snapshot. All behave same. $ gcc -o ./hello -g hello.c -lpthread -static $ gdb-6.6.50.20070405/gdb/gdb ./hello GNU gdb 6.6.50.20070405 Copyright (C) 2007 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 "i686-pc-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: ./hello [Thread debugging using libthread_db enabled] Cannot find new threads: generic error (gdb) And gdb can not exit normally with "quit" command. (gdb) quit The program is running. Exit anyway? (y or n) y Then gdb hangs. At this point, the target program is still stopped. $ ps l F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 0 11389 12286 3594 20 0 8628 3332 wait S+ pts/2 0:00 gdb-6.6.50.20070405/gdb/gdb ./hello 0 11389 12287 12286 15 0 10960 140 utrace Tl pts/2 0:00 ./hello --- hello.c --- #include #include void *func(void *data) { return NULL; } int main(int argc, char **argv) { pthread_t tid; pthread_create(&tid, NULL, func, NULL); printf("hello world\n"); pthread_join(tid, NULL); return 0; } --- --- --- My environment is: kernel-2.6.20-1.2933.fc6 glibc-2.5-10.fc6 gcc-4.1.1-51.fc6 If I compiled the program without -static, gdb can run it normally. Is this gdb problem, or limitation, or problem at somewhere else? --- Atsushi Nemoto