[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#697831: unblock: eglibc/2.13-38



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package eglibc, whose changes were discussed on IRC
with adsb a while ago, and has now been uploaded.  Debdiff attached,
but a quick step through the changelog:

   [ Adam Conrad ]
   * debian/patches/arm/cvs-ldconfig-cache-abi.diff: Backport upstream
     patch to re-enable ldconfig cache tagging for armhf binaries again.
   * debian/patches/arm/unsubmitted-ldconfig-cache-abi.diff: Re-enable
     and adjust to account for changes in cvs-ldconfig-cache-abi.diff.
   * debian/debhelper.in/libc.preinst: Remove old ld.so.cache on upgrade.

The above changes are needed to make multiarch between armel and armhf
work properly.  They were previously included in eglibc, then temporarily
reverted when an upstream conflict occurred, and now reintroduced with
the upstream versions of the patches.  Well-tested in both previous
Debian revisions and in several Ubuntu releases.

   * debian/control.in/amd64: Move libc6-amd64 from standard to optional.

Just making control match the archive.

   [ Jonathan Nieder ]
   * control.in/opt: correct misspelling of "Ezra" in descriptions of
     *-i686 variants.  Thanks to Thorsten Glaser.

Typo fix.

   * patches/any/local-tst-eintr1-eagain.diff: new patch to work around
     a race that lets pthread_create hit resource limits when the kernel
     takes too long to clean up after joined threads.  (closes: #673596)

Testsuite fix, doesn't affect any runtime code.

   [ Samuel Thibault ]
   * patches/any/local-fhs-linux-paths.diff: Patch vardb path on !linux too.
   * Add patches/hurd-i386/libpthread_hurd_cond_wait.diff: New patch to add
     support for translators with pthread.
   * Add patches/hurd-i386/submitted-fork_port_leak.diff: New patch to fix port
     leak on fork.
   * libc0.3.symbols.hurd-i386: Add libpthread.so.0.3 symbols.
   * Add patches/hurd-i386/tg-hurdsig-boot-fix.diff to fix
     sigstate_is_global_rcv at boot in libpthread-based translators.
   * patches/hurd-i386/tg-hurdsig-global-dispositions.diff: Update with Thomas'
     fork deadlock fix.
   * patches/hurd-i386/unsubmitted-single-hurdselect-timeout.diff: Temporarily
     fix double select timeout on single fd.
   * patches/hurd-i386/unsubmitted-setitimer_fix.diff: Fix Hurd implementation
     of setitimer.

And the above are all hurd fixes which don't impact any other arches
and IMO should be accepted on the "well, it can't make hurd any more
broken" principle. :P

unblock eglibc/2.13-38

-- System Information:
Debian Release: wheezy/sid
  APT prefers raring-updates
  APT policy: (500, 'raring-updates'), (500, 'raring-security'), (500, 'raring')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7.0-7-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u eglibc-2.13/debian/changelog eglibc-2.13/debian/changelog
--- eglibc-2.13/debian/changelog
+++ eglibc-2.13/debian/changelog
@@ -1,3 +1,38 @@
+eglibc (2.13-38) unstable; urgency=low
+
+  [ Adam Conrad ]
+  * debian/patches/arm/cvs-ldconfig-cache-abi.diff: Backport upstream
+    patch to re-enable ldconfig cache tagging for armhf binaries again.
+  * debian/patches/arm/unsubmitted-ldconfig-cache-abi.diff: Re-enable
+    and adjust to account for changes in cvs-ldconfig-cache-abi.diff.
+  * debian/debhelper.in/libc.preinst: Remove old ld.so.cache on upgrade.
+  * debian/control.in/amd64: Move libc6-amd64 from standard to optional.
+
+  [ Jonathan Nieder ]
+  * control.in/opt: correct misspelling of "Ezra" in descriptions of
+    *-i686 variants.  Thanks to Thorsten Glaser.
+  * patches/any/local-tst-eintr1-eagain.diff: new patch to work around
+    a race that lets pthread_create hit resource limits when the kernel
+    takes too long to clean up after joined threads.  (closes: #673596)
+
+  [ Samuel Thibault ]
+  * patches/any/local-fhs-linux-paths.diff: Patch vardb path on !linux too.
+  * Add patches/hurd-i386/libpthread_hurd_cond_wait.diff: New patch to add
+    support for translators with pthread.
+  * Add patches/hurd-i386/submitted-fork_port_leak.diff: New patch to fix port
+    leak on fork.
+  * libc0.3.symbols.hurd-i386: Add libpthread.so.0.3 symbols.
+  * Add patches/hurd-i386/tg-hurdsig-boot-fix.diff to fix
+    sigstate_is_global_rcv at boot in libpthread-based translators.
+  * patches/hurd-i386/tg-hurdsig-global-dispositions.diff: Update with Thomas'
+    fork deadlock fix.
+  * patches/hurd-i386/unsubmitted-single-hurdselect-timeout.diff: Temporarily
+    fix double select timeout on single fd.
+  * patches/hurd-i386/unsubmitted-setitimer_fix.diff: Fix Hurd implementation
+    of setitimer.
+
+ -- Adam Conrad <adconrad@0c3.net>  Sun, 30 Dec 2012 06:06:32 -0700
+
 eglibc (2.13-37) unstable; urgency=low
 
   [ Aurelien Jarno ]
diff -u eglibc-2.13/debian/control eglibc-2.13/debian/control
--- eglibc-2.13/debian/control
+++ eglibc-2.13/debian/control
@@ -591,7 +591,7 @@
 Package: libc6-amd64
 Architecture: i386
 Section: libs
-Priority: standard
+Priority: optional
 Depends: libc6 (= ${binary:Version}), ${misc:Depends}
 Conflicts: amd64-libs (<= 1.2)
 Description: Embedded GNU C Library: 64bit Shared libraries for AMD64
@@ -749,7 +749,7 @@
  used on an i686 class CPU (check the output of `uname -m').  This includes 
  Pentium Pro, Pentium II/III/IV, Celeron CPU's and similar class CPU's
  (including clones such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA 
- C3 Ezla).  
+ C3 Ezra).  
 
 Package: libc6-xen
 Architecture: i386
@@ -782,7 +782,7 @@
  used on an i686 class CPU (check the output of `uname -m').  This includes 
  Pentium Pro, Pentium II/III/IV, Celeron CPU's and similar class CPU's
  (including clones such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA 
- C3 Ezla).  
+ C3 Ezra).  
 
 Package: libc0.3-i686
 Architecture: hurd-i386
@@ -800,7 +800,7 @@
  used on an i686 class CPU (check the output of `uname -m').  This includes 
  Pentium Pro, Pentium II/III/IV, Celeron CPU's and similar class CPU's
  (including clones such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA 
- C3 Ezla).  
+ C3 Ezra).  
 
 Package: libc0.3-xen
 Architecture: hurd-i386
diff -u eglibc-2.13/debian/libc0.3.symbols.hurd-i386 eglibc-2.13/debian/libc0.3.symbols.hurd-i386
--- eglibc-2.13/debian/libc0.3.symbols.hurd-i386
+++ eglibc-2.13/debian/libc0.3.symbols.hurd-i386
@@ -943,0 +944,3 @@
+libpthread.so.0.3 #PACKAGE# #MINVER#
+#include "symbols.wildcards"
+ *@GLIBC_2.13_DEBIAN_38 2.13-38~
diff -u eglibc-2.13/debian/patches/series eglibc-2.13/debian/patches/series
--- eglibc-2.13/debian/patches/series
+++ eglibc-2.13/debian/patches/series
@@ -92,13 +92,14 @@
 arm/local-sigaction.diff
 arm/submitted-armhf-triplet.diff
 arm/cvs-clone-cantunwind.diff
-#arm/unsubmitted-ldconfig-cache-abi.diff
+arm/unsubmitted-ldconfig-cache-abi.diff
 arm/unsubmitted-ldso-abi-check.diff
 arm/cvs-syscall-mcount.diff
 arm/cvs-ucontext.diff
 arm/unsubmitted-armhf-linker.diff
 arm/local-soname-hack.diff
 arm/cvs-make-get-set-swap-context.diff
+arm/cvs-ldconfig-cache-abi.diff
 
 hppa/local-inlining.diff
 hppa/local-linuxthreads.diff
@@ -208,6 +209,11 @@
 hurd-i386/tg-chflags.diff
 hurd-i386/submitted-exec_filename.diff
 hurd-i386/unsubmitted-gnumach.defs.diff
+hurd-i386/submitted-fork_port_leak.diff
+hurd-i386/libpthread_hurd_cond_wait.diff
+hurd-i386/tg-hurdsig-boot-fix.diff
+hurd-i386/unsubmitted-single-hurdselect-timeout.diff
+hurd-i386/unsubmitted-setitimer_fix.diff
 
 kfreebsd/submitted-libc_once.diff
 kfreebsd/local-getaddrinfo-freebsd-kernel.diff
@@ -369,0 +376 @@
+any/local-tst-eintr1-eagain.diff
diff -u eglibc-2.13/debian/patches/any/local-fhs-linux-paths.diff eglibc-2.13/debian/patches/any/local-fhs-linux-paths.diff
--- eglibc-2.13/debian/patches/any/local-fhs-linux-paths.diff
+++ eglibc-2.13/debian/patches/any/local-fhs-linux-paths.diff
@@ -5,14 +5,26 @@
 # DP: Date: Unknown
 
 ---
+ sysdeps/generic/paths.h         |    2 +-
  sysdeps/unix/sysv/linux/paths.h |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
 --- a/sysdeps/unix/sysv/linux/paths.h
 +++ b/sysdeps/unix/sysv/linux/paths.h
 @@ -68,7 +68,7 @@
  /* Provide trailing slash, since mostly used for building pathnames. */
  #define	_PATH_DEV	"/dev/"
+ #define	_PATH_TMP	"/tmp/"
+-#define	_PATH_VARDB	"/var/db/"
++#define	_PATH_VARDB	"/var/lib/misc/"
+ #define	_PATH_VARRUN	"/var/run/"
+ #define	_PATH_VARTMP	"/var/tmp/"
+ 
+--- a/sysdeps/generic/paths.h
++++ b/sysdeps/generic/paths.h
+@@ -68,7 +68,7 @@
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define	_PATH_DEV	"/dev/"
  #define	_PATH_TMP	"/tmp/"
 -#define	_PATH_VARDB	"/var/db/"
 +#define	_PATH_VARDB	"/var/lib/misc/"
diff -u eglibc-2.13/debian/patches/arm/unsubmitted-ldconfig-cache-abi.diff eglibc-2.13/debian/patches/arm/unsubmitted-ldconfig-cache-abi.diff
--- eglibc-2.13/debian/patches/arm/unsubmitted-ldconfig-cache-abi.diff
+++ eglibc-2.13/debian/patches/arm/unsubmitted-ldconfig-cache-abi.diff
@@ -1,32 +1,8 @@
 ---
- elf/cache.c                                    |    2 
  ports/sysdeps/unix/sysv/linux/arm/dl-cache.h   |   34 ++++
  ports/sysdeps/unix/sysv/linux/arm/readelflib.c |  186 +++++++++++++++++++++++++
- sysdeps/generic/ldconfig.h                     |    1 
  4 files changed, 223 insertions(+)
 
---- a/elf/cache.c
-+++ b/elf/cache.c
-@@ -91,6 +91,9 @@
-       break;
-     case FLAG_MIPS64_LIBN64:
-       fputs (",64bit", stdout);
-+      break;
-+    case FLAG_ARM_HFABI:
-+      fputs (",hard-float", stdout);
-     case 0:
-       break;
-     default:
---- a/sysdeps/generic/ldconfig.h
-+++ b/sysdeps/generic/ldconfig.h
-@@ -34,6 +34,7 @@
- #define FLAG_POWERPC_LIB64	0x0500
- #define FLAG_MIPS64_LIBN32	0x0600
- #define FLAG_MIPS64_LIBN64	0x0700
-+#define FLAG_ARM_HFABI		0x0800
- 
- /* Name of auxiliary cache.  */
- #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
 --- /dev/null
 +++ b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
 @@ -0,0 +1,34 @@
@@ -53,7 +29,7 @@
 +#include <ldconfig.h>
 +
 +/* Redefine the cache ID for the new hf ABI; the sf ABI inverts the check.  */
-+#define _DL_CACHE_ARMHF_ID  (FLAG_ARM_HFABI | FLAG_ELF_LIBC6)
++#define _DL_CACHE_ARMHF_ID  (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6)
 +
 +#ifdef __ARM_PCS_VFP
 +#define _dl_cache_check_flags(flags) \
@@ -131,7 +107,7 @@
 +
 +  shdrs = file_contents + ehdr->e_shoff;
 +  for (i = 0; i < ehdr->e_shnum; i++)
-+    {        
++    {
 +      if (SHT_ARM_ATTRIBUTES == shdrs[i].sh_type)
 +        {
 +	  /* We've found a likely section. Load the contents and
@@ -147,14 +123,14 @@
 +	      unsigned long len = shdrs[i].sh_size - 1;
 +	      unsigned long namelen;
 +	      p++;
-+                
++
 +	      while (len > 0)
 +                {
 +		  unsigned long section_len = p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
 +		  if (section_len > len)
 +		    section_len = len;
 +
-+		  p += 4;                    
++		  p += 4;
 +		  len -= section_len;
 +		  section_len -= 4;
 +
@@ -166,7 +142,7 @@
 +		  namelen = strlen((char *)p) + 1;
 +		  p += namelen;
 +		  section_len -= namelen;
-+                    
++
 +		  /* We're in a valid section. Walk through this
 +		   * section looking for the tag we care about
 +		   * (ABI_VFP_args) */
@@ -182,7 +158,7 @@
 +		      if (size > section_len)
 +			size = section_len;
 +		      p += 4;
-+                        
++
 +		      section_len -= size;
 +		      end += size;
 +		      if (ATTR_TAG_FILE != tag)
@@ -210,8 +186,8 @@
 +                        }
 +                    }
 +                }
-+            }                
-+        }            
++            }
++        }
 +    }
 +  return 0;
 +}
@@ -240,11 +216,11 @@
 +    }
 +  ret = process_elf32_file (file_name, lib, flag, osversion, soname,
 +			    file_contents, file_length);
-+  
++
 +  if (!ret)
 +    /* Do we have a hard-float ABI library? */
 +    if (is_library_hf(file_name, file_contents, file_length))
-+      *flag = FLAG_ARM_HFABI|FLAG_ELF_LIBC6;
++      *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
 +  return ret;
 +}
 +
diff -u eglibc-2.13/debian/patches/hurd-i386/tg-hurdsig-global-dispositions.diff eglibc-2.13/debian/patches/hurd-i386/tg-hurdsig-global-dispositions.diff
--- eglibc-2.13/debian/patches/hurd-i386/tg-hurdsig-global-dispositions.diff
+++ eglibc-2.13/debian/patches/hurd-i386/tg-hurdsig-global-dispositions.diff
@@ -1,4 +1,3 @@
-From: Jeremie Koenig <jk@jk.fr.eu.org>
 Subject: [PATCH] Global signal dispositions.
 
 Although they should not change the
@@ -6,11 +5,70 @@
 new functions which can be used by libpthread to enable
 POSIX-conforming behavior of signals on a per-thread basis.
 
+YYYY-MM-DD  Jeremie Koenig  <jk@jk.fr.eu.org>
+
     e407ae3 Hurd signals: implement global signal dispositions
     38eb4b3 Hurd signals: provide a sigstate destructor
     344dfd6 Hurd signals: fix sigwait() for global signals
     fb055f2 Hurd signals: fix global untraced signals.
 
+YYYY-MM-DD  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* sysdeps/mach/hurd/fork.c (__fork): In the child, reinitialize
+	the global sigstate's lock.
+
+This is work in progress.
+
+This cures an issue that would very rarely cause a deadlock in the child
+in fork, tries to unlock ss' critical section lock at the end of fork.
+This will typically (always?) be observed in /bin/sh, which is not
+surprising as that is the foremost caller of fork.
+
+To reproduce an intermediate state, add an endless loop if
+_hurd_global_sigstate is locked after __proc_dostop (cast through
+volatile); that is, while still being in the fork's parent process.
+
+When that triggers (use the libtool testsuite), the signal thread has
+already locked ss (which is _hurd_global_sigstate), and is stuck at
+hurdsig.c:685 in post_signal, trying to lock _hurd_siglock (which the
+main thread already has locked and keeps locked until after
+__task_create).  This is the case that ss->thread == MACH_PORT_NULL, that
+is, a global signal.  In the main thread, between __proc_dostop and
+__task_create is the __thread_abort call on the signal thread which would
+abort any current kernel operation (but leave ss locked).  Later in fork,
+in the parent, when _hurd_siglock is unlocked in fork, the parent's
+signal thread can proceed and will unlock eventually the global sigstate.
+In the client, _hurd_siglock will likewise be unlocked, but the global
+sigstate never will be, as the client's signal thread has been configured
+to restart execution from _hurd_msgport_receive.  Thus, when the child
+tries to unlock ss' critical section lock at the end of fork, it will
+first lock the global sigstate, will spin trying to lock it, which can
+never be successful, and we get our deadlock.
+
+Options seem to be:
+
+  * Move the locking of _hurd_siglock earlier in post_signal -- but that
+    may generally impact performance, if this locking isn't generally
+    needed anyway?
+
+    On the other hand, would it actually make sense to wait here until we
+    are not any longer in a critical section (which is meant to disable
+    signal delivery anway (but not for preempted signals?))?
+
+  * Clear the global sigstate in the fork's child with the rationale that
+    we're anyway restarting the signal thread from a clean state.  This
+    has now been implemented.
+
+Why has this problem not been observed before Jérémie's patches?  (Or has
+it?  Perhaps even more rarely?)  In _S_msg_sig_post, the signal is now
+posted to a *global receiver thread*, whereas previously it was posted to
+the *designated signal-receiving thread*.  The latter one was in a
+critical section in fork, so didn't try to handle the signal until after
+leaving the critical section?  (Not completely analyzed and verified.)
+
+Another question is what the signal is that is being received
+during/around the time __proc_dostop executes.
+
 ---
  hurd/ctty-input.c                   |   18 +-
  hurd/ctty-output.c                  |   18 +-
@@ -831,17 +889,32 @@
        /* Claim our sigstate structure and unchain the rest: the
  	 threads existed in the parent task but don't exist in this
  	 task (the child process).  Delay freeing them until later
-@@ -645,6 +642,10 @@
+@@ -638,6 +635,25 @@ __fork (void)
+       ss->next = NULL;
        _hurd_sigstates = ss;
        __mutex_unlock (&_hurd_siglock);
- 
++      /* Earlier on, the global sigstate may have been tainted and now needs to
++         be reinitialized.  Nobody is interested in its present state anymore:
++         we're not, the signal thread will be restarted, and there are no other
++         threads.
++
++         We can't simply allocate a fresh global sigstate here, as
++         _hurd_thread_sigstate will call malloc and that will deadlock trying
++         to determine the current thread's sigstate.  */
++#if 0
++      _hurd_thread_sigstate_init (_hurd_global_sigstate, MACH_PORT_NULL);
++#else
++      /* Only reinitialize the lock -- otherwise we might have to do additional
++         setup as done in hurdsig.c:_hurdsig_init.  */
++      __spin_lock_init (&_hurd_global_sigstate->lock);
++#endif
++
 +      /* We are one of the (exactly) two threads in this new task, we
 +	 will take the task-global signals.  */
 +      _hurd_sigstate_set_global_rcv (ss);
-+
+ 
        /* Fetch our new process IDs from the proc server.  No need to
  	 refetch our pgrp; it is always inherited from the parent (so
- 	 _hurd_pgrp is already correct), and the proc server will send us a
 --- a/sysdeps/mach/hurd/i386/sigreturn.c
 +++ b/sysdeps/mach/hurd/i386/sigreturn.c
 @@ -1,4 +1,5 @@
diff -u eglibc-2.13/debian/control.in/opt eglibc-2.13/debian/control.in/opt
--- eglibc-2.13/debian/control.in/opt
+++ eglibc-2.13/debian/control.in/opt
@@ -14,7 +14,7 @@
  used on an i686 class CPU (check the output of `uname -m').  This includes 
  Pentium Pro, Pentium II/III/IV, Celeron CPU's and similar class CPU's
  (including clones such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA 
- C3 Ezla).  
+ C3 Ezra).  
 
 Package: libc6-xen
 Architecture: i386
@@ -47,7 +47,7 @@
  used on an i686 class CPU (check the output of `uname -m').  This includes 
  Pentium Pro, Pentium II/III/IV, Celeron CPU's and similar class CPU's
  (including clones such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA 
- C3 Ezla).  
+ C3 Ezra).  
 
 Package: libc0.3-i686
 Architecture: hurd-i386
@@ -65,7 +65,7 @@
  used on an i686 class CPU (check the output of `uname -m').  This includes 
  Pentium Pro, Pentium II/III/IV, Celeron CPU's and similar class CPU's
  (including clones such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA 
- C3 Ezla).  
+ C3 Ezra).  
 
 Package: libc0.3-xen
 Architecture: hurd-i386
diff -u eglibc-2.13/debian/control.in/amd64 eglibc-2.13/debian/control.in/amd64
--- eglibc-2.13/debian/control.in/amd64
+++ eglibc-2.13/debian/control.in/amd64
@@ -1,7 +1,7 @@
 Package: libc6-amd64
 Architecture: i386
 Section: libs
-Priority: standard
+Priority: optional
 Depends: libc6 (= ${binary:Version}), ${misc:Depends}
 Conflicts: amd64-libs (<= 1.2)
 Description: Embedded GNU C Library: 64bit Shared libraries for AMD64
diff -u eglibc-2.13/debian/debhelper.in/libc.preinst eglibc-2.13/debian/debhelper.in/libc.preinst
--- eglibc-2.13/debian/debhelper.in/libc.preinst
+++ eglibc-2.13/debian/debhelper.in/libc.preinst
@@ -438,12 +438,13 @@
 esac
 
 if [ -n "$preversion" ]; then
-    if dpkg --compare-versions "$preversion" lt 2.13-5; then
+    if dpkg --compare-versions "$preversion" lt 2.13-38; then
        # upgrading from a pre-multiarch libc to a multiarch libc; we have
        # to blow away /etc/ld.so.cache, otherwise the old unpacked libc
        # is still first in the cache and segfaults when combined with
        # our newly-unpacked ld.so. Do this last to avoid slowing down the
-       # rest of the upgrade.
+       # rest of the upgrade.  Version number bumped to 2.13-38 to also
+       # cover cache format upgrades for ARM.
        rm -f /etc/ld.so.cache
     fi
 fi
diff -u eglibc-2.13/debian/local/manpages/mtrace.1 eglibc-2.13/debian/local/manpages/mtrace.1
--- eglibc-2.13/debian/local/manpages/mtrace.1
+++ eglibc-2.13/debian/local/manpages/mtrace.1
@@ -1,5 +1,5 @@
 .rn '' }`
-.\" $RCSfile: mtrace.1,v $$Revision: 1.1 $$Date: 2011-05-01 17:30:41 +0200 (dim. 01 mai 2011) $
+.\" $RCSfile: mtrace.1,v $$Revision: 1.1 $$Date: 2008-08-08 13:49:44 -0600 (Fri, 08 Aug 2008) $
 .\"
 .\" $Log: mtrace.1,v $
 .\" Revision 1.1  2003/11/03 17:37:27  jbailey
diff -u eglibc-2.13/debian/local/manpages/iconvconfig.8 eglibc-2.13/debian/local/manpages/iconvconfig.8
--- eglibc-2.13/debian/local/manpages/iconvconfig.8
+++ eglibc-2.13/debian/local/manpages/iconvconfig.8
@@ -1,5 +1,5 @@
 .rn '' }`
-.\" $RCSfile: iconvconfig.8,v $$Revision: 1.1 $$Date: 2011-05-01 17:30:41 +0200 (dim. 01 mai 2011) $
+.\" $RCSfile: iconvconfig.8,v $$Revision: 1.1 $$Date: 2008-08-08 13:49:44 -0600 (Fri, 08 Aug 2008) $
 .\"
 .\" $Log: iconvconfig.8,v $
 .\" Revision 1.1  2003/11/03 17:37:27  jbailey
diff -u eglibc-2.13/debian/local/manpages/gencat.1 eglibc-2.13/debian/local/manpages/gencat.1
--- eglibc-2.13/debian/local/manpages/gencat.1
+++ eglibc-2.13/debian/local/manpages/gencat.1
@@ -1,5 +1,5 @@
 .rn '' }`
-.\" $RCSfile: gencat.1,v $$Revision: 1.1 $$Date: 2011-05-01 17:30:41 +0200 (dim. 01 mai 2011) $
+.\" $RCSfile: gencat.1,v $$Revision: 1.1 $$Date: 2008-08-08 13:49:44 -0600 (Fri, 08 Aug 2008) $
 .\"
 .\" $Log: gencat.1,v $
 .\" Revision 1.1  2003/11/03 17:37:27  jbailey
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/arm/cvs-ldconfig-cache-abi.diff
+++ eglibc-2.13/debian/patches/arm/cvs-ldconfig-cache-abi.diff
@@ -0,0 +1,40 @@
+commit 6665d4a25da6dc1788010466f6f52e1df94a048b
+Author: Steve McIntyre <steve.mcintyre@linaro.org>
+Date:   Mon Nov 19 01:12:53 2012 -0500
+
+    Add ldconfig cache tag handling for ARM hard-float ABI
+    
+    	* sysdeps/generic/ldconfig.h (FLAG_ARM_LIBHF): New macro.
+    	* elf/cache.c (print_entry): Print ",hard-float" for
+    	FLAG_ARM_LIBHF.
+    
+    Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
+    Reviewed-by: Carlos O'Donell <carlos@systemhalted.org>
+
+diff --git a/elf/cache.c b/elf/cache.c
+index db8b9fa..3336bab 100644
+--- a/elf/cache.c
++++ b/elf/cache.c
+@@ -94,6 +94,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
+       break;
+     case FLAG_MIPS64_LIBN64:
+       fputs (",64bit", stdout);
++      break;
++    case FLAG_ARM_LIBHF:
++      fputs (",hard-float", stdout);
++      break;
+     case 0:
+       break;
+     default:
+diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
+index ef3f4b9..a805284 100644
+--- a/sysdeps/generic/ldconfig.h
++++ b/sysdeps/generic/ldconfig.h
+@@ -34,6 +34,7 @@
+ #define FLAG_POWERPC_LIB64	0x0500
+ #define FLAG_MIPS64_LIBN32	0x0600
+ #define FLAG_MIPS64_LIBN64	0x0700
++#define FLAG_ARM_LIBHF		0x0900
+ 
+ /* Name of auxiliary cache.  */
+ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/hurd-i386/tg-hurdsig-boot-fix.diff
+++ eglibc-2.13/debian/patches/hurd-i386/tg-hurdsig-boot-fix.diff
@@ -0,0 +1,25 @@
+2012-09-05  Richard Braun  <rbraun@sceen.net>
+
+       * hurd/hurdsig.c (sigstate_is_global_rcv): Do not return true
+       if _HURD_GLOBAL_SIGSTATE is null.
+
+---
+ hurd/hurdsig.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
+index 140f951..7840cd5 100644
+--- a/hurd/hurdsig.c
++++ b/hurd/hurdsig.c
+@@ -159,7 +159,8 @@ _hurd_sigstate_set_global_rcv (struct hurd_sigstate *ss)
+ static int
+ sigstate_is_global_rcv (const struct hurd_sigstate *ss)
+ {
+-  return ss->actions[0].sa_handler == SIG_IGN;
++  return (_hurd_global_sigstate != NULL)
++	 && (ss->actions[0].sa_handler == SIG_IGN);
+ }
+ 
+ /* Lock/unlock a hurd_sigstate structure.  If the accessors below require
+-- 
+tg: (2ac13c4..) t/hurdsig-boot-fix (depends on: t/hurdsig-global-dispositions)
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/hurd-i386/unsubmitted-single-hurdselect-timeout.diff
+++ eglibc-2.13/debian/patches/hurd-i386/unsubmitted-single-hurdselect-timeout.diff
@@ -0,0 +1,35 @@
+commit fffcbbb0b5ff8864086f7b58fdbb8aa4c71943d0
+Author: Richard Braun <rbraun@sceen.net>
+Date:   Mon Dec 17 09:57:41 2012 +0000
+
+    Fix _hurd_select for single fd sets
+    
+    The function attempts to optimize this case by performing one IPC system call
+    with the timeout included among the parameters, but in the absence of a reply,
+    it will call mach_msg again with the same timeout later, effectively doubling
+    the total timeout of the select/poll call.
+    
+    Remove this optimization for the time being.
+    
+    * hurd/hurdselect.c (_hurd_select): Always call __io_select with no timeout.
+
+---
+ hurdselect.c |    5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
+index 21ba5f4..a02c7be 100644
+--- a/hurd/hurdselect.c
++++ b/hurd/hurdselect.c
+@@ -236,10 +236,7 @@ _hurd_select (int nfds,
+ 	  {
+ 	    int type = d[i].type;
+ 	    d[i].reply_port = __mach_reply_port ();
+-	    err = __io_select (d[i].io_port, d[i].reply_port,
+-			       /* Poll only if there's a single descriptor.  */
+-			       (firstfd == lastfd) ? to : 0,
+-			       &type);
++	    err = __io_select (d[i].io_port, d[i].reply_port, 0, &type);
+ 	    switch (err)
+ 	      {
+ 	      case MACH_RCV_TIMED_OUT:
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/hurd-i386/unsubmitted-setitimer_fix.diff
+++ eglibc-2.13/debian/patches/hurd-i386/unsubmitted-setitimer_fix.diff
@@ -0,0 +1,34 @@
+commit c09eae7f3f6c714da378baa492414f73974f3a69
+Author: Richard Braun <rbraun@sceen.net>
+Date:   Wed Dec 26 16:31:14 2012 +0000
+
+    Fix Hurd implementation of setitimer.
+    
+    The preemptor sigcode doesn't match since the POSIX sigcode SI_TIMER is
+    used when SIGALRM is sent. In addition, The inline version of
+    hurd_preempt_signals doesn't update _hurdsig_preempted_set. For these
+    reasons, the preemptor would be skipped by post_signal.
+    
+    * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Fix preemptor setup.
+
+diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c
+index fe057c9..8c0d92d 100644
+--- a/sysdeps/mach/hurd/setitimer.c
++++ b/sysdeps/mach/hurd/setitimer.c
+@@ -192,7 +192,7 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
+ 	 run `restart_itimer' each time a SIGALRM would arrive.  */
+       static struct hurd_signal_preemptor preemptor =
+ 	{
+-	  __sigmask (SIGALRM), 0, 0,
++	  __sigmask (SIGALRM), SI_TIMER, SI_TIMER,
+ 	  &restart_itimer,
+ 	};
+       __mutex_lock (&_hurd_siglock);
+@@ -200,6 +200,7 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
+ 	{
+ 	  preemptor.next = _hurdsig_preemptors;
+ 	  _hurdsig_preemptors = &preemptor;
++	  _hurdsig_preempted_set |= preemptor.signals;
+ 	}
+       __mutex_unlock (&_hurd_siglock);
+ 
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/hurd-i386/submitted-fork_port_leak.diff
+++ eglibc-2.13/debian/patches/hurd-i386/submitted-fork_port_leak.diff
@@ -0,0 +1,27 @@
+	* sysdeps/mach/hurd/fork.c (__fork): Install correct number of
+	send rights for its main user thread in NEWTASK.
+
+http://sourceware.org/ml/libc-alpha/2012-11/msg00578.html
+
+diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
+index 644838c..0e29f0f 100644
+--- a/sysdeps/mach/hurd/fork.c
++++ b/sysdeps/mach/hurd/fork.c
+@@ -454,15 +453,10 @@ __fork (void)
+ 	  (err = __mach_port_insert_right (newtask, ss->thread,
+ 					   thread, MACH_MSG_TYPE_COPY_SEND)))
+ 	LOSE;
+-      /* We have one extra user reference created at the beginning of this
+-	 function, accounted for by mach_port_names (and which will thus be
+-	 accounted for in the child below).  This extra right gets consumed
+-	 in the child by the store into _hurd_sigthread in the child fork.  */
+-      /* XXX consumed? (_hurd_sigthread is no more) */
+       if (thread_refs > 1 &&
+ 	  (err = __mach_port_mod_refs (newtask, ss->thread,
+ 				       MACH_PORT_RIGHT_SEND,
+-				       thread_refs)))
++				       thread_refs - 1)))
+ 	LOSE;
+       if ((_hurd_msgport_thread != MACH_PORT_NULL) /* Let user have none.  */
+ 	  && ((err = __mach_port_deallocate (newtask, _hurd_msgport_thread)) ||
+
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/hurd-i386/libpthread_hurd_cond_wait.diff
+++ eglibc-2.13/debian/patches/hurd-i386/libpthread_hurd_cond_wait.diff
@@ -0,0 +1,234 @@
+Add pthread_hurd_cond_wait_np, needed by translators with pthreads.
+
+diff --git a/libpthread/Makefile b/libpthread/Makefile
+index c1d8d33..2c7645d 100644
+--- a/libpthread/Makefile
++++ b/libpthread/Makefile
+@@ -114,6 +114,7 @@ libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate	    \
+ 	pt-cond-signal							    \
+ 	pt-cond-wait							    \
+ 	pt-cond-timedwait						    \
++	pt-hurd-cond-wait						    \
+ 									    \
+ 	pt-stack-alloc							    \
+ 	pt-thread-alloc							    \
+--- a/Versions.def
++++ b/Versions.def
+@@ -98,6 +98,7 @@ libpthread {
+   GLIBC_2.6
+   GLIBC_2.11
+   GLIBC_2.12
++  GLIBC_2.13_DEBIAN_38
+   GLIBC_PRIVATE
+ }
+ libresolv {
+index 77eb870..ca975e0 100644
+--- a/libpthread/Versions
++++ b/libpthread/Versions
+@@ -129,4 +129,7 @@ libpthread {
+     __pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
+     _pthread_spin_lock;
+   }
++  GLIBC_2.13_DEBIAN_38 {
++    pthread_hurd_cond_wait_np;
++  }
+ }
+diff --git a/libpthread/pthread/pt-internal.h b/libpthread/pthread/pt-internal.h
+index 067fb73..291baf5 100644
+--- a/libpthread/pthread/pt-internal.h
++++ b/libpthread/pthread/pt-internal.h
+@@ -292,8 +292,9 @@ extern error_t __pthread_sigstate (struct __pthread *__restrict thread, int how,
+ 				   int clear_pending);
+ 
+ 
+-/* Default thread attributes.  */
+-extern const struct __pthread_attr __pthread_default_attr;
++/* Default thread attributes.
++   FIXME Normally const, see sysdeps/mach/hurd/pt-sysdep.c.  */
++extern struct __pthread_attr __pthread_default_attr;
+ 
+ /* Default barrier attributes.  */
+ extern const struct __pthread_barrierattr __pthread_default_barrierattr;
+diff --git a/libpthread/sysdeps/generic/pt-attr.c b/libpthread/sysdeps/generic/pt-attr.c
+index e501dc7..4f95918 100644
+--- a/libpthread/sysdeps/generic/pt-attr.c
++++ b/libpthread/sysdeps/generic/pt-attr.c
+@@ -24,7 +24,8 @@
+ 
+ #include <pt-internal.h>
+ 
+-const struct __pthread_attr __pthread_default_attr =
++/* FIXME Normally const, see sysdeps/mach/hurd/pt-sysdep.c.  */
++struct __pthread_attr __pthread_default_attr =
+ {
+   schedparam: { sched_priority: 0 },
+   stacksize: PTHREAD_STACK_DEFAULT,
+diff --git a/libpthread/sysdeps/mach/hurd/bits/pthread-np.h b/libpthread/sysdeps/mach/hurd/bits/pthread-np.h
+new file mode 100644
+index 0000000..9817a06
+--- /dev/null
++++ b/libpthread/sysdeps/mach/hurd/bits/pthread-np.h
+@@ -0,0 +1,32 @@
++/* Non-portable functions. Hurd on Mach version.
++   Copyright (C) 2008 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public License as
++   published by the Free Software Foundation; either version 2 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++/*
++ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
++ */
++
++#ifndef _BITS_PTHREAD_NP_H
++#define _BITS_PTHREAD_NP_H	1
++
++/* Same as pthread_cond_wait, but for Hurd-specific cancellation.
++   See hurd_thread_cancel.  */
++extern int pthread_hurd_cond_wait_np (pthread_cond_t *__restrict __cond,
++				      pthread_mutex_t *__restrict __mutex);
++
++#endif /* bits/pthread-np.h */
+diff --git a/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c b/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c
+new file mode 100644
+index 0000000..d2b5847
+--- /dev/null
++++ b/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c
+@@ -0,0 +1,93 @@
++/* pthread_hurd_cond_wait.  Hurd-specific wait on a condition.
++   Copyright (C) 2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public License as
++   published by the Free Software Foundation; either version 2 of the
++   License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <assert.h>
++#include <hurd/signal.h>
++
++#include <pt-internal.h>
++
++int
++pthread_hurd_cond_wait_np (pthread_cond_t *cond, pthread_mutex_t *mutex)
++{
++  /* This function will be called by hurd_thread_cancel while we are blocked
++     We wake up all threads blocked on COND, so our thread will wake up and
++     notice the cancellation flag.  */
++  void cancel_me (void)
++    {
++      pthread_cond_broadcast (cond);
++    }
++  struct hurd_sigstate *ss = _hurd_self_sigstate ();
++  struct __pthread *self = _pthread_self ();
++  int cancel;
++
++  assert (ss->intr_port == MACH_PORT_NULL); /* Sanity check for signal bugs. */
++
++  /* Atomically enqueue our thread on the condition variable's queue of
++     waiters, and mark our sigstate to indicate that `cancel_me' must be
++     called to wake us up.  We must hold the sigstate lock while acquiring
++     the condition variable's lock and tweaking it, so that
++     hurd_thread_cancel can never suspend us and then deadlock in
++     pthread_cond_broadcast waiting for the condition variable's lock.  */
++
++  __spin_lock (&ss->lock);
++  __pthread_spin_lock (&cond->__lock);
++  cancel = ss->cancel;
++  if (cancel)
++    /* We were cancelled before doing anything.  Don't block at all.  */
++    ss->cancel = 0;
++  else
++    {
++      /* Put us on the queue so that pthread_cond_broadcast will know to wake
++         us up.  */
++      __pthread_enqueue (&cond->__queue, self);
++      /* Tell hurd_thread_cancel how to unblock us.  */
++      ss->cancel_hook = &cancel_me;
++    }
++  __pthread_spin_unlock (&cond->__lock);
++  __spin_unlock (&ss->lock);
++
++
++  if (cancel)
++    /* Cancelled on entry.  Just leave the mutex locked.  */
++    mutex = NULL;
++  else
++    {
++      /* Now unlock the mutex and block until woken.  */
++      __pthread_mutex_unlock (mutex);
++      __pthread_block (self);
++    }
++
++  __spin_lock (&ss->lock);
++  /* Clear the hook, now that we are done blocking.  */
++  ss->cancel_hook = NULL;
++  /* Check the cancellation flag; we might have unblocked due to
++     cancellation rather than a normal pthread_cond_signal or
++     pthread_cond_broadcast (or we might have just happened to get cancelled
++     right after waking up).  */
++  cancel |= ss->cancel;
++  ss->cancel = 0;
++  __spin_unlock (&ss->lock);
++
++  if (mutex)
++    /* Reacquire the mutex and return.  */
++    __pthread_mutex_lock (mutex);
++
++  return cancel;
++}
+diff --git a/libpthread/sysdeps/mach/hurd/pt-sysdep.c b/libpthread/sysdeps/mach/hurd/pt-sysdep.c
+index f40fee5..882af69 100644
+--- a/sysdeps/mach/hurd/pt-sysdep.c
++++ b/libpthread/sysdeps/mach/hurd/pt-sysdep.c
+@@ -30,6 +30,16 @@
+ 
+ __thread struct __pthread *___pthread_self;
+ 
++/* Allow programs that know about this library to override the default stack
++   size.
++
++   FIXME Stack sizes should normally be set at thread creation time using the
++   standard interface, but Hurd threadvars have special alignment constraints.
++   Until they are completely replaced with correct TLS, make this hack
++   available.  */
++extern size_t __pthread_stack_default_size;
++weak_extern(__pthread_stack_default_size);
++
+ /* Forward.  */
+ static void *init_routine (void);
+ 
+@@ -46,6 +56,10 @@ init_routine (void)
+   struct __pthread *thread;
+   int err;
+ 
++  /* FIXME */
++  if (&__pthread_stack_default_size != NULL)
++    __pthread_default_attr.stacksize = __pthread_stack_default_size;
++
+   /* Initialize the library.  */
+   __pthread_init ();
+ 
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/any/local-tst-eintr1-eagain.diff
+++ eglibc-2.13/debian/patches/any/local-tst-eintr1-eagain.diff
@@ -0,0 +1,25 @@
+2012-06-06  Jonathan Nieder  <jrnieder@gmail.com>
+
+	* nptl/tst-eintr1.c (tf1): Tolerate EAGAIN from pthread_create.
+
+---
+
+--- a/nptl/tst-eintr1.c
++++ b/nptl/tst-eintr1.c
+@@ -49,6 +49,16 @@
+ 	      puts ("pthread_create returned EINTR");
+ 	      exit (1);
+ 	    }
++	  if (e == EAGAIN)
++	    {
++	      /* The kernel might not have processed the last few
++	         pthread_join()s yet.  Tolerate that, but record the
++	         event in test output so attentive people reading
++	         logs can notice if pthread_join() stops working
++	         altogether.  */
++	      write (STDOUT_FILENO, "!", 1);
++	      continue;
++	    }
+ 
+ 	  char buf[100];
+ 	  printf ("tf1: pthread_create failed: %s\n",

Reply to: