Debian Bug report logs - #919335
mpifort (3.1.3-9) infinite loop on hurd reading from stdin

version graph

Package: src:openmpi; Maintainer for src:openmpi is Alastair McKinstry <mckinstry@debian.org>;

Affects: mpgrafic, tree-puzzle

Reported by: Boud Roukema <boud-debian@cosmo.torun.pl>

Date: Mon, 14 Jan 2019 23:48:02 UTC

Severity: important

Found in version openmpi/3.1.3-9

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, boud-debian@cosmo.torun.pl, Alastair McKinstry <mckinstry@debian.org>:
Bug#919335; Package src:openmpi. (Mon, 14 Jan 2019 23:48:04 GMT) (full text, mbox, link).


Acknowledgement sent to Boud Roukema <boud-debian@cosmo.torun.pl>:
New Bug report received and forwarded. Copy sent to boud-debian@cosmo.torun.pl, Alastair McKinstry <mckinstry@debian.org>. (Mon, 14 Jan 2019 23:48:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Boud Roukema <boud-debian@cosmo.torun.pl>
To: Debian Bugs Submission <submit@bugs.debian.org>
Subject: mpifort (3.1.3-9) infinite loop on hurd reading from stdin
Date: Tue, 15 Jan 2019 00:45:02 +0100 (CET)
Source: openmpi
Version: 3.1.3-9
Severity: important

SUMMARY: mpifort (openmpi 3.1.3-9) infinite loop on hurd while reading from stdin

DESCRIPTION:
On GNU/Hurd, a few-line fortran program that reads an integer from
stdin and outputs it to stdout, and has no calls to mpi, runs
as expected when compiled with gfortran-8.2.0-2, but when compiled
with mpifort (openmpi 3.1.3-9), runs at about 10-30% of cpu 
in an apparently infinite loop (at least 900 seconds).


CONTEXT:

$ uname -a
GNU exodar 0.9 GNU-Mach 1.8+git20181103-486-dbg/Hurd-0.9 i686-AT386 GNU

$ cat /proc/hostinfo
Basic info:
max_cpus        =          1    /* max number of cpus possible */
avail_cpus      =          1    /* number of cpus now available */
memory_size     = 3221151744    /* size of memory in bytes */
cpu_type        =         19    /* cpu type */
cpu_subtype     =          1    /* cpu subtype */

Scheduling info:
min_timeout     =         10    /* minimum timeout in milliseconds */
min_quantum     =        100    /* minimum quantum in milliseconds */

Load info:
avenrun[3]      = { 1.57, 1.57, 1.43 }
mach_factor[3]  = { 0.15, 0.14, 0.09 }


$ dpkg -l |egrep "openmpi|pmix|gfortran|gcc|mpifort|libc[-0]"

ii  gcc                                4:8.2.0-2                   hurd-i386    GNU C compiler
ii  gcc-8                              8.2.0-14                    hurd-i386    GNU C compiler
ii  gcc-8-base:hurd-i386               8.2.0-14                    hurd-i386    GCC, the GNU Compiler Collection (base package)
ii  gfortran                           4:8.2.0-2                   hurd-i386    GNU Fortran 95 compiler
ii  gfortran-8                         8.2.0-14                    hurd-i386    GNU Fortran compiler
ii  libc-bin                           2.28-5                      hurd-i386    GNU C Library: Binaries
ii  libc-dev-bin                       2.28-5                      hurd-i386    GNU C Library: Development binaries
ii  libc-l10n                          2.28-5                      all          GNU C Library: localization files
ii  libc0.3:hurd-i386                  2.28-5                      hurd-i386    GNU C Library: Shared libraries
ii  libc0.3-dev:hurd-i386              2.28-5                      hurd-i386    GNU C Library: Development Libraries and Header Files
ii  libgcc-8-dev:hurd-i386             8.2.0-14                    hurd-i386    GCC support library (development files)
ii  libgcc1:hurd-i386                  1:8.2.0-14                  hurd-i386    GCC support library
ii  libgfortran-8-dev:hurd-i386        8.2.0-14                    hurd-i386    Runtime library for GNU Fortran applications (development files)
ii  libgfortran5:hurd-i386             8.2.0-14                    hurd-i386    Runtime library for GNU Fortran applications
ii  libopenmpi-dev:hurd-i386           3.1.3-9                     hurd-i386    high performance message passing library -- header files
ii  libopenmpi3:hurd-i386              3.1.3-9                     hurd-i386    high performance message passing library -- shared library
ii  libpmix2:hurd-i386                 3.1.0~rc4-1                 hurd-i386    Process Management Interface (Exascale) library
ii  openmpi-bin                        3.1.3-9                     hurd-i386    high performance message passing library -- binaries
ii  openmpi-common                     3.1.3-9                     all          high performance message passing library -- common files

$ mpifort --showme
gfortran -I/usr/lib/i386-gnu/openmpi/include -pthread -I/usr/lib/i386-gnu/openmpi/lib -Wl,--enable-new-dtags -L/usr/lib/i386-gnu/openmpi/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi

$ mpifort --version
GNU Fortran (Debian 8.2.0-14) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gfortran --version
GNU Fortran (Debian 8.2.0-14) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.





REPRODUCE THE BUG:

$ cat hurd_fortran_minimal.f90
program openmpi_hurd_bug
  i_myid = 178
  print*,'i_myid = ',i_myid,' Please type in an integer and hit return.'
  read(*,*) icase
  print*,'Your integer is ', icase, ' Bye.'
end program openmpi_hurd_bug


$ cat infile
414

(1) gfortran

$  gfortran src/hurd_fortran_minimal.f90 && ./a.out < infile
 i_myid =          178  Please type in an integer and hit return.
 Your integer is          414  Bye.

Compiled without errors or warnings; printed out the integer 414 as expected.

(2) mpifort

Since exodar has only one cpu, and since a test script for openmpi
should be able to run on a single-processor machine, and since it's a bad
idea to ssh to any external machines when doing automated tests,
the '--mca plm_rsh_agent /bin/false' option is used here, meaning there's no
remote shell usage.

Compile and run in foreground using mpifort. This appears to run without
stopping, so with a ^C, the output to terminal is:

$ mpifort src/hurd_fortran_minimal.f90 && mpirun -n 1 --mca plm_rsh_agent /bin/false ./a.out < infile

 i_myid =          178  Please type in an integer and hit return.
^CAt line 4 of file src/hurd_fortran_minimal.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x11f874b
#1  0x11f925e
#2  0x11f98f6
#3  0x13bb11c
#4  0x13b3d79
#5  0x13b5520
#6  0x13ba8c3
#7  0x803089a
#8  0x8030996
#9  0x164735c
#10  0x80306c0
#11  0xffffffff


Running this in the background instead, with a log file:

$ mpirun -n 1 --mca plm_rsh_agent /bin/false ./a.out < infile > log.1 2>&1 &

The job run in the background runs at about 10-30% of cpu according to
'top', and there's no evidence of it ever stopping. This might be an
infinite loop problem. This binary ran for over 900 seconds using
about 30-40% of cpu, before I killed it. According to the program
code, I would expect it to be reading one integer on one line of an
input file and then to print it to stdout. In other words, a program
with no mpi instructions, compiled with mpifort, should behave the
same way as if the program is compiled with gfortran.

During this apparently infinite loop, the log file contains:

 i_myid =          178  Please type in an integer and hit return.


HYPOTHESIS:

This test is run under an schroot running sid, so it might be related
to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494046 -
"openmpi-bin: Doesn't work in a chroot environment".




Information forwarded to debian-bugs-dist@lists.debian.org, Alastair McKinstry <mckinstry@debian.org>:
Bug#919335; Package src:openmpi. (Tue, 15 Jan 2019 00:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Boud Roukema <boud-debian@cosmo.torun.pl>:
Extra info received and forwarded to list. Copy sent to Alastair McKinstry <mckinstry@debian.org>. (Tue, 15 Jan 2019 00:15:03 GMT) (full text, mbox, link).


Message #10 received at 919335@bugs.debian.org (full text, mbox, reply):

From: Boud Roukema <boud-debian@cosmo.torun.pl>
To: 919335@bugs.debian.org
Cc: Alastair McKinstry <mckinstry@debian.org>, Boud Roukema <boud-debian@cosmo.torun.pl>
Subject: Re: Bug#919335: mpifort (3.1.3-9) infinite loop on hurd reading from stdin
Date: Tue, 15 Jan 2019 01:03:19 +0100 (CET)
hi again

I forgot to state evidence that this is a GNU/Hurd bug:

On an amd64 machine running Debian/stretch GNU/Linux, mpifort runs this test program as expected.

> $ cat hurd_fortran_minimal.f90
> program openmpi_hurd_bug
>  i_myid = 178
>  print*,'i_myid = ',i_myid,' Please type in an integer and hit return.'
>  read(*,*) icase
>  print*,'Your integer is ', icase, ' Bye.'
> end program openmpi_hurd_bug
>
>
> $ cat infile
> 414

> $ mpifort src/hurd_fortran_minimal.f90 && mpirun -n 1 --mca plm_rsh_agent  /bin/false ./a.out < infile

$ uname -srvmoip
Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 unknown unknown GNU/Linux

$ mpifort fortran_minimal.f90 && mpirun -n 1 --mca plm_rsh_agent /bin/false ./a.out < infile
 i_myid =          178  Please type in an integer and hit return.
  Your integer is          414  Bye.

This runs almost instantly - it does not run for 900 seconds.


$ dpkg -l |egrep "openmpi|pmix|gfortran|gcc|mpifort|libc[-0]"
ii  gcc                                    4:6.3.0-4                         amd64        GNU C compiler
ii  gcc-6                                  6.3.0-18+deb9u1                   amd64        GNU C compiler
ii  gcc-6-base:amd64                       6.3.0-18+deb9u1                   amd64        GCC, the GNU Compiler Collection (base package)
ii  gfortran                               4:6.3.0-4                         amd64        GNU Fortran 95 compiler
ii  gfortran-6                             6.3.0-18+deb9u1                   amd64        GNU Fortran compiler
ii  klibc-utils                            2.0.4-9                           amd64        small utilities built with klibc for early boot
ii  libc-bin                               2.24-11+deb9u3                    amd64        GNU C Library: Binaries
ii  libc-dev-bin                           2.24-11+deb9u3                    amd64        GNU C Library: Development binaries
ii  libc-l10n                              2.24-11+deb9u3                    all          GNU C Library: localization files
ii  libgcc-6-dev:amd64                     6.3.0-18+deb9u1                   amd64        GCC support library (development files)
ii  libgcc1:amd64                          1:6.3.0-18+deb9u1                 amd64        GCC support library
ii  libgfortran-6-dev:amd64                6.3.0-18+deb9u1                   amd64        Runtime library for GNU Fortran applications (development files)
ii  libgfortran3:amd64                     6.3.0-18+deb9u1                   amd64        Runtime library for GNU Fortran applications
ii  libopenmpi-dev                         2.0.2-2                           amd64        high performance message passing library -- header files
ii  libopenmpi2:amd64                      2.0.2-2                           amd64        high performance message passing library -- shared library
ii  linux-libc-dev:amd64                   4.9.130-2                         amd64        Linux support headers for userspace development
ii  openmpi-bin                            2.0.2-2                           amd64        high performance message passing library -- binaries
ii  openmpi-common                         2.0.2-2                           all          high performance message passing library -- common files


Cheers
Boud



Added indication that 919335 affects mpgrafic Request was from Boud Roukema <boud-debian@cosmo.torun.pl> to control@bugs.debian.org. (Tue, 15 Jan 2019 00:21:05 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Alastair McKinstry <mckinstry@debian.org>:
Bug#919335; Package src:openmpi. (Wed, 16 Jan 2019 01:30:02 GMT) (full text, mbox, link).


Acknowledgement sent to Boud Roukema <boud-debian@cosmo.torun.pl>:
Extra info received and forwarded to list. Copy sent to Alastair McKinstry <mckinstry@debian.org>. (Wed, 16 Jan 2019 01:30:02 GMT) (full text, mbox, link).


Message #17 received at 919335@bugs.debian.org (full text, mbox, reply):

From: Boud Roukema <boud-debian@cosmo.torun.pl>
To: 919335 <919335@bugs.debian.org>
Cc: Boud Roukema <boud-debian@cosmo.torun.pl>
Subject: openmpi/hurd/stdin bug
Date: Wed, 16 Jan 2019 02:27:14 +0100 (CET)
This bug occurs for reading from stdin in C too.

Again on an exodar schroot on sid:

CONTEXT:

$ dpkg -l |egrep "tree.*puzzle|openmpi|pmix|gfortran|gcc|mpifort|libc[-0]"
ii  gcc                                4:8.2.0-2                   hurd-i386    GNU C compiler
ii  gcc-8                              8.2.0-14                    hurd-i386    GNU C compiler
ii  gcc-8-base:hurd-i386               8.2.0-14                    hurd-i386    GCC, the GNU Compiler Collection (base package)
ii  gfortran                           4:8.2.0-2                   hurd-i386    GNU Fortran 95 compiler
ii  gfortran-8                         8.2.0-14                    hurd-i386    GNU Fortran compiler
ii  gromacs-openmpi                    2018.4-1                    hurd-i386    Molecular dynamics sim, binaries for OpenMPI parallelization
ii  libc-bin                           2.28-5                      hurd-i386    GNU C Library: Binaries
ii  libc-dev-bin                       2.28-5                      hurd-i386    GNU C Library: Development binaries
ii  libc-l10n                          2.28-5                      all          GNU C Library: localization files
ii  libc0.3:hurd-i386                  2.28-5                      hurd-i386    GNU C Library: Shared libraries
ii  libc0.3-dev:hurd-i386              2.28-5                      hurd-i386    GNU C Library: Development Libraries and Header Files
ii  libgcc-8-dev:hurd-i386             8.2.0-14                    hurd-i386    GCC support library (development files)
ii  libgcc1:hurd-i386                  1:8.2.0-14                  hurd-i386    GCC support library
ii  libgfortran-8-dev:hurd-i386        8.2.0-14                    hurd-i386    Runtime library for GNU Fortran applications (development files)
ii  libgfortran5:hurd-i386             8.2.0-14                    hurd-i386    Runtime library for GNU Fortran applications
ii  libopenmpi-dev:hurd-i386           3.1.3-9                     hurd-i386    high performance message passing library -- header files
ii  libopenmpi3:hurd-i386              3.1.3-9                     hurd-i386    high performance message passing library -- shared library
ii  libpmix2:hurd-i386                 3.1.0~rc4-1                 hurd-i386    Process Management Interface (Exascale) library
ii  openmpi-bin                        3.1.3-9                     hurd-i386    high performance message passing library -- binaries
ii  openmpi-common                     3.1.3-9                     all          high performance message passing library -- common files
ii  tree-puzzle                        5.2-11                      hurd-i386    Reconstruction of phylogenetic trees by maximum likelihood
ii  tree-puzzle-doc                    5.2-11                      all          Reconstruction of phylogenetic trees by maximum likelihood (doc)

$ mpicc --showme

gcc -I/usr/lib/i386-gnu/openmpi/include/openmpi -I/usr/lib/i386-gnu/openmpi/include -pthread -L/usr/lib/i386-gnu/openmpi/lib -lmpi



REPRODUCE THE BUG:

$ cat hurd_C_minimal.c
#include <stdio.h>
#include <strings.h>

int main(void){
  int i = 178;
  int j;
  printf("i = %d\n",i);
  scanf("%10d",&j);
  printf("j = %d\n",j);
  return 0;
}

$ cat infile
414

$ gcc hurd_C_minimal.c && time ./a.out < infile
i = 178
j = 414

real    0m0.010s
user    0m0.000s
sys     0m0.000s


$ mpicc src/hurd_C_minimal.c && (time mpirun -n 1 --mca plm_rsh_agent /bin/false ./a.out < infile ) &
[2] 21871
i = 178

Runs for at least 30 seconds cpu time at about 10% cpu before I killed it.




REPRODUCE THE BUG - tree-puzzle:

This bug should affect all other openmpi packages which read from stdin,
such as tree-puzzle 5.2-11:

Again on an exodar schroot on sid:


(0) prepare 2-line input file:

$ cp -pv /usr/share/doc/tree-puzzle/examples/primates.b  .
$ printf "primates.b\ny\n" > infile.tree-puzzle


(1) without mpi

$ time tree-puzzle < infile.tree-puzzle > /dev/null && ls -lt out????
Using SPRNG -- Scalable Parallel Random Number Generator
WARNING from init_rng: Parameter not valid. Using Default param

real    0m0.020s
user    0m0.000s
sys     0m0.000s
-rw-r--r-- 1 boud-guest boud-guest  284 Jan 16 01:04 outdist
-rw-r--r-- 1 boud-guest boud-guest 7095 Jan 16 01:04 outfile
-rw-r--r-- 1 boud-guest boud-guest  130 Jan 16 01:04 outtree


(2) with mpi

$ (time mpirun -n 1 --mca plm_rsh_agent  /bin/false tree-puzzle < infile.tree-puzzle > /dev/null && ls -lt out????) &
[1] 13122
Using SPRNG -- Scalable Parallel Random Number Generator
WARNING from init_rng: Parameter not valid. Using Default param

Runs at about 10-20% of cpu for at least 80 seconds of cpu time.





Added indication that 919335 affects tree-puzzle Request was from Boud Roukema <boud-debian@cosmo.torun.pl> to control@bugs.debian.org. (Wed, 16 Jan 2019 01:33:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Sep 20 07:52:59 2022; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.