Bug#912437: openmpi-bin: Fails to upgrade: update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc

2018-10-31 Thread Axel Beckert
Package: openmpi-bin
Version: 3.1.3-1
Severity: serious

openmpi-bin fails to upgrade from 3.1.2-6 to 3.1.3-1 as follows for me:

Setting up openmpi-bin (3.1.3-1) ...
update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link 
same as main link /usr/bin/mpicc
dpkg: error processing package openmpi-bin (--configure):
 installed openmpi-bin package post-installation script subprocess returned 
error exit status 2
Errors were encountered while processing:
 openmpi-bin

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), 
(500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 
'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages openmpi-bin depends on:
ii  libc62.27-8
ii  libevent-2.1-6   2.1.8-stable-4
ii  libevent-pthreads-2.1-6  2.1.8-stable-4
ii  libhwloc51.11.11-2
ii  libopenmpi3  3.1.3-1
ii  openmpi-common   3.1.3-1
ii  openssh-client [ssh-client]  1:7.9p1-1
ii  zlib1g   1:1.2.11.dfsg-1

Versions of packages openmpi-bin recommends:
pn  libopenmpi-dev  

Versions of packages openmpi-bin suggests:
ii  gfortran  4:8.2.0-2

-- no debconf information



Bug#912437: openmpi-bin: Fails to upgrade: update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc

2018-10-31 Thread Alastair McKinstry

Thanks for this report.

I'm unable to reproduce this, and have no failures testing 3.1.2-6 -> 
3.1.3-1 upgrade.


The change made in the openmpi-bin.postinst script was to enable "set 
-e" properly (avoiding a conditional  in the script that relied on 
testing non-zero return code). I suspect that 
/var/lib/dpkg/alternatives/mpi was corrupt from a previous upgrade 
(quite likely; major changes happened in the 2->3 transition due to 
multiarch handling).


So, I think:

(1) the current package is actually technically ok.

(2) Some more handling needs to be added to cope with 'inheriting' a 
corrupt mpi alternatives.


regards

Alastair


On 31/10/2018 14:28, Axel Beckert wrote:

Package: openmpi-bin
Version: 3.1.3-1
Severity: serious

openmpi-bin fails to upgrade from 3.1.2-6 to 3.1.3-1 as follows for me:

Setting up openmpi-bin (3.1.3-1) ...
update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link 
same as main link /usr/bin/mpicc
dpkg: error processing package openmpi-bin (--configure):
  installed openmpi-bin package post-installation script subprocess returned 
error exit status 2
Errors were encountered while processing:
  openmpi-bin

-- System Information:
Debian Release: buster/sid
   APT prefers unstable
   APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), 
(500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 
'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages openmpi-bin depends on:
ii  libc62.27-8
ii  libevent-2.1-6   2.1.8-stable-4
ii  libevent-pthreads-2.1-6  2.1.8-stable-4
ii  libhwloc51.11.11-2
ii  libopenmpi3  3.1.3-1
ii  openmpi-common   3.1.3-1
ii  openssh-client [ssh-client]  1:7.9p1-1
ii  zlib1g   1:1.2.11.dfsg-1

Versions of packages openmpi-bin recommends:
pn  libopenmpi-dev  

Versions of packages openmpi-bin suggests:
ii  gfortran  4:8.2.0-2

-- no debconf information


--
Alastair McKinstry, , , 
https://diaspora.sceal.ie/u/amckinstry
Commander Vimes didn’t like the phrase “The innocent have nothing to fear,”
 believing the innocent had everything to fear, mostly from the guilty but in 
the longer term
 even more from those who say things like “The innocent have nothing to fear.”
 - T. Pratchett, Snuff



Bug#912437: openmpi-bin: Fails to upgrade: update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc

2018-10-31 Thread Axel Beckert
Hi Alastair,

Alastair McKinstry wrote:
> The change made in the openmpi-bin.postinst script was to enable
> "set -e" properly (avoiding a conditional  in the script that relied
> on testing non-zero return code). I suspect that
> /var/lib/dpkg/alternatives/mpi was corrupt from a previous upgrade
> (quite likely; major changes happened in the 2->3 transition due to
> multiarch handling).

Indeed, this system has about 2.5 years of Debian Unstable history,
yes. :-)

Attached the contents of /var/lib/dpkg/alternatives/mpi. Since I can
still reproduce the issue by calling e.g. "dpkg --configure -a", this
doesn't seem to be a one-time issue. I hope the attached file enables
you to find the root cause.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
auto
/usr/bin/mpicc
libmpi++.so
/usr/lib/libmpi++.so
libmpi.so
/usr/lib/libmpi.so
libmpicxx.so
/usr/lib/libmpicxx.so
libmpif77.so
/usr/lib/libmpif77.so
libmpif90.so
/usr/lib/libmpif90.so
libmpifort.so
/usr/lib/libmpifort.so
mpi.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/mpi.pc
mpiCC
/usr/bin/mpiCC
mpiCC.1.gz
/usr/share/man/man1/mpiCC.1.gz
mpic++
/usr/bin/mpic++
mpic++.1.gz
/usr/share/man/man1/mpic++.1.gz
mpicc
/usr/bin/mpicc
mpicc.1.gz
/usr/share/man/man1/mpicc.1.gz
mpicxx
/usr/bin/mpicxx
mpicxx.1.gz
/usr/share/man/man1/mpicxx.1.gz
mpif77
/usr/bin/mpif77
mpif77.1.gz
/usr/share/man/man1/mpif77.1.gz
mpif90
/usr/bin/mpif90
mpif90.1.gz
/usr/share/man/man1/mpif90.1.gz
mpifort
/usr/bin/mpifort
mpifort.1.gz
/usr/share/man/man1/mpifort.1.gz

/usr/bin/mpicc.openmpi
50







/usr/bin/mpic++.openmpi
/usr/share/man/man1/mpiCC.openmpi.1.gz
/usr/bin/mpic++.openmpi
/usr/share/man/man1/mpic++.openmpi.1.gz

/usr/share/man/man1/mpicc.openmpi.1.gz
/usr/bin/mpic++.openmpi
/usr/share/man/man1/mpicxx.openmpi.1.gz
/usr/bin/mpif77.openmpi
/usr/share/man/man1/mpif77.openmpi.1.gz
/usr/bin/mpif90.openmpi
/usr/share/man/man1/mpif90.openmpi.1.gz
/usr/bin/mpifort.openmpi
/usr/share/man/man1/mpifort.openmpi.1.gz
/usr/include/mpich
40
/usr/lib/x86_64-linux-gnu/libmpichcxx.so
/usr/lib/x86_64-linux-gnu/libmpich.so
/usr/lib/x86_64-linux-gnu/libmpichcxx.so
/usr/lib/x86_64-linux-gnu/libmpichfort.so
/usr/lib/x86_64-linux-gnu/libmpichfort.so
/usr/lib/x86_64-linux-gnu/libmpichfort.so
/usr/lib/x86_64-linux-gnu/pkgconfig/mpich.pc
/usr/bin/mpicxx.mpich
/usr/share/man/man1/mpicxx.mpich.1.gz
/usr/bin/mpicxx.mpich
/usr/share/man/man1/mpicxx.mpich.1.gz
/usr/bin/mpicc.mpich
/usr/share/man/man1/mpicc.mpich.1.gz
/usr/bin/mpicxx.mpich
/usr/share/man/man1/mpicxx.mpich.1.gz
/usr/bin/mpifort.mpich
/usr/share/man/man1/mpif77.mpich.1.gz
/usr/bin/mpifort.mpich
/usr/share/man/man1/mpif90.mpich.1.gz
/usr/bin/mpifort.mpich
/usr/share/man/man1/mpifort.mpich.1.gz



Bug#912437: openmpi-bin: Fails to upgrade: update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc

2018-10-31 Thread Axel Beckert
Control: clone -1 -2
Control: reassign -2 mpich 3.3~b3-3
Control: retitle -2 mpich: Fails to upgrade: update-alternatives: error: 
/var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link 
/usr/bin/mpicc

Hi Alastair,

Alastair McKinstry wrote:
> I'm unable to reproduce this, and have no failures testing 3.1.2-6
> -> 3.1.3-1 upgrade.

Same for the mpich 3.3~b3-2 to 3.3~b3-3 upgrade (on the same machine).
Cloning the bug, as I assume that this needs to be applied to both
packages:

> (2) Some more handling needs to be added to cope with 'inheriting' a
> corrupt mpi alternatives.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE