https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95191

            Bug ID: 95191
           Summary: Hang in WAIT with a bad ID= value if threading
                    specified
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

> cat test.f90
      program test
              real a(10000)
              integer my_id
              integer bad_id
              data my_id /1/
              data bad_id /2/
              a = 1.
              open (unit=10, file='test.dat', form='unformatted', &
     &                asynchronous='yes')
              write (unit=10, asynchronous='yes', id=my_id) a
              wait (unit=10, id=bad_id)
              close (unit=10, status='delete')
      end program test

If there are no command line options for the compile, there is no
issue. However, if -fopenmp is added (or -lpthreads is added for the
link), then the code hangs.

> gfortran test.f90
> ./a.out
> gfortran -fopenmp test.f90
> ./a.out 
^C  <<<<<<<<<<<---------- hangs here.
> gfortran --version
GNU Fortran (GCC) 9.3.0 20200312 (Cray Inc.)
Copyright (C) 2019 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.

Original submitter says it hangs here: hang in __gthread_cond_wait.

Reply via email to