From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4AE533858C36; Tue, 19 Mar 2024 15:35:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AE533858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710862514; bh=f4+RMKAHzClhuyxVu5SSNjDIzmvwBneIcrVgYy43YfI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TuuosnPjeT90D2h3779k0sYdo83d5B5DatikHqoBEdn91iEYFEMQ+eUUZbOmHuR4H aenkmxy6jPpGQYw9fc+7yGdzjnXn0q+cCY3PjSYYIlYXduRl+DatB3nIJJ5no5tvoL 5CKr49wMxoLBSiHi99+RSLUbRM6E9Vk6kF+TTAag= From: "thiago.bauermann at linaro dot org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/31312] attach-many-short-lived-threads gives inconsistent results Date: Tue, 19 Mar 2024 15:35:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thiago.bauermann at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: cel at linux dot ibm.com X-Bugzilla-Target-Milestone: 15.1 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31312 --- Comment #21 from Thiago Jung Bauermann --- (In reply to Carl E Love from comment #20) > I tried the prototype patch from Thiago. It seems to fix the hangs on > detach. I ran the many-short-lived threads test 500 times. I did have > three runs that encountered a new error I haven't seen before.=20=20 >=20 > FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 6: break at > break_fn: 1 > FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 6: break at > break_fn: 2 (the program is no longer running) > FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 6: break at > break_fn: 3 (the program is no longer running) > FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 6: reset timer > in the inferior > FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 6: detach (the > program is no longer running) >=20 > It seems the workload had finished before the expect script finished > running. So we may want to address that as a separate patch later.=20 If you see "Program terminated with signal SIGTRAP, Trace/breakpoint trap."= in gdb.log, then it's issue 3 in comment #19. What happens is that two iterati= ons without seeing new thread in linux_proc_attach_tgid_threads () isn't always enough for GDB to attach to all inferior threads, and then an unattached th= read trips on the breakpoint instruction that GDB put in the inferior. I was also able to reproduce it on two x86_64-linux machines after hundreds of runs of= the testcase. > Thiago's fix seems to work well on Power 10. That's great! Thank you for testing it. > I did work on the strace as suggested. I was trying to get strace to att= ach > to the gdb thread from the expect script. Haven't got the script to get = the > correct gdb PID yet. I think I was trying to attach to the expect script > which strace fails to attach to. I tried writing a script that I could r= un > after the workload started that would call ps and try to grep out the gdb > process id and attach to it but again I haven't got that working yet eith= er. >=20 >=20 > I will try and work on the strace thing some more but not sure if it is > really needed at this point given that Thiago seems to have figured out t= he > issues. It's not necessary for the issue you saw. It would probably be helpful in t= he case of issue 2, but that one is hard to reproduce, and I haven't started investigating it yet (also, I don't think I'll have time to dive into it in= the next couple of weeks). I'll open separate bugzillas for these other issues to untangle the discuss= ion. --=20 You are receiving this mail because: You are on the CC list for the bug.=