Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] [OpenMP] flang-new crashes (omp taskgroup) #62013

Open
k-arrows opened this issue Apr 8, 2023 · 3 comments
Open

[flang] [OpenMP] flang-new crashes (omp taskgroup) #62013

k-arrows opened this issue Apr 8, 2023 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior flang:frontend openmp

Comments

@k-arrows
Copy link

k-arrows commented Apr 8, 2023

Test code:

$ cat test.f90
program taskgroup_example
  use omp_lib
  implicit none
  integer :: i

  !$omp parallel
  !$omp single
  !$omp taskgroup
  do i=1,5
    !$omp task
    call do_work(i)
    !$omp end task
  end do
  !$omp end taskgroup
  !$omp end single
  !$omp end parallel

contains

  subroutine do_work(i)
    integer, intent(in) :: i
    print*, "Task ", i, " started"
    ! Do some work here
    print*, "Task ", i, " finished"
  end subroutine do_work

end program taskgroup_example

Stack dump:

 #0 0x000055a3abe9dbac llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
 #1 0x000055a3abe9e1ee SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f16043ef520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000055a3ac27dc2b Fortran::frontend::CodeGenAction::executeAction()
 #4 0x000055a3abebd344 Fortran::frontend::FrontendAction::execute()
 #5 0x000055a3abeb57b1 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&)
 #6 0x000055a3abebf9c0 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*)
 #7 0x000055a3abb9a7b2 fc1_main(llvm::ArrayRef<char const*>, char const*)
 #8 0x000055a3abb98980 main
 #9 0x00007f16043d6d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#10 0x00007f16043d6e40 call_init ./csu/../csu/libc-start.c:128:20
#11 0x00007f16043d6e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#12 0x000055a3abb97f05 _start
flang-new: error: unable to execute command: Segmentation fault
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 17.0.0 (https://github.com/llvm/llvm-project.git 7fff3bfe783953eee18446d30de2f17fe1b68bab)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Program arguments:

flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -o test.o -x f95-cpp-input test.f90

cf.

$ gfortran -fopenmp test.f90
$ ./a.out
 Task            1  started
 Task            1  finished
 Task            5  started
 Task            5  finished
 Task            2  started
 Task            2  finished
 Task            4  started
 Task            4  finished
 Task            3  started
 Task            3  finished
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2023

@llvm/issue-subscribers-openmp

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2023

@llvm/issue-subscribers-flang-frontend

kiranchandramohan added a commit that referenced this issue May 24, 2023
Fixes part of the issue in #62013

Reviewed By: psoni2628

Differential Revision: https://reviews.llvm.org/D151206
@psteinfeld psteinfeld added the bug Indicates an unexpected problem or unintended behavior label Jun 6, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 6, 2023

@llvm/issue-subscribers-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior flang:frontend openmp
Projects
Development

No branches or pull requests

4 participants