From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 17A25385C41C; Tue, 13 Jul 2021 13:56:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17A25385C41C From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/27690] FAIL: gdb.threads/check-libthread-db.exp: user-initiated check: libpthread.so not initialized (pattern 2) Date: Tue, 13 Jul 2021 13:56:53 +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: cvs-commit 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: Tue, 13 Jul 2021 13:56:54 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27690 --- Comment #4 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6b66b5a5a29e= 18e1c1ddd29ea0749050d532de65 commit 6b66b5a5a29e18e1c1ddd29ea0749050d532de65 Author: Tom de Vries Date: Tue Jul 13 15:56:49 2021 +0200 [gdb/testsuite] Fix check-libthread-db.exp FAILs with glibc 2.33 When running test-case gdb.threads/check-libthread-db.exp on openSUSE Tumbleweed with glibc 2.33, I get: ... (gdb) maint check libthread-db^M Running libthread_db integrity checks:^M Got thread 0x7ffff7c79b80 =3D> 9354 =3D> 0x7ffff7c79b80; errno =3D 0 = ... OK^M libthread_db integrity checks passed.^M (gdb) FAIL: gdb.threads/check-libthread-db.exp: user-initiated check: \ libpthread.so not initialized (pattern 2) ... The test-case expects instead: ... Got thread 0x0 =3D> 9354 =3D> 0x0 ... OK^M ... which is what I get on openSUSE Leap 15.2 with glibc 2.26, and what is described in the test-case like this: ... # libthread_db should fake a single thread with th_unique =3D=3D NU= LL. ... Using a breakpoint on check_thread_db_callback we can compare the two scenarios, and find that in the latter case we hit this code in glibc function iterate_thread_list in nptl_db/td_ta_thr_iter.c: ... if (next =3D=3D 0 && fake_empty) { /* __pthread_initialize_minimal has not run. There is just the m= ain thread to return. We cannot rely on its thread register. They sometimes contain garbage that would confuse us, left by the kernel at exec. So if it looks like initialization is incompl= ete, we only fake a special descriptor for the initial thread. */ td_thrhandle_t th =3D { ta, 0 }; return callback (&th, cbdata_p) !=3D 0 ? TD_DBERR : TD_OK; } ... while in the former case we don't because this preceding statement does= n't result in next =3D=3D 0: ... err =3D DB_GET_FIELD (next, ta, head, list_t, next, 0); ... Note that the comment mentions __pthread_initialize_minimal, but in both cases it has already run before we hit the callback, so it's possible the com= ment is no longer accurate. The change in behaviour bisect to glibc commit 1daccf403b "nptl: Move s= tack list variables into _rtld_global", which moves the initialization of st= ack list variables such as __stack_user to an earlier moment, which explains well enough the observed difference. Fix this by updating the regexp patterns to agree with what libthread-d= b is telling us. Tested on x86_64-linux, both with glibc 2.33 and 2.26. gdb/testsuite/ChangeLog: 2021-07-07 Tom de Vries PR testsuite/27690 * gdb.threads/check-libthread-db.exp: Update patterns for glibc 2.33. --=20 You are receiving this mail because: You are on the CC list for the bug.=