Menu

#340 runtime error opening existing file

None
open
nobody
None
1
2020-02-29
2020-02-29
Geza Hidasi
No

Dear Sirs,
TDM gfortran seems to have a bug. Trying to OPEN an existing file leads to runtime error.
Example file:


program main
open(20,file="arr.txt", status="new")
close(20)
print*, "File 20 closed"

print*, "Trying to open File 20: leads to runtime-error."
open(20,file="arr.txt", status="old")
close(20)
end program main


Compiling and building OK.

Output:

File 20 closed
Trying to open File 20: leads to runtime-error.

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

0 ffffffff


Working enviroment:
gfortran from "codeblocks-17.12mingw_fortran-setup.exe"
gcc version 5.1.0 (tdm-1)
GNU ld (GNU Binutils) 2.24

Trying the TDM64 bundle (GCC 5.1.0) results the same error.

The same error occurs in all cases, using CodeBlocks or using gfortran from TDM bundle or CodeBlocks directly on command line.

The error occurs on more machines (i3, i7, Xeon). On all machines installed Win 10 Pro, v1909, Build 18363.657.

Regards
Geza Hidasi

Discussion

  • Anonymous

    Anonymous - 2020-02-29
    Post awaiting moderation.
  • Geza Hidasi

    Geza Hidasi - 2020-02-29

    Additional info:
    using gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project), the above error doesn't occur.
    Geza Hidasi

     

Anonymous
Anonymous

Add attachments
Cancel