First, reproducing the bug with the current glibc:
ubuntu@bionic-glibc-1864864:~$ apt-cache policy libc6
libc6:
Installed: 2.27-3ubuntu1.2
Candidate: 2.27-3ubuntu1.2
Version table:
*** 2.27-3ubuntu1.2 500
500 http://br.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://br.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
100 /var/lib/dpkg/status
It hung immediately:
ubuntu@bionic-glibc-1864864:~$ ./bug23844wr
trylock_wr
(stuck)
Second run worked, third run got stuck again:
ubuntu@bionic-glibc-1864864:~$ ./bug23844wr
trylock_wr
500000
ubuntu@bionic-glibc-1864864:~$ ./bug23844wr
trylock_wr
(stuck)
Bionic verification
First, reproducing the bug with the current glibc: bionic- glibc-1864864: ~$ apt-cache policy libc6 br.archive. ubuntu. com/ubuntu bionic-updates/main amd64 Packages br.archive. ubuntu. com/ubuntu bionic- security/ main amd64 Packages dpkg/status
ubuntu@
libc6:
Installed: 2.27-3ubuntu1.2
Candidate: 2.27-3ubuntu1.2
Version table:
*** 2.27-3ubuntu1.2 500
500 http://
500 http://
100 /var/lib/
It hung immediately: bionic- glibc-1864864: ~$ ./bug23844wr
ubuntu@
trylock_wr
(stuck)
Second run worked, third run got stuck again: bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
(stuck)
With updated glibc: bionic- glibc-1864864: ~$ apt-cache policy libc6 br.archive. ubuntu. com/ubuntu bionic- proposed/ main amd64 Packages dpkg/status
ubuntu@
libc6:
Installed: 2.27-3ubuntu1.3
Candidate: 2.27-3ubuntu1.3
Version table:
*** 2.27-3ubuntu1.3 500
500 http://
100 /var/lib/
Sample program doesn't hang anymore, after multiple tries, and no need to rebuild it: bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr bionic- glibc-1864864: ~$ ./bug23844wr
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
500000
ubuntu@
trylock_wr
500000
bionic verification succeeded