← Back to team overview

touch-packages team mailing list archive

[Bug 1450355] Re: statically linking libpthread is problematic

 

Note that the second case hung and thus required me to hit Ctrl-C.

The proximate cause seems to be that the TID (Thread ID) in the TLS
(Thread-Local Storage) is not initialised properly:

1. The first pthread_rwlock_wrlock() call sets __writer to the TID, which is 0.
2. The first pthread_rwlock_unlock() call thinks that we had a reader lock because __writer is 0, so it decrements __nr_readers from 0 to 4294967295.
3. The second pthread_rwlock_wrlock() call hangs because it's waiting forever to be woken by a reader that never existed.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/1450355

Title:
  statically linking libpthread is problematic

Status in eglibc package in Ubuntu:
  New

Bug description:
  While investigating https://github.com/google/re2/issues/22, we
  discovered that statically linking libpthread is problematic since
  Ubuntu 14.10. I suspect that the TLS (Thread-Local Storage) is not
  initialised properly, which results in hangs or crashes.

  junyer@whalre:~$ lsb_release -rd
  Description:	Ubuntu 14.10
  Release:	14.10
  junyer@whalre:~$ apt-cache policy libc6-dev
  libc6-dev:
    Installed: 2.19-10ubuntu2.3
    Candidate: 2.19-10ubuntu2.3
    Version table:
   *** 2.19-10ubuntu2.3 0
          500 http://au.archive.ubuntu.com/ubuntu/ utopic-updates/main amd64 Packages
          500 http://security.ubuntu.com/ubuntu/ utopic-security/main amd64 Packages
          100 /var/lib/dpkg/status
       2.19-10ubuntu2 0
          500 http://au.archive.ubuntu.com/ubuntu/ utopic/main amd64 Packages
  junyer@whalre:~$

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1450355/+subscriptions


References