FS#69657 - [gdb/glibc] fails with "Cannot find user-level thread for LWP 192701: generic error"

Attached to Project: Arch Linux
Opened by Sven Brauch (scummos) - Tuesday, 16 February 2021, 15:01 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Sunday, 16 May 2021, 17:13 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Anatol Pomozov (anatolik)
Levente Polyak (anthraxx)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Since a recent update, attaching gdb 10.1 to a process sometimes fails with the following error message:

Error while reading shared library symbols for /usr/lib/libpthread.so.0:
Cannot find user-level thread for LWP 192701: generic error

On my machine, I can so far only reproduce this problem when attaching using "gdb -p <pid>", but other users have the same issue even when launching an application directly from gdb.

I don't know exactly what is going on, but I have collected the following details so far:

- The error is 100% reproducible for attaching to some programs. Examples include "gimp" and "telegram-desktop".

- The error is 100% *not* reproducible for attaching to others. Examples include "kate" and "okular".

- It was not a gdb update which caused the issue to appear; attached is the list of packages I last upgraded on my machine. The issue did not occur before, but occurred afterwards.

- The issue also occurs for some applications compiled on the system itself, not just for packages from pacman.

The issue is quite severe, since it effectively makes debugging some applications impossible.

Here's some more detailed version info:

> pacman -Qi gdb glibc gcc-libs gcc gimp telegram-desktop kate okular |grep -B1 Version
Name : gdb
Version : 10.1-4
--
Name : glibc
Version : 2.33-4
--
Name : gcc-libs
Version : 10.2.0-6
--
Name : gcc
Version : 10.2.0-6
--
Name : gimp
Version : 2.10.22-1
--
Name : telegram-desktop
Version : 2.5.8-1
--
Name : kate
Version : 20.12.2-1
--
Name : okular
Version : 20.12.2-1
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Sunday, 16 May 2021, 17:13 GMT
Reason for closing:  Fixed
Additional comments about closing:  glibc 2.33-5 fixes this
Comment by Sven Brauch (scummos) - Tuesday, 16 February 2021, 15:09 GMT
Here is a thread about the same issue on Manjaro Linux: https://forum.manjaro.org/t/critical-bug-gdb-broken-with-last-stable-update/53155/2

I verified the same problem occurs with both distributions.
Comment by Azat (azat) - Thursday, 04 March 2021, 07:17 GMT Comment by Emil (xexaxo) - Thursday, 15 April 2021, 18:01 GMT
There are plenty of bug reports which reference this error message. The message itself is pretty generic, so I would _not_ follow it blindly.

After some debugging - I've found the offending commit https://github.com/bminor/glibc/commit/1daccf403b1bd86370eb94edca794dc106d02039

With that reverted, one can gdb attach to gimp and steam. As the commit message hints, there are some implications of using the old code.

Edit: Kicked off a discussion upstream - https://sourceware.org/pipermail/libc-alpha/2021-April/125089.html
Comment by Sven Brauch (scummos) - Thursday, 15 April 2021, 20:27 GMT
Great, thank you very much for your research! An issue in glibc sounds plausible.
Comment by Emil (xexaxo) - Tuesday, 04 May 2021, 11:31 GMT Comment by Giancarlo Razzolini (grazzolini) - Friday, 14 May 2021, 00:50 GMT
The glibc that's on [testing] should fix this issue, can you confirm?
Comment by Emil (xexaxo) - Saturday, 15 May 2021, 12:49 GMT
Cannot really try [testing] - if will break my local/custom valgrind and gdb due to the gcc11 rebuild (bugreports/patches for those coming shortly).
Package has all the patches linked, so we can call this fixed.

@grazzolini if you want to try - issue is 100% reproducible with either `gimp` or `steam`.

Edit: a reference to this bug report in the PKGBUILD, alongside the patches would be nice IMHO.
Comment by Giancarlo Razzolini (grazzolini) - Sunday, 16 May 2021, 17:13 GMT
I was able to attach to both processes just fine, so I guess this isn't an issue anymore.

Loading...