Skip to content

[flang][OpenMP] Null Symbol reference in ResolveSeqLoopIndexInParallelOrTaskConstruct for an undeclared I/O implied-DO index under IMPLICIT NONE inside PARALLEL DEFAULT(NONE) #239946

Open

Description

@YuanchengJiang

The following code:

subroutine s
  implicit none
  real :: a(10)
  !$omp parallel default(none) shared(a)
  read(5,*) (a(i),i=1,10)
  !$omp end parallel
end

Resulted in this output:

flang-24: error: unable to execute command: Segmentation fault (core dumped)
Stack dump:
 #3 Fortran::semantics::OmpAttributeVisitor::ResolveSeqLoopIndexInParallelOrTaskConstruct
 #4 void Fortran::common::log2visit::Log2VisitHelper
 #5 void Fortran::common::log2visit::Log2VisitHelper
 #6 void Fortran::common::log2visit::Log2VisitHelper
 #7 void Fortran::parser::detail::ParseTreeVisitorLookupScope::Walk
 #8 void Fortran::parser::detail::ParseTreeVisitorLookupScope::ForEachInTuple
 #9 void Fortran::common::log2visit::Log2VisitHelper
#10 void Fortran::parser::detail::ParseTreeVisitorLookupScope::Walk

Trunk reproducer (-fsyntax-only -fopenmp): https://godbolt.org/z/G136daxcb

Activity

  1. added
    crashPrefer [crash-on-valid] or [crash-on-invalid]
    on Nov 7, 2026
  2. added
    flangFlang issues not falling into any other category
    generated by fuzzerRegression test generated by fuzzing or AI analysis - not a real world code snippet
    on Nov 7, 2026
  3. llvmorg-github-actions commented on Nov 7, 2026

    @llvmorg-github-actions

    @llvm/issue-subscribers-flang-frontend

    Author: Jiang Yuancheng (YuanchengJiang)

    Details The following code: ```fortran subroutine s implicit none real :: a(10) !$omp parallel default(none) shared(a) read(5,*) (a(i),i=1,10) !$omp end parallel end ```

    Resulted in this output:

    flang-24: error: unable to execute command: Segmentation fault (core dumped)
    Stack dump:
     #<!-- -->3 Fortran::semantics::OmpAttributeVisitor::ResolveSeqLoopIndexInParallelOrTaskConstruct
     #<!-- -->4 void Fortran::common::log2visit::Log2VisitHelper
     #<!-- -->5 void Fortran::common::log2visit::Log2VisitHelper
     #<!-- -->6 void Fortran::common::log2visit::Log2VisitHelper
     #<!-- -->7 void Fortran::parser::detail::ParseTreeVisitorLookupScope::Walk
     #<!-- -->8 void Fortran::parser::detail::ParseTreeVisitorLookupScope::ForEachInTuple
     #<!-- -->9 void Fortran::common::log2visit::Log2VisitHelper
    #<!-- -->10 void Fortran::parser::detail::ParseTreeVisitorLookupScope::Walk
    

    Trunk reproducer (-fsyntax-only -fopenmp): https://godbolt.org/z/G136daxcb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]flang:frontendflang:openmpgenerated by fuzzerRegression test generated by fuzzing or AI analysis - not a real world code snippet

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions