From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99E49384803D; Fri, 9 Jul 2021 13:33:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99E49384803D From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug threads/28065] FAIL: gdb.threads/access-mem-running-thread-exit.exp: all-stop: access mem (print global_var after writing again, inf=1, iter=354) Date: Fri, 09 Jul 2021 13:33:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: threads X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org 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: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2021 13:33:30 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28065 --- Comment #12 from Tom de Vries --- I updated the test-case to remove "set print thread-events off". Also I moved the debug statements related to the /mem fp to a separate debug category: lin-lwp-mem, enabled it in the test-case, and verified that the problem still reproduced. Changes available at https://github.com/vries/gdb/commits/access-mem-running-thread-exit-v2 . I got the following log: ... [linux-nat] linux_proc_xfer_memory_partial_pid: opening /proc/14678/task/19075/mem failed: No such file or directory (2)^M ^M [linux-nat] linux_proc_xfer_memory_partial_pid: opened fd 13 for /proc/14678/task/19285/mem^M ^M [linux-nat] linux_proc_xfer_memory_partial_pid: accessing fd 13 for pid 192= 85 got EOF^M ^M [linux-nat] linux_proc_xfer_memory_partial_pid: fd 13 for /proc/14678/task/19285/mem^M ^M [linux-nat] linux_proc_xfer_memory_partial_pid: accessing fd 13 for pid 190= 75 got EOF^M ^M [linux-nat] linux_proc_xfer_memory_partial_pid: fd 13 for /proc/14678/task/19285/mem^M ^M Cannot access memory at address 0x601070^M (gdb) [LWP 19287 exited]^M ... I noticed that we get EOF twice, and the second time try for the same file. This led me to the following: ... diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index f206b874929..14892a4ee2a 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -3907,6 +3907,7 @@ linux_proc_xfer_memory_partial_pid (ptid_t ptid, { linux_nat_debug_printf ("accessing fd %d for pid %ld got EOF\n", fd, ptid.lwp ()); + last_proc_mem_file.close (); } return ret; ... And this fixed the failure: I managed to run the test-case for half an hour without triggering the FAIL. I don't understand things well enough to say whether this is a proper fix. --=20 You are receiving this mail because: You are on the CC list for the bug.=