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][AIX] zero-sized array crash #110913

Open
kkwli opened this issue Oct 2, 2024 · 3 comments
Open

[flang][AIX] zero-sized array crash #110913

kkwli opened this issue Oct 2, 2024 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior flang:runtime

Comments

@kkwli
Copy link
Collaborator

kkwli commented Oct 2, 2024

Reproducer

  integer, allocatable :: a(:)
  allocate(a(0))
  inquire(iolength=iol) a
end
$ flang-new zero.f90
$ ./a.out

fatal Fortran runtime error(/home/kli/zero.f90:3): Bad address for I/O item -- null base address or subscripts out of range
IOT/Abort trap (core dumped)

Original test: https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/torture/execute/iolength_1.f90

@kkwli kkwli added flang:runtime flang Flang issues not falling into any other category labels Oct 2, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 2, 2024

@llvm/issue-subscribers-flang-runtime

Author: Kelvin Li (kkwli)

Reproducer ```fortran integer, allocatable :: a(:) allocate(a(0)) inquire(iolength=iol) a end ```
$ flang-new zero.f90
$ ./a.out

fatal Fortran runtime error(/home/kli/zero.f90:3): Bad address for I/O item -- null base address or subscripts out of range
IOT/Abort trap (core dumped)

Original test: https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/torture/execute/iolength_1.f90

@EugeneZelenko EugeneZelenko removed the flang Flang issues not falling into any other category label Oct 2, 2024
@DanielCChen DanielCChen added the bug Indicates an unexpected problem or unintended behavior label Oct 2, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 2, 2024

@llvm/issue-subscribers-bug

Author: Kelvin Li (kkwli)

Reproducer ```fortran integer, allocatable :: a(:) allocate(a(0)) inquire(iolength=iol) a end ```
$ flang-new zero.f90
$ ./a.out

fatal Fortran runtime error(/home/kli/zero.f90:3): Bad address for I/O item -- null base address or subscripts out of range
IOT/Abort trap (core dumped)

Original test: https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/torture/execute/iolength_1.f90

@DanielCChen
Copy link
Contributor

There is another variation that could be caused by the same issue.

program main
  real, allocatable :: a1(:)
  allocate( a1(2:1) )
  a1 = real(4, 8)
end

fatal Fortran runtime error(/home/cdchen/temp/b.f:4): Assign: mismatched ranks (1 != 0) in assignment to unallocated allocatable
IOT/Abort trap(coredump)

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:runtime
Projects
None yet
Development

No branches or pull requests

4 participants