OpenCoarrays icon indicating copy to clipboard operation
OpenCoarrays copied to clipboard

Defect: Double free SIGABRT with automatic deallocation of coarray with allocatable component

Open nncarlson opened this issue 3 years ago • 0 comments

  • [x] I am reporting a bug others will be able to reproduce and not asking a question or requesting a new feature.

System information including:

  • OpenCoarrays Version: caf version 2.9.2-13-g235167d
  • Fortran Compiler: GNU Fortran (GCC) 11.2.0
  • C compiler used for building lib: gcc (GCC) 11.2.0
  • Installation method: make; make install
  • All flags & options passed to the installer: cmake -DCMAKE_BUILD_TYPE=Release
  • Output of uname -a: Linux thelio.indiana 5.14.18-100.fc33.x86_64 #1 SMP Fri Nov 12 17:38:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • MPI library being used: MPICH 3.3.2
  • Machine architecture and number of physical cores: 12 core AMD Threadripper 2920X
  • Version of CMake: 3.19.7

To help us debug your issue please explain:

What you were trying to do (and why)

Here is a reproducer for the defect:

program main

  integer :: array(10)
  call sub(array)

contains

  subroutine sub(array)
    integer, intent(in) :: array(:)
    type :: box
      integer, allocatable :: array(:)
    end type
    type(box), allocatable :: buffer[:]
    allocate(buffer[*])
    buffer%array = array
  end subroutine

end program

What happened (include command output, screenshots, logs, etc.)

free(): double free detected in tcache 2

Program received signal SIGABRT: Process abort signal.

What you expected to happen

The program should complete successfully and silently.

Step-by-step reproduction instructions to reproduce the error/bug

caf reproducer.f90
cafrun -n 1 ./a.out

Similar "double free" SIGABRT running any number of images.

nncarlson avatar Jan 28 '22 03:01 nncarlson