r4749 - in glibc-package/branches/glibc-branch-squeeze/debian: . patches/any
Author: aurel32
Date: 2011-06-26 21:08:25 +0000 (Sun, 26 Jun 2011)
New Revision: 4749
Modified:
glibc-package/branches/glibc-branch-squeeze/debian/changelog
glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv.conf-thread.diff
Log:
* Update submitted-resolv.conf-thread.diff from upstream to fix a
deadlock in some rare cases.
Modified: glibc-package/branches/glibc-branch-squeeze/debian/changelog
===================================================================
--- glibc-package/branches/glibc-branch-squeeze/debian/changelog 2011-06-26 20:52:44 UTC (rev 4748)
+++ glibc-package/branches/glibc-branch-squeeze/debian/changelog 2011-06-26 21:08:25 UTC (rev 4749)
@@ -8,6 +8,8 @@
if_nameindex() with more than 3 interfaces on GNU/kFreeBSD.
* Fix preinst script wrt 3.0 kernel. Patch by Colin Watson. Closes:
#630077.
+ * Update submitted-resolv.conf-thread.diff from upstream to fix a
+ deadlock in some rare cases.
-- Aurelien Jarno <aurel32@debian.org> Sat, 11 Jun 2011 18:12:35 +0200
Modified: glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv.conf-thread.diff
===================================================================
--- glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv.conf-thread.diff 2011-06-26 20:52:44 UTC (rev 4748)
+++ glibc-package/branches/glibc-branch-squeeze/debian/patches/any/submitted-resolv.conf-thread.diff 2011-06-26 21:08:25 UTC (rev 4749)
@@ -1,3 +1,8 @@
+2011-06-23 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * resolv/res_libc.c (__res_initstamp): Declare unconditionally.
+ (__res_maybe_init): Avoid double-checked locking.
+
2010-09-15 Aurelien Jarno <aurelien@aurel32.net>
* resolv/res_libc (__res_maybe_init): Ask other threads to
@@ -6,6 +11,22 @@
--- a/resolv/res_libc.c
+++ b/resolv/res_libc.c
+@@ -28,6 +28,7 @@
+ out) since res_init() should go into libc.so but the rest of that
+ file should not. */
+
++__libc_lock_define_initialized (static, lock);
+ extern unsigned long long int __res_initstamp attribute_hidden;
+ /* We have atomic increment operations on 64-bit platforms. */
+ #if __WORDSIZE == 64
+@@ -35,7 +36,6 @@
+ # define atomicincunlock(lock) (void) 0
+ # define atomicinc(var) catomic_increment (&(var))
+ #else
+-__libc_lock_define_initialized (static, lock);
+ # define atomicinclock(lock) __libc_lock_lock (lock)
+ # define atomicincunlock(lock) __libc_lock_unlock (lock)
+ # define atomicinc(var) ++var
@@ -100,10 +100,13 @@
if (resp->options & RES_INIT) {
@@ -14,12 +35,12 @@
- || ((ret == 0) && (last_mtime != statbuf.st_mtime))) {
- if (ret == 0)
- last_mtime = statbuf.st_mtime;
++ __libc_lock_lock (lock);
+ if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
+ last_mtime = statbuf.st_mtime;
-+ atomicinclock (lock);
+ atomicinc (__res_initstamp);
-+ atomicincunlock (lock);
+ }
++ __libc_lock_unlock (lock);
+ if (__res_initstamp != resp->_u._ext.initstamp) {
if (resp->nscount > 0)
__res_iclose (resp, true);
Reply to: