Activity log for bug #2007796

Date Who What changed Old value New value Message
2023-02-20 02:11:36 jandryuk bug added bug
2023-02-20 09:30:07 Simon Chopin nominated for series Ubuntu Kinetic
2023-02-20 09:30:07 Simon Chopin bug task added glibc (Ubuntu Kinetic)
2023-02-20 09:30:07 Simon Chopin nominated for series Ubuntu Lunar
2023-02-20 09:30:07 Simon Chopin bug task added glibc (Ubuntu Lunar)
2023-02-20 09:30:52 Simon Chopin bug task deleted glibc (Ubuntu Kinetic)
2023-02-20 09:30:58 Simon Chopin nominated for series Ubuntu Jammy
2023-02-20 09:30:58 Simon Chopin bug task added glibc (Ubuntu Jammy)
2023-02-20 09:31:05 Simon Chopin bug task deleted glibc (Ubuntu Lunar)
2023-02-20 09:31:10 Simon Chopin glibc (Ubuntu): status New Fix Released
2023-05-31 09:27:45 Simon Chopin glibc (Ubuntu Jammy): status New In Progress
2023-05-31 09:29:45 Simon Chopin description 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://sourceware.org/git/?p=glibc.git;a=commitdiff;h=dc30acf20bd635d71cd4c84100e842fdf0429e48 Here's the 2.35 disassembly - the lack of __pthread_enable_asynccancel() indicates the missing cancellation support: (gdb) disassemble Dump of assembler code for function __read_chk: 0x00007ffff7ea04d0 <+0>: endbr64 0x00007ffff7ea04d4 <+4>: cmp %rcx,%rdx 0x00007ffff7ea04d7 <+7>: ja 0x7ffff7ea0504 <__read_chk+52> 0x00007ffff7ea04d9 <+9>: xor %eax,%eax 0x00007ffff7ea04db <+11>: syscall => 0x00007ffff7ea04dd <+13>: cmp $0xfffffffffffff000,%rax 0x00007ffff7ea04e3 <+19>: ja 0x7ffff7ea04f0 <__read_chk+32> 0x00007ffff7ea04e5 <+21>: ret 0x00007ffff7ea04e6 <+22>: cs nopw 0x0(%rax,%rax,1) 0x00007ffff7ea04f0 <+32>: mov 0xe3919(%rip),%rdx # 0x7ffff7f83e10 0x00007ffff7ea04f7 <+39>: neg %eax 0x00007ffff7ea04f9 <+41>: mov %eax,%fs:(%rdx) 0x00007ffff7ea04fc <+44>: mov $0xffffffffffffffff,%rax 0x00007ffff7ea0503 <+51>: ret 0x00007ffff7ea0504 <+52>: push %rax 0x00007ffff7ea0505 <+53>: call 0x7ffff7ea00b0 <__GI___chk_fail> End of assembler dump. ProblemType: Bug DistroRelease: Ubuntu 22.04 Package: libc6 2.35-0ubuntu3.1 ProcVersionSignature: Ubuntu 5.15.0-60.66-generic 5.15.78 Uname: Linux 5.15.0-60-generic x86_64 ApportVersion: 2.20.11-0ubuntu82.3 Architecture: amd64 CasperMD5CheckResult: unknown CurrentDesktop: XFCE Date: Sun Feb 19 21:03:32 2023 EcryptfsInUse: Yes InstallationDate: Installed on 2012-12-06 (3727 days ago) InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5) SourcePackage: glibc UpgradeStatus: Upgraded to jammy on 2022-07-24 (210 days ago) [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://sourceware.org/git/?p=glibc.git;a=commitdiff;h=dc30acf20bd635d71cd4c84100e842fdf0429e48 Here's the 2.35 disassembly - the lack of __pthread_enable_asynccancel() indicates the missing cancellation support: (gdb) disassemble Dump of assembler code for function __read_chk:    0x00007ffff7ea04d0 <+0>: endbr64    0x00007ffff7ea04d4 <+4>: cmp %rcx,%rdx    0x00007ffff7ea04d7 <+7>: ja 0x7ffff7ea0504 <__read_chk+52>    0x00007ffff7ea04d9 <+9>: xor %eax,%eax    0x00007ffff7ea04db <+11>: syscall => 0x00007ffff7ea04dd <+13>: cmp $0xfffffffffffff000,%rax    0x00007ffff7ea04e3 <+19>: ja 0x7ffff7ea04f0 <__read_chk+32>    0x00007ffff7ea04e5 <+21>: ret    0x00007ffff7ea04e6 <+22>: cs nopw 0x0(%rax,%rax,1)    0x00007ffff7ea04f0 <+32>: mov 0xe3919(%rip),%rdx # 0x7ffff7f83e10    0x00007ffff7ea04f7 <+39>: neg %eax    0x00007ffff7ea04f9 <+41>: mov %eax,%fs:(%rdx)    0x00007ffff7ea04fc <+44>: mov $0xffffffffffffffff,%rax    0x00007ffff7ea0503 <+51>: ret    0x00007ffff7ea0504 <+52>: push %rax    0x00007ffff7ea0505 <+53>: call 0x7ffff7ea00b0 <__GI___chk_fail> 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.
2023-06-01 16:05:44 Ubuntu Archive Robot bug added subscriber Simon Chopin
2023-06-05 16:08:34 Brian Murray nominated for series Ubuntu Kinetic
2023-06-05 16:08:34 Brian Murray bug task added glibc (Ubuntu Kinetic)
2023-06-05 16:08:40 Brian Murray glibc (Ubuntu Kinetic): status New Fix Released
2023-06-06 19:54:30 Brian Murray glibc (Ubuntu Jammy): status In Progress Fix Committed
2023-06-06 19:54:31 Brian Murray bug added subscriber Ubuntu Stable Release Updates Team
2023-06-06 19:54:33 Brian Murray bug added subscriber SRU Verification
2023-06-06 19:54:35 Brian Murray tags amd64 apport-bug jammy amd64 apport-bug jammy verification-needed verification-needed-jammy
2023-06-29 08:58:01 Simon Chopin tags amd64 apport-bug jammy verification-needed verification-needed-jammy amd64 apport-bug jammy verification-done verification-done-jammy
2023-07-28 18:36:48 Brian Murray tags amd64 apport-bug jammy verification-done verification-done-jammy amd64 apport-bug jammy verification-needed verification-needed-jammy
2023-08-09 07:54:12 Simon Chopin tags amd64 apport-bug jammy verification-needed verification-needed-jammy amd64 apport-bug jammy verification-done verification-done-jammy
2023-09-12 15:48:24 Launchpad Janitor glibc (Ubuntu Jammy): status Fix Committed Fix Released
2023-09-12 15:48:56 Steve Langasek removed subscriber Ubuntu Stable Release Updates Team