glibc __read_chk not a cancellation point
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
I'm working with Xen and libxenstore. libxenstore, when using a "watch", spawns a pthread (read_thread). When libxenstore shuts down, it pthread_cancel()s and pthread_join()s the "watch" thread.
That thread never exits and the process shutdown hangs.
read_threads is sitting in __read_chk(). In glibc 2.35, __read_chk is not a cancellation point, so the thread never reacts to the cancellation.
Upstream glibc fixed it in 2.36 in https:/
Here's the 2.35 disassembly - the lack of __pthread_
(gdb) disassemble
Dump of assembler code for function __read_chk:
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
=> 0x00007ffff7ea04dd <+13>: cmp $0xffffffffffff
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
0x00007ffff7
End of assembler dump.
[Test procedure]
The patch includes a test for this that is run at build time.
[Regression potential]
Besides the usual risks with any glibc update, this could potentially surface some race conditions at thread shutdown in user applications that were thus far hidden by the lack of cancellation point.
no longer affects: | glibc (Ubuntu Kinetic) |
no longer affects: | glibc (Ubuntu Lunar) |
Changed in glibc (Ubuntu): | |
status: | New → Fix Released |
Changed in glibc (Ubuntu Jammy): | |
status: | New → In Progress |
description: | updated |
Changed in glibc (Ubuntu Kinetic): | |
status: | New → Fix Released |
Hello jandryuk, or anyone else affected,
Accepted glibc into jammy-proposed. The package will build now and be available at https:/ /launchpad. net/ubuntu/ +source/ glibc/2. 35-0ubuntu3. 2 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification- needed- jammy to verification- done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed- jammy. In either case, without details of your testing we will not be able to proceed.
Further information regarding the verification process can be found at https:/ /wiki.ubuntu. com/QATeam/ PerformingSRUVe rification . Thank you in advance for helping!
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.