From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111940 invoked by alias); 17 Oct 2017 14:04:20 -0000 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 Received: (qmail 111655 invoked by uid 89); 17 Oct 2017 14:04:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=H*MI:8094, Interrupt, H*M:8094 X-HELO: hqemgate15.nvidia.com Received: from hqemgate15.nvidia.com (HELO hqemgate15.nvidia.com) (216.228.121.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Oct 2017 14:04:13 +0000 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Tue, 17 Oct 2017 07:03:29 -0700 Received: from HQMAIL106.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 17 Oct 2017 07:03:43 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 17 Oct 2017 07:03:43 -0700 Received: from UKMAIL102.nvidia.com (10.26.138.15) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 17 Oct 2017 14:02:14 +0000 Received: from localhost.localdomain (10.21.45.12) by UKMAIL102.nvidia.com (10.26.138.15) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 17 Oct 2017 14:02:11 +0000 To: GDB Development From: Dmitry Antipov Subject: "The target is not responding to interrupt requests" after re-attach Message-ID: <6c9c532c-8094-9df5-1a8c-556ea92a9b5a@nvidia.com> Date: Tue, 17 Oct 2017 14:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL102.nvidia.com (10.26.138.15) X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00048.txt.bz2 I'm trying a "remote" (both gdb and gdbsever are on the same GNU/Linux x86_64 target) debugging of the following program: #include int main (int argc, char *argv[]) { struct timespec ts = { .tv_sec = 1, .tv_nsec = 0 }; while (1) nanosleep (&ts, NULL); return 0; } with 'gdbserver --attach :8888 [PID]' and 'extended-remote' target. During first debugging session, Ctrl-C works as expected, for example: $ gdb -q (gdb) set sysroot / (gdb) target extended-remote :8888 Remote debugging using :8888 Reading symbols from /tmp/t-nanosleep...done. Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done. Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. 0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6 (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6 (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6 (gdb) q A debugging session is active. Inferior 1 [process 9320] will be detached. Quit anyway? (y or n) y Detaching from program: /tmp/t-nanosleep, process 9320 But it doesn't work for the next time: $ gdb -q (gdb) set sysroot / (gdb) target extended-remote :8888 Remote debugging using :8888 (gdb) attach 9320 Attaching to process 9320 Reading symbols from /tmp/t-nanosleep...done. Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done. Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. 0x00007eff44c65420 in __nanosleep_nocancel () from /lib64/libc.so.6 (gdb) c Continuing. ^C ^CThe target is not responding to interrupt requests. Stop debugging it? (y or n) y Even if it works as expected, what are the reasons for being inconsistent here? Dmitry