aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-07-13 15:56:49 +0200
committerTom de Vries <tdevries@suse.de>2021-07-13 15:56:49 +0200
commit6b66b5a5a29e18e1c1ddd29ea0749050d532de65 (patch)
tree09e1b43921568e3aba26a13bd252db51e3e18057 /gdb/target.c
parent81e33ce2894678a60ed4d5e4471cd6eb968056c2 (diff)
downloadgdb-6b66b5a5a29e18e1c1ddd29ea0749050d532de65.zip
gdb-6b66b5a5a29e18e1c1ddd29ea0749050d532de65.tar.gz
gdb-6b66b5a5a29e18e1c1ddd29ea0749050d532de65.tar.bz2
[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 => 9354 => 0x7ffff7c79b80; errno = 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 => 9354 => 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 == NULL. ... 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 == 0 && fake_empty) { /* __pthread_initialize_minimal has not run. There is just the main 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 incomplete, we only fake a special descriptor for the initial thread. */ td_thrhandle_t th = { ta, 0 }; return callback (&th, cbdata_p) != 0 ? TD_DBERR : TD_OK; } ... while in the former case we don't because this preceding statement doesn't result in next == 0: ... err = 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 comment is no longer accurate. The change in behaviour bisect to glibc commit 1daccf403b "nptl: Move stack list variables into _rtld_global", which moves the initialization of stack 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-db 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 <tdevries@suse.de> PR testsuite/27690 * gdb.threads/check-libthread-db.exp: Update patterns for glibc 2.33.
Diffstat (limited to 'gdb/target.c')
0 files changed, 0 insertions, 0 deletions