Bug#383976: unable to upgrade package libc6

2006-08-22 Thread Aurelien Jarno
On Tue, Aug 22, 2006 at 08:54:41AM +0200, [EMAIL PROTECTED] wrote:
 Dnia 21-08-2006, pon o godzinie 17:06 +0200, Aurelien Jarno napisał(a):
  Hi,
 
  On Mon, Aug 21, 2006 at 10:15:10AM +0200, Tomasz Cichecki wrote:
   Package: libc6
   Version: 2.3.6-19
   Severity: grave
   Justification: renders package unusable
  
   I cannot upgrade from libc6_2.3.6-19 to libc6_2.3.6.ds1-2
   Below screen dump:
   [EMAIL PROTECTED]:/usr/share/doc/libc6$ export LC_ALL=C
   [EMAIL PROTECTED]:/usr/share/doc/libc6$ sudo apt-get install libc6
   Reading package lists... Done
   Building dependency tree... Done
   Suggested packages:
 glibc-doc
 The following packages will be upgraded:
   libc6
   1 upgraded, 0 newly installed, 0 to remove and 93 not upgraded.
   1 not fully installed or removed.
   Need to get 0B/4696kB of archives.
   After unpacking 0B of additional disk space will be used.
   (Reading database ... 175620 files and directories currently
   installed.)
   Preparing to replace libc6 2.3.6-19 (using
   .../libc6_2.3.6.ds1-2_i386.deb) ...
   Unpacking replacement libc6 ...
   dpkg: error processing
   /var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb (--unpack):
dpkg: warning - old post-removal script killed by signal
(Segmentation fault)
  
  dpkg: error while cleaning up:
   subprocess pre-installation script killed by signal (Segmentation
   fault)
  Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb
  E: Sub-process /usr/bin/dpkg returned an error code (1)
 
  I am unable to reproduce this problem on my machine, so we will have to
  debug it on our system.
 
 
  First of all, is your system ok? Random segfaults could come for a
  kernel that started to oops. You can have a look to the output of
  dmesg.
 No, dmesg is clean like a pearl. Below screen dump:
 (...)
  Finally it would be nice if you acn send me the output of ldd
  /bin/bash, so that we can see which version of the libc are you using
  (linuxthreads, nptl, nptl i686 or xen).
 
 Wow!!!Forget the dmesg! Can you guess what the problem was!?!??
 Some time ago I installed a wrapper lib for alsa to run oss apps on alsa
 instead of using the kernel compat layer.
 I guess the alsa-oss package need to be recompiled against the new libc6
 I had that libalsatoss.so.0 library preloaded:
 [EMAIL PROTECTED]:~$ cat /etc/ld.so.preload
 /usr/lib/libaoss.so
 
 After commenting it out and running ldconfig the problem disappeared.
 Below output from ldd /bin/bash from before and after the action:
 
 Before:
 [EMAIL PROTECTED]:~$ ldd /bin/bash
 /usr/lib/libaoss.so (0xa7f18000)
 linux-gate.so.1 =  (0xe000)
 libncurses.so.5 = /lib/libncurses.so.5 (0xa7ebe000)
 libdl.so.2 = /lib/libdl.so.2 (0xa7eba000)
 libc.so.6 = /lib/libc.so.6 (0xa7d9f000)
 libalsatoss.so.0 = /usr/lib/libalsatoss.so.0 (0xa7d96000)
 /lib/ld-linux.so.2 (0xa7f1f000)
 libasound.so.2 = /usr/lib/libasound.so.2 (0xa7cd4000)
 libm.so.6 = /lib/libm.so.6 (0xa7cb)
 libpthread.so.0 = /lib/libpthread.so.0 (0xa7c5d000)
 
 After:
 [EMAIL PROTECTED]:~$ ldd /bin/bash
 linux-gate.so.1 =  (0xe000)
 libncurses.so.5 = /lib/libncurses.so.5 (0xa7eb1000)
 libdl.so.2 = /lib/libdl.so.2 (0xa7eac000)
 libc.so.6 = /lib/libc.so.6 (0xa7d91000)
 /lib/ld-linux.so.2 (0xa7f0b000)
 [EMAIL PROTECTED]:~$ sudo dpkg -i Desktop/libc6_2.3.6.ds1-2_i386.deb
 (Reading database ... 175620 files and directories currently installed.)
 Preparing to replace libc6 2.3.6-19
 (using .../libc6_2.3.6.ds1-2_i386.deb) ...
 Unpacking replacement libc6 ...
 Setting up libc6 (2.3.6.ds1-2) ...
 
 :)
 
 Thanx very much for helping me to debug the problem. Knowing the above
 you can look into it more approperly and perhaps fill-in another bug
 against libaoss
 

I now have a more precise idea of the problem. The following command
produce a segfault:

LD_ASSUME_KERNEL=2.4.1 LD_PRELOAD=/usr/lib/libaoss.so /bin/bash -x /bin/egrep

where /bin/grep contains:

#!/bin/sh
exec grep -E ${1+$@}

Note that without LD_ASSUME_KERNEL=2.4.1 (ie using nptl instead of
linuxthreads) or using dash instead of bash, the problem goes out.

gdb returns nothing, so I don't really know where is the problem and how
to debug it.

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian developer   | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#383976: unable to upgrade package libc6

2006-08-22 Thread knight
Dnia 21-08-2006, pon o godzinie 17:06 +0200, Aurelien Jarno napisał(a):
 Hi,

 On Mon, Aug 21, 2006 at 10:15:10AM +0200, Tomasz Cichecki wrote:
  Package: libc6
  Version: 2.3.6-19
  Severity: grave
  Justification: renders package unusable
 
  I cannot upgrade from libc6_2.3.6-19 to libc6_2.3.6.ds1-2
  Below screen dump:
  [EMAIL PROTECTED]:/usr/share/doc/libc6$ export LC_ALL=C
  [EMAIL PROTECTED]:/usr/share/doc/libc6$ sudo apt-get install libc6
  Reading package lists... Done
  Building dependency tree... Done
  Suggested packages:
glibc-doc
The following packages will be upgraded:
  libc6
  1 upgraded, 0 newly installed, 0 to remove and 93 not upgraded.
  1 not fully installed or removed.
  Need to get 0B/4696kB of archives.
  After unpacking 0B of additional disk space will be used.
  (Reading database ... 175620 files and directories currently
  installed.)
  Preparing to replace libc6 2.3.6-19 (using
  .../libc6_2.3.6.ds1-2_i386.deb) ...
  Unpacking replacement libc6 ...
  dpkg: error processing
  /var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb (--unpack):
   dpkg: warning - old post-removal script killed by signal
   (Segmentation fault)
 
 dpkg: error while cleaning up:
  subprocess pre-installation script killed by signal (Segmentation
  fault)
 Errors were encountered while processing:
   /var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb
 E: Sub-process /usr/bin/dpkg returned an error code (1)

 I am unable to reproduce this problem on my machine, so we will have to
 debug it on our system.


 First of all, is your system ok? Random segfaults could come for a
 kernel that started to oops. You can have a look to the output of
 dmesg.
No, dmesg is clean like a pearl. Below screen dump:
(...)
 Finally it would be nice if you acn send me the output of ldd
 /bin/bash, so that we can see which version of the libc are you using
 (linuxthreads, nptl, nptl i686 or xen).

Wow!!!Forget the dmesg! Can you guess what the problem was!?!??
Some time ago I installed a wrapper lib for alsa to run oss apps on alsa
instead of using the kernel compat layer.
I guess the alsa-oss package need to be recompiled against the new libc6
I had that libalsatoss.so.0 library preloaded:
[EMAIL PROTECTED]:~$ cat /etc/ld.so.preload
/usr/lib/libaoss.so

After commenting it out and running ldconfig the problem disappeared.
Below output from ldd /bin/bash from before and after the action:

Before:
[EMAIL PROTECTED]:~$ ldd /bin/bash
/usr/lib/libaoss.so (0xa7f18000)
linux-gate.so.1 =  (0xe000)
libncurses.so.5 = /lib/libncurses.so.5 (0xa7ebe000)
libdl.so.2 = /lib/libdl.so.2 (0xa7eba000)
libc.so.6 = /lib/libc.so.6 (0xa7d9f000)
libalsatoss.so.0 = /usr/lib/libalsatoss.so.0 (0xa7d96000)
/lib/ld-linux.so.2 (0xa7f1f000)
libasound.so.2 = /usr/lib/libasound.so.2 (0xa7cd4000)
libm.so.6 = /lib/libm.so.6 (0xa7cb)
libpthread.so.0 = /lib/libpthread.so.0 (0xa7c5d000)

After:
[EMAIL PROTECTED]:~$ ldd /bin/bash
linux-gate.so.1 =  (0xe000)
libncurses.so.5 = /lib/libncurses.so.5 (0xa7eb1000)
libdl.so.2 = /lib/libdl.so.2 (0xa7eac000)
libc.so.6 = /lib/libc.so.6 (0xa7d91000)
/lib/ld-linux.so.2 (0xa7f0b000)
[EMAIL PROTECTED]:~$ sudo dpkg -i Desktop/libc6_2.3.6.ds1-2_i386.deb
(Reading database ... 175620 files and directories currently installed.)
Preparing to replace libc6 2.3.6-19
(using .../libc6_2.3.6.ds1-2_i386.deb) ...
Unpacking replacement libc6 ...
Setting up libc6 (2.3.6.ds1-2) ...

:)

Thanx very much for helping me to debug the problem. Knowing the above
you can look into it more approperly and perhaps fill-in another bug
against libaoss

Greetings




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#383976: unable to upgrade package libc6

2006-08-22 Thread Daniel Jacobowitz
On Tue, Aug 22, 2006 at 03:56:13PM +0200, Aurelien Jarno wrote:
 I now have a more precise idea of the problem. The following command
 produce a segfault:
 
 LD_ASSUME_KERNEL=2.4.1 LD_PRELOAD=/usr/lib/libaoss.so /bin/bash -x /bin/egrep
 
 where /bin/grep contains:
 
 #!/bin/sh
 exec grep -E ${1+$@}
 
 Note that without LD_ASSUME_KERNEL=2.4.1 (ie using nptl instead of
 linuxthreads) or using dash instead of bash, the problem goes out.
 
 gdb returns nothing, so I don't really know where is the problem and how
 to debug it.

Can you get a core dump?  Alternatively, inserting gdbserver before
/bin/bash and using remote debugging sometimes helps; it perturbs the
process less than gdb does.  But only if the parent process is the one
you need to debug.

-- 
Daniel Jacobowitz
CodeSourcery


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#383976: unable to upgrade package libc6

2006-08-22 Thread Aurelien Jarno
On Tue, Aug 22, 2006 at 07:00:31PM -0400, Daniel Jacobowitz wrote:
 On Tue, Aug 22, 2006 at 03:56:13PM +0200, Aurelien Jarno wrote:
  I now have a more precise idea of the problem. The following command
  produce a segfault:
  
  LD_ASSUME_KERNEL=2.4.1 LD_PRELOAD=/usr/lib/libaoss.so /bin/bash -x 
  /bin/egrep
  
  where /bin/grep contains:
  
  #!/bin/sh
  exec grep -E ${1+$@}
  
  Note that without LD_ASSUME_KERNEL=2.4.1 (ie using nptl instead of
  linuxthreads) or using dash instead of bash, the problem goes out.
  
  gdb returns nothing, so I don't really know where is the problem and how
  to debug it.
 
 Can you get a core dump?  Alternatively, inserting gdbserver before
 /bin/bash and using remote debugging sometimes helps; it perturbs the
 process less than gdb does.  But only if the parent process is the one
 you need to debug.
 

Well I have found the problem since then:

20:35  aurel32 I have found the problem of bug#383976, but I will need some 
help to take a decision.
20:35  aurel32 first the bug has been triggered by local-sysctl.diff (the 
patch that removes call sysctl())
20:36  aurel32 but even without this patch, it will be triggered by a switch 
to a 2.6.18 kernel
20:36  aurel32 where the sysctl() function will always fail
20:36  aurel32 then the problem:
20:37  aurel32 preloading libaoss.so diverts some symbols such as open, 
__open, read, __read, etc.
20:37  aurel32 libaoss.so is linked with libpthread.so
20:37 -!- xaiki [EMAIL PROTECTED] has joined #debian-glibc
20:37  aurel32 libpthread run a few checks at initialization, like checking 
if the kernel is an SMP one or not
20:37  aurel32 before it was using sysctl() and then 
__open(/proc/sys/kernel/version, O_RDONLY)
20:37  aurel32 but now it directly uses __open()
20:38  aurel32 so when loading libpthread.so, the __open() function from 
libaoss.so is started
20:38  aurel32 it calls getenv() to read variables from __environ
20:39  aurel32 but at that time this variable is not yet initialized
20:39  aurel32 causing a segfault
20:39  aurel32 To fix the problem:
20:39  aurel32 - I don't understand why __ functions are diverted in 
alsa-oss, maybe this is not necessary???
20:40  aurel32 - The upstream version of smp.h now always assume an SMP kernel
20:40  aurel32 this is actually the case with newer debian kernels, which are 
now SMP

I have finally decided to use the fix which is in upstream CVS.

BTW, it would be nice if you can sync smp.h from linuxthreads with the one from 
NPTL in upstream CVS.

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian developer   | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#383976: unable to upgrade package libc6

2006-08-22 Thread Daniel Jacobowitz
On Wed, Aug 23, 2006 at 01:08:07AM +0200, Aurelien Jarno wrote:
 20:39  aurel32 To fix the problem:
 20:39  aurel32 - I don't understand why __ functions are diverted in 
 alsa-oss, maybe this is not necessary???

Or you could call a version of open which always binds locally (I
suspect __libc_open would work, I'm not sure).

 BTW, it would be nice if you can sync smp.h from linuxthreads with
 the one from NPTL in upstream CVS.

I'll keep that in mind, thanks.

-- 
Daniel Jacobowitz
CodeSourcery


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#383976: unable to upgrade package libc6

2006-08-21 Thread Tomasz Cichecki
Package: libc6
Version: 2.3.6-19
Severity: grave
Justification: renders package unusable

I cannot upgrade from libc6_2.3.6-19 to libc6_2.3.6.ds1-2
Below screen dump:
[EMAIL PROTECTED]:/usr/share/doc/libc6$ export LC_ALL=C
[EMAIL PROTECTED]:/usr/share/doc/libc6$ sudo apt-get install libc6
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
  glibc-doc
  The following packages will be upgraded:
libc6
1 upgraded, 0 newly installed, 0 to remove and 93 not upgraded.
1 not fully installed or removed.
Need to get 0B/4696kB of archives.
After unpacking 0B of additional disk space will be used.
(Reading database ... 175620 files and directories currently
installed.)
Preparing to replace libc6 2.3.6-19 (using
.../libc6_2.3.6.ds1-2_i386.deb) ...
Unpacking replacement libc6 ...
dpkg: error processing
/var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb (--unpack):
 dpkg: warning - old post-removal script killed by signal
 (Segmentation fault)

   dpkg: error while cleaning up:
subprocess pre-installation script killed by signal (Segmentation
fault)
   Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb
   E: Sub-process /usr/bin/dpkg returned an error code (1)


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)

Versions of packages libc6 depends on:
ii  tzdata2006g-2Time Zone and Daylight Saving Time

libc6 recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#383976: unable to upgrade package libc6

2006-08-21 Thread Aurelien Jarno
Hi,

On Mon, Aug 21, 2006 at 10:15:10AM +0200, Tomasz Cichecki wrote:
 Package: libc6
 Version: 2.3.6-19
 Severity: grave
 Justification: renders package unusable
 
 I cannot upgrade from libc6_2.3.6-19 to libc6_2.3.6.ds1-2
 Below screen dump:
 [EMAIL PROTECTED]:/usr/share/doc/libc6$ export LC_ALL=C
 [EMAIL PROTECTED]:/usr/share/doc/libc6$ sudo apt-get install libc6
 Reading package lists... Done
 Building dependency tree... Done
 Suggested packages:
   glibc-doc
   The following packages will be upgraded:
 libc6
 1 upgraded, 0 newly installed, 0 to remove and 93 not upgraded.
 1 not fully installed or removed.
 Need to get 0B/4696kB of archives.
 After unpacking 0B of additional disk space will be used.
 (Reading database ... 175620 files and directories currently
 installed.)
 Preparing to replace libc6 2.3.6-19 (using
 .../libc6_2.3.6.ds1-2_i386.deb) ...
 Unpacking replacement libc6 ...
 dpkg: error processing
 /var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb (--unpack):
  dpkg: warning - old post-removal script killed by signal
  (Segmentation fault)
 
dpkg: error while cleaning up:
 subprocess pre-installation script killed by signal (Segmentation
 fault)
Errors were encountered while processing:
  /var/cache/apt/archives/libc6_2.3.6.ds1-2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
I am unable to reproduce this problem on my machine, so we will have to
debug it on our system.

First of all, is your system ok? Random segfaults could come for a
kernel that started to oops. You can have a look to the output of 
dmesg.

Then, it would be nice to know which program in the posrtm/preinst fail.
You can try to look at the output of dmesg, sometimes programs that
segfault are written there. If this is not the case, you can change the
first line of /var/lib/dpkg/info/libc6.postrm from
  ! /bin/sh
to
  ! /bin/sh -x
, try to upgrade again and send me the output. 

Finally it would be nice if you acn send me the output of ldd
/bin/bash, so that we can see which version of the libc are you using
(linuxthreads, nptl, nptl i686 or xen).

Bye,
Aurelien

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian developer   | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]