https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66861

            Bug ID: 66861
           Summary: [5/6 Regression] Segmentation fault in
                    gcc/testsuite/gfortran.dg/streamio_5.f90
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rai...@emrich-ebersheim.de
  Target Milestone: ---

Since gcc-5 I get a lot of fortran testsuite failures. Most of these with IO
involved and causing a timeout. This an regression. For trunk I'm not sure. I
haven't had the time to build trunk yet. But I expect it has the same issue.

$ gfortran.exe -v
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-5.1.1\bin\gfortran.exe
COLLECT_LTO_WRAPPER=d:/opt/devel/gnu/gcc/mingw_nt/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.1.1/bin/../libexec/gcc/x86_64-w64-mingw32/5.1.1/lto-wrapper.exe
Ziel: x86_64-w64-mingw32
Konfiguriert mit:
../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.1.1/configure
--prefix=/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.1.1
--with-gnu-as
--with-as=/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.1.1/bin/as
--with-gnu-ld
--with-ld=/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.1.1/bin/ld
--build=x86_64-w64-mingw32 --enable-threads=posix
--enable-languages=c,ada,c++,fortran,java,lto,objc,obj-c++
--with-gmp-include=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/include
--with-gmp-lib=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/lib64
--with-mpfr-include=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/include
--with-mpfr-lib=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/lib64
--with-mpc-include=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/include
--with-mpc-lib=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/lib64
--with-isl-include=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/include
--with-isl-lib=/opt/devel/SCRATCH/tmp.kzqcdNeWDQ/install/lib64
--with-local-prefix=/opt/devel/tec/devel/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.1.1
--enable-libgomp --enable-fully-dynamic-string --disable-multilib
--enable-checking=release --disable-werror --with-sysroot=/x86_64-w64-trunk
Thread-Modell: posix
gcc-Version 5.1.1 20150712 [gcc-5-branch revision 225722] (GCC)



gfortran.exe -O2
/opt/devel/gnu/src/gcc/gcc-5-svn/gcc/testsuite/gfortran.dg/streamio_5.f90

$ gdb a.exe
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.exe...done.
(gdb) run
Starting program: D:\msys64\home\rainer\temp\a.exe
[New Thread 4676.0x529c]

Program received signal SIGSEGV, Segmentation fault.
0x000007fefd675960 in strcmp () from C:\Windows\system32\msvcrt.dll
(gdb) where
#0  0x000007fefd675960 in strcmp () from C:\Windows\system32\msvcrt.dll
#1  0x000000006f6eaa94 in find_file0 (u=<optimized out>,
    id=id@entry=162129586587129478, path=path@entry=0x786300 "teststream")
    at
../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.1.1/libgfortran/io/unix.c:1573
#2  0x000000006f6c9209 in _gfortrani_find_file (file=<optimized out>,
    file_len=<optimized out>)
    at
../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.1.1/libgfortran/io/unix.c:1615
#3  0x000000006f6cf385 in _gfortrani_new_unit (opp=opp@entry=0x22fc10,
    u=u@entry=0x785ff0, flags=flags@entry=0x22fb80)
    at
../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.1.1/libgfortran/io/open.c:486
#4  0x000000006f6bd922 in already_open (flags=<optimized out>,
    u=<optimized out>, opp=<optimized out>)
    at
../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.1.1/libgfortran/io/open.c:672
#5  _gfortran_st_open (opp=0x22fc10)
    at
../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.1.1/libgfortran/io/open.c:837
#6  0x000000000040179c in MAIN__ ()
#7  0x0000000000403080 in main ()
(gdb) exit
Undefined command: "exit".  Try "help".
(gdb) quit
A debugging session is active.

        Inferior 1 [process 4676] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]


So, the crash appears in msvcrt.dll. But the call looks suspicious:
find_file0 (u=<optimized out>, id=id@entry=162129586587129478,
path=path@entry=0x786300 "teststream")

Using gcc-4.9.3 is fine, no issue here.

Reply via email to