From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87144 invoked by alias); 15 Sep 2015 01:52:11 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 86730 invoked by uid 48); 15 Sep 2015 01:52:11 -0000 From: "xdje42 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/18945] gdbserver cannot be interrupted on linux when pgid doesn't match pid Date: Tue, 15 Sep 2015 01:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.10 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xdje42 at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q3/txt/msg00292.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18945 --- Comment #5 from Doug Evans --- Iterating over all threads is actually what gdb does in non-stop mode for the interrupt command (ref: linux_nat_interrupt). Though even that simplistic response is inaccurate if one dives a bit deeper (e.g., if !nonstop it sends SIGINT to the pgrp, otherwise it sends SIGSTOP to each lwp). This bit of gdb needs some design cleanup, and then some implementation cleanup. For reference sake, I wouldn't iterate over /proc/$pid/tasks: It's critical that gdb be attached to the thread first. There are still races here, but gdb already has to deal with them so this isn't a new issue: The patch for this bug should be able to just use the existing APIs and leave the latter to deal with lower level issues. So iterating over all threads may be a reasonable thing to do in all cases (not sure what kind of performance hit there might be if there are 1000 threads; it's not a blocking issue, but we can't ignore it either). -- You are receiving this mail because: You are on the CC list for the bug.