From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18256 invoked by alias); 5 Oct 2005 17:10:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18233 invoked by uid 22791); 5 Oct 2005 17:09:59 -0000 Received: from webmail.streamline-computing.com (HELO webmail.streamline-computing.com) (82.133.39.164) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 05 Oct 2005 17:09:59 +0000 Received: from [82.133.39.162] (helo=delmo.priv.wark.uk.streamline-computing.com) by webmail.streamline-computing.com with esmtpa (Exim 4.52) id 1ENCh3-0003O6-EM for gdb@sources.redhat.com; Wed, 05 Oct 2005 18:04:37 +0100 Subject: ptrace PEEKTEXT IO error?! From: David Lecomber To: gdb Content-Type: text/plain Date: Wed, 05 Oct 2005 17:10:00 -0000 Message-Id: <1128531841.21837.96.camel@delmo.priv.wark.uk.streamline-computing.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-10/txt/msg00010.txt.bz2 Dear all, I have a multithreaded code which is misbehaving in GDB (verified on latest CVS). After threads are created, the target suddenly seems to become unwriteable, and even unreadable in some bits. (gdb) n Single stepping until exit from function sleep, which has no line number information. main (argc=1, argv=0x7ffffffff3d8, environ=0x7ffffffff3e8) at hello.c:89 89 MPI_Init(&argc, &argv); (gdb) n [New Thread 32769 (LWP 18096)] [New Thread 16386 (LWP 18097)] [New Thread 32771 (LWP 18098)] 90 MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); (gdb) info threads 4 Thread 32771 (LWP 18098) 0x00002aaaab5f8bc9 in ioctl () from /lib64/libc.so.6 3 Thread 16386 (LWP 18097) 0x00002aaaab5f8bc9 in ioctl () from /lib64/libc.so.6 2 Thread 32769 (LWP 18096) 0x00002aaaab5f7829 in poll () from /lib64/libc.so.6 * 1 Thread 16384 (LWP 17994) main (argc=1, argv=0x7ffffffff3d8, environ=0x7ffffffff3e8) at hello.c:90 (gdb) info address hello.c:90 No symbol "hello.c:90" in current context. (gdb) info line Line 90 of "hello.c" starts at address 0x402042 and ends at 0x402056 . (gdb) n Warning: Cannot insert breakpoint 0. Error accessing memory address 0x402056: Input/output error. If I then strace the running GDB, I see the following errors (and a few more ptrace errors).. ptrace(PTRACE_PEEKTEXT, 17994, 0x407480, [0]) = -1 EIO (Input/output error) ptrace(PTRACE_POKEDATA, 17994, 0x407480, 0xffffffffffffccff) = -1 EIO (Input/output error) Anyone know what could be going on here? It's a 2.6.11 kernel, x86_64 based on Debian. Cheers David