Bug#755397: glibc FTBFS on alpha: tst-eintr3 sometimes fails.

2014-07-20 Thread Michael Cree
Source: glibc
Version: 2.19-7
Severity: important
User: debian-al...@lists.debian.org
Usertags: alpha
Justification: Fails to build from source but built in the past.

The test tst-eintr3 sometimes fails in the build of glibc on alpha
and has done so twice in a row in attempting to build 2.19-7.

It's an intermittant fault that appears to only occur on a
multiprocessor SMP system (which the buildd imago is).  Running the
test manually 40 or so times never failed when running a UP kernel.

To make testing faster I have used upstream glibc source on the 2.19
branch configuring with --enable-hardcoded-path-in-tests and running
tst-eintr3 with the --direct option.  It occasionally segfaults.
Getting a core dump and analysing with gdb gives the following:

Core was generated by `/home/mjc/toolchain/glibc-build/nptl/tst-eintr3 
--direct'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  start_thread (arg=0x2000121f1f0) at pthread_create.c:243
243   __resp = pd-res;

(gdb) bt full
#0  start_thread (arg=0x2000121f1f0) at pthread_create.c:243
pd = 0x2000121f1f0
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0 repeats 17 times}, 
  mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x203da00 
start_thread, 
  0x2000121f1f0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 
252416}}}
not_first_call = optimized out
robust = optimized out
pagesize_m1 = optimized out
sp = optimized out
freesize = optimized out
__PRETTY_FUNCTION__ = start_thread
#1  0x02177d24 in thread_start ()
at ../ports/sysdeps/unix/sysv/linux/alpha/clone.S:111
No locals.

(gdb) disass /m

Dump of assembler code for function start_thread:
232 {
   0x0203da00 +0: ldahgp,3(t12)
   0x0203da04 +4: lda gp,-14800(gp)
   0x0203da08 +8: lda sp,-240(sp)
   0x0203da14 +20:stq fp,40(sp)
   0x0203da18 +24:mov sp,fp
   0x0203da24 +36:stq s0,8(sp)
   0x0203da28 +40:stq ra,0(sp)
   0x0203da30 +48:stq s1,16(sp)
   0x0203da38 +56:stq s2,24(sp)
   0x0203da3c +60:stq s3,32(sp)
   0x0203da40 +64:stq a0,224(fp)

233   struct pthread *pd = (struct pthread *) arg;
234 
235 #if HP_TIMING_AVAIL
236   /* Remember the time when the thread was started.  */
237   hp_timing_t now;
238   HP_TIMING_NOW (now);
239   THREAD_SETMEM (pd, cpuclock_offset, now);
240 #endif
241 
242   /* Initialize resolver state pointer.  */
243   __resp = pd-res;
   0x0203da0c +12:rduniq
   0x0203da10 +16:ldq t0,-32656(gp)
   0x0203da20 +32:addqv0,t0,t0
   0x0203da2c +44:lda t1,1208(a0)
   0x0203da34 +52:mov v0,s0
= 0x0203da44 +68:stq t1,0(t0)


The __resp variable appears to be a thread local variable being
accessed (well, written) by the initial exec TLS model.  The rduniq
PALcall should put the thread pointer (from the PCB) into register
v0.  Now let's check the address being written to at the point of
the segfault.

(gdb) print /x $t0
$1 = 0x18

That's definitely not a valid memory location since the first page of
memory starting at location 0 should be inaccessible.  Checking the
thread pointer:

(gdb) print /x $v0
$2 = 0x0

Ouch!  That looks like the thread pointer in the PCB has not been
initialised.

Running tst-eintr3 under gdb and setting a break point on line 243
reveals that, in general, the rduniq PALcall does return a valid
memory address (and presumably correctly the thread pointer), but,
occassionaly on an SMP system, it can return 0.  

This is as far as I have got with debugging.  Presumably there is a
wruniq PALcode call somewhere that sets up the thread pointer in the
PCB and that might be the next place to investigate what is going
on.

Cheers
Michael.


-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140720102602.GB12779@omega



Bug#745380: src:eglibc: support non-multilib builds

2014-07-20 Thread Helmut Grohne
On Mon, Apr 21, 2014 at 07:58:51AM +0200, Helmut Grohne wrote:
 Please consider the attached patch to achieve this goal.

Please find an updated patch attached. Changes since last version:

 * Add Build-Profiles headers to binary packages.
 * Don't treat optimized packages (e.g. i686) as multilib (thanks to
   Aurelien Jarno).
 * Introduce GLIBC_MULTILIB_PASSES to work the same way as
   DEB_ARCH_MULTILIB_PACKAGES (thanks to Aurelien Jarno).
 * Support new architectures (mips*).

Helmut
diff -Nru glibc-2.19/debian/changelog glibc-2.19/debian/changelog
--- glibc-2.19/debian/changelog 2014-07-13 01:31:22.0 +0200
+++ glibc-2.19/debian/changelog 2014-07-19 07:38:01.0 +0200
@@ -1,3 +1,11 @@
+glibc (2.19-7.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Add a nobiarch build profile that inhibits all multilib packages from
+being built. (Closes: #745380)
+
+ -- Helmut Grohne hel...@subdivi.de  Sat, 19 Jul 2014 07:37:22 +0200
+
 glibc (2.19-7) unstable; urgency=high
 
   * debian/patches/localedata/unsubmitted-tst-setlocale3-ENV.diff: Apply
diff -Nru glibc-2.19/debian/control.in/amd64 glibc-2.19/debian/control.in/amd64
--- glibc-2.19/debian/control.in/amd64  2014-06-27 04:28:51.0 +0200
+++ glibc-2.19/debian/control.in/amd64  2014-07-19 07:53:34.0 +0200
@@ -4,7 +4,7 @@
 Priority: optional
 Depends: libc6 (= ${binary:Version}), ${misc:Depends}
 Conflicts: amd64-libs (= 1.2)
-Build-Profiles: !stage1
+Build-Profiles: !stage1 !nobiarch
 Description: GNU C Library: 64bit Shared libraries for AMD64
  This package includes shared versions of the standard C library and the
  standard math library, as well as many others. This is the 64bit version
@@ -19,6 +19,7 @@
 Conflicts: libc6-dev ( 2.13-14)
 Replaces: amd64-libs-dev (= 1.2), libc6-dev ( 2.13-11)
 Provides: lib64c-dev
+Build-Profiles: !nobiarch
 Description: GNU C Library: 64bit Development Libraries for AMD64
  Contains the symlinks and object files needed to compile and link programs
  which use the standard C library. This is the 64bit version of the
diff -Nru glibc-2.19/debian/control.in/armel glibc-2.19/debian/control.in/armel
--- glibc-2.19/debian/control.in/armel  2014-06-27 04:28:51.0 +0200
+++ glibc-2.19/debian/control.in/armel  2014-07-19 07:53:48.0 +0200
@@ -3,7 +3,7 @@
 Section: libs
 Priority: optional
 Depends: libc6 (= ${binary:Version}), ${misc:Depends}
-Build-Profiles: !stage1
+Build-Profiles: !stage1 !nobiarch
 Description: GNU C Library: ARM softfp shared libraries for armhf
  This package includes shared versions of the standard C
  library and the standard math library, as well as many others.
@@ -15,6 +15,7 @@
 Priority: optional
 Depends: libc6-armel (= ${binary:Version}), libc6-dev (= ${binary:Version}), 
${misc:Depends}
 Recommends: gcc-multilib
+Build-Profiles: !nobiarch
 Description: GNU C Library: ARM softfp development libraries for armhf
  Contains the symlinks and object files needed to compile and link programs
  which use the standard C library. This is the ARM softfp version of the
diff -Nru glibc-2.19/debian/control.in/armhf glibc-2.19/debian/control.in/armhf
--- glibc-2.19/debian/control.in/armhf  2014-06-27 04:28:51.0 +0200
+++ glibc-2.19/debian/control.in/armhf  2014-07-19 07:54:00.0 +0200
@@ -3,7 +3,7 @@
 Section: libs
 Priority: optional
 Depends: libc6 (= ${binary:Version}), ${misc:Depends}
-Build-Profiles: !stage1
+Build-Profiles: !stage1 !nobiarch
 Description: GNU C Library: ARM hard float shared libraries for armel
  This package includes shared versions of the standard C
  library and the standard math library, as well as many others.
@@ -15,6 +15,7 @@
 Priority: optional
 Depends: libc6-armhf (= ${binary:Version}), libc6-dev (= ${binary:Version}), 
${misc:Depends}
 Recommends: gcc-multilib
+Build-Profiles: !nobiarch
 Description: GNU C Library: ARM hard float development libraries for armel
  Contains the symlinks and object files needed to compile and link programs
  which use the standard C library. This is the ARM hard float version of the
diff -Nru glibc-2.19/debian/control.in/i386 glibc-2.19/debian/control.in/i386
--- glibc-2.19/debian/control.in/i386   2014-06-27 04:28:51.0 +0200
+++ glibc-2.19/debian/control.in/i386   2014-07-19 07:54:14.0 +0200
@@ -5,7 +5,7 @@
 Depends: libc6 (= ${binary:Version}), ${misc:Depends}
 Replaces: libc6-dev-i386
 Breaks: fakeroot ( 1.12.3), gnu-efi ( 3.0e-3), fakechroot ( 2.9-1.1), 
fglrx-glx-ia32 ( 1:9-6-1), ia32-libs ( 20090804), ia32-libs-gtk ( 
20090804), lib32asound2 ( 1.0.20-3), lib32asound2-dev ( 1.0.20-3), 
lib32bz2-1.0 ( 1.0.5-3), lib32bz2-dev ( 1.0.5-3), lib32ffi-dev ( 
3.0.9~rc9-1), lib32ffi5 ( 3.0.9~rc9-1), lib32g2c0 ( 1:3.4.6-10), lib32gcc1 
( 1:4.4.0-7), lib32gfortran3 ( 4.4.0-7), lib32gmp3 ( 2:4.3.1+dfsg-3), 
lib32gmp3-dev ( 2:4.3.1+dfsg-3), lib32gmpxx4 ( 2:4.3.1+dfsg-3), lib32gomp1 
( 4.4.0-7), lib32icu-dev ( 4.0.1-3), lib32icu40 ( 4.0.1-3), lib32mudflap0 
( 4.4.0-7),