public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gfortran segfaults on "Hello world"
@ 2015-11-18 22:26 Thomas Koenig
  2015-11-18 23:07 ` Tim Prince
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Thomas Koenig @ 2015-11-18 22:26 UTC (permalink / raw)
  To: cygwin

Hi,

gfortran appears to be broken (segfault) with the newest cygwin
version I just downloaded. It segfaults on a "Hello, world" program.
gcc works fine.

The warnings on the GMP and MPFR headers make me suspect that some
dependency may be broken.

Here's what happens:

$ gfortran.exe hello.f
<built-in>: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ which gfortran
/usr/bin/gfortran

$ ldd /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/f951.exe
         ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll 
(0x7ff96d540000)
         KERNEL32.DLL => /cygdrive/c/Windows/system32/KERNEL32.DLL 
(0x7ff96b8d0000)
         KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll 
(0x7ff96a760000)
         cygcloog-isl-4.dll => /usr/bin/cygcloog-isl-4.dll (0x3fc700000)
         cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
         cyggmp-10.dll => /usr/bin/cyggmp-10.dll (0x3fb610000)
         cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x3fa2f0000)
         cygintl-8.dll => /usr/bin/cygintl-8.dll (0x3f69d0000)
         cygisl-10.dll => /usr/bin/cygisl-10.dll (0x3f68e0000)
         cygmpc-3.dll => /usr/bin/cygmpc-3.dll (0x3f63f0000)
         cygmpfr-4.dll => /usr/bin/cygmpfr-4.dll (0x3f6390000)
         cygz.dll => /usr/bin/cygz.dll (0x3f4930000)
         cyggcc_s-seh-1.dll => /usr/bin/cyggcc_s-seh-1.dll (0x3fbc50000)

$ gfortran -v hello.f
Driving: gfortran -v hello.f -l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: 
/cygdrive/i/szsz/tmpp/gcc/gcc-4.9.3-1.x86_64/src/gcc-4.9.3/configure 
--srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-4.9.3-1.x86_64/src/gcc-4.9.3 
--prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc 
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C 
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin 
--target=x86_64-pc-cygwin --without-libiconv-prefix 
--without-libintl-prefix --libexecdir=/usr/lib --enable-shared 
--enable-shared-libgcc --enable-static 
--enable-version-specific-runtime-libs --enable-bootstrap 
--enable-__cxa_atexit --with-dwarf2 --with-tune=generic 
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite 
--enable-threads=posix --enable-libatomic --enable-libgomp 
--disable-libitm --enable-libquadmath --enable-libquadmath-support 
--enable-libssp --enable-libada --enable-libgcj-sublibs 
--disable-java-awt --disable-symvers 
--with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as 
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix 
--without-libintl-prefix --with-system-zlib --enable-linker-build-id
Thread model: posix
gcc version 4.9.3 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
  /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/f951.exe hello.f -ffixed-form 
-quiet -dumpbase hello.f -mtune=generic -march=x86-64 -auxbase hello 
-version -fintrinsic-modules-path 
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/finclude -o /tmp/ccsadurw.s
GNU Fortran (GCC) version 4.9.3 (x86_64-pc-cygwin)
         compiled by GNU C version 4.9.3, GMP version 6.0.0, MPFR 
version 3.1.2-p11, MPC version 1.0.3
warning: GMP header version 6.0.0 differs from library version 6.1.0.
warning: MPFR header version 3.1.2-p11 differs from library version 3.1.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.9.3 (x86_64-pc-cygwin)
         compiled by GNU C version 4.9.3, GMP version 6.0.0, MPFR 
version 3.1.2-p11, MPC version 1.0.3
warning: GMP header version 6.0.0 differs from library version 6.1.0.
warning: MPFR header version 3.1.2-p11 differs from library version 3.1.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
<built-in>: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Any ideas?

Regards

     Thomas

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gfortran segfaults on "Hello world"
  2015-11-18 22:26 gfortran segfaults on "Hello world" Thomas Koenig
@ 2015-11-18 23:07 ` Tim Prince
       [not found] ` <20151118225059.5EF9811DB5@cc-mx2.netcologne.de>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Tim Prince @ 2015-11-18 23:07 UTC (permalink / raw)
  To: cygwin

On 11/18/2015 5:26 PM, Thomas Koenig wrote:
> Hi,
>
> gfortran appears to be broken (segfault) with the newest cygwin
> version I just downloaded. It segfaults on a "Hello, world" program.
> gcc works fine.
>
> The warnings on the GMP and MPFR headers make me suspect that some
> dependency may be broken.
>
> Here's what happens:
>
> $ gfortran.exe hello.f
> <built-in>: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
>
> $ which gfortran
> /usr/bin/gfortran
>
> $ ldd /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/f951.exe
>          ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll
> (0x7ff96d540000)
>          KERNEL32.DLL => /cygdrive/c/Windows/system32/KERNEL32.DLL
> (0x7ff96b8d0000)
>          KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll
> (0x7ff96a760000)
>          cygcloog-isl-4.dll => /usr/bin/cygcloog-isl-4.dll (0x3fc700000)
>          cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
>          cyggmp-10.dll => /usr/bin/cyggmp-10.dll (0x3fb610000)
>          cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x3fa2f0000)
>          cygintl-8.dll => /usr/bin/cygintl-8.dll (0x3f69d0000)
>          cygisl-10.dll => /usr/bin/cygisl-10.dll (0x3f68e0000)
>          cygmpc-3.dll => /usr/bin/cygmpc-3.dll (0x3f63f0000)
>          cygmpfr-4.dll => /usr/bin/cygmpfr-4.dll (0x3f6390000)
>          cygz.dll => /usr/bin/cygz.dll (0x3f4930000)
>          cyggcc_s-seh-1.dll => /usr/bin/cyggcc_s-seh-1.dll (0x3fbc50000)
>
> $ gfortran -v hello.f
> Driving: gfortran -v hello.f -l gfortran -shared-libgcc
> Using built-in specs.
> COLLECT_GCC=gfortran
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/lto-wrapper.exe
> Target: x86_64-pc-cygwin
> Configured with:
> /cygdrive/i/szsz/tmpp/gcc/gcc-4.9.3-1.x86_64/src/gcc-4.9.3/configure
> --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-4.9.3-1.x86_64/src/gcc-4.9.3
> --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
> --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
> --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin
> --target=x86_64-pc-cygwin --without-libiconv-prefix
> --without-libintl-prefix --libexecdir=/usr/lib --enable-shared
> --enable-shared-libgcc --enable-static
> --enable-version-specific-runtime-libs --enable-bootstrap
> --enable-__cxa_atexit --with-dwarf2 --with-tune=generic
> --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite
> --enable-threads=posix --enable-libatomic --enable-libgomp
> --disable-libitm --enable-libquadmath --enable-libquadmath-support
> --enable-libssp --enable-libada --enable-libgcj-sublibs
> --disable-java-awt --disable-symvers
> --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as
> --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix
> --without-libintl-prefix --with-system-zlib --enable-linker-build-id
> Thread model: posix
> gcc version 4.9.3 (GCC)
> COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
>   /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/f951.exe hello.f -ffixed-form
> -quiet -dumpbase hello.f -mtune=generic -march=x86-64 -auxbase hello
> -version -fintrinsic-modules-path
> /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/finclude -o /tmp/ccsadurw.s
> GNU Fortran (GCC) version 4.9.3 (x86_64-pc-cygwin)
>          compiled by GNU C version 4.9.3, GMP version 6.0.0, MPFR
> version 3.1.2-p11, MPC version 1.0.3
> warning: GMP header version 6.0.0 differs from library version 6.1.0.
> warning: MPFR header version 3.1.2-p11 differs from library version 3.1.3.
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> GNU Fortran (GCC) version 4.9.3 (x86_64-pc-cygwin)
>          compiled by GNU C version 4.9.3, GMP version 6.0.0, MPFR
> version 3.1.2-p11, MPC version 1.0.3
> warning: GMP header version 6.0.0 differs from library version 6.1.0.
> warning: MPFR header version 3.1.2-p11 differs from library version 3.1.3.
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> <built-in>: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
>
> Any ideas?
>
upgrade gmp and mpfr to current versions.  I prefer the gfortran 5.2 
binary, or a 6.0 bootstrapped from 5.2, all using those current cygwin 
gmp and mpfr releases.
-- 
Tim Prince

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gfortran segfaults on "Hello world"
       [not found] ` <20151118225059.5EF9811DB5@cc-mx2.netcologne.de>
@ 2015-11-19  7:06   ` Thomas Koenig
  2015-11-19 12:06     ` Marco Atzeri
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Koenig @ 2015-11-19  7:06 UTC (permalink / raw)
  To: n8tm, cygwin

Hi,

> Cygwin64 now offers a choice among 4.9.2-3, 4.9.3-1, and 5.2.0-1.  I
> have the last one installed, and in addition a recently built 6.0 on my
> Haswell laptop.  I’m fairly certain I have used the 4.9.3 successfully
> in the past.  It looks like you need to update to the current gmp and
> mpfr.  Normally, cygwin install.exe would tell you to do that if you
> install a gcc and gfortran built against those.

I just installed 5.2.0, and got the same warning about mismatched
libraries and the same segfault.

> If you really wanted 4.9.3-1 running against the older gmp and mpfr, you
> could build it yourself.

The library versions are *newer* than what both 4.9.3 and 5.2.0 from the
distribution are built against.  This may or may not be the cause of the
problem; either way gfortran is currently broken on Cygwin 64.

If your sytem is running fine, don't upgrade :-)

Building gfortran myself under Cygwin has not been a happy experience
for me in the past (although I do it quite regularly on Linux, of
course).  Maybe I'll give it a spin.

Regards

	Thomas



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gfortran segfaults on "Hello world"
  2015-11-18 22:26 gfortran segfaults on "Hello world" Thomas Koenig
  2015-11-18 23:07 ` Tim Prince
       [not found] ` <20151118225059.5EF9811DB5@cc-mx2.netcologne.de>
@ 2015-11-19  7:43 ` Achim Gratz
  2015-11-26 19:10 ` Achim Gratz
  3 siblings, 0 replies; 6+ messages in thread
From: Achim Gratz @ 2015-11-19  7:43 UTC (permalink / raw)
  To: cygwin

Thomas Koenig writes:
> The warnings on the GMP and MPFR headers make me suspect that some
> dependency may be broken.

No, they simply have been updated after gcc was built.

> warning: GMP header version 6.0.0 differs from library version 6.1.0.

Can you downgrade to libgmp10-6.0.0a-2 and check if that solves the
problem for you?  There has been no API bump and the libraries are
supposed to be binary compatible, but maybe gcc is doing something funky
with some internals.

> warning: MPFR header version 3.1.2-p11 differs from library version
> 3.1.3.

The current version really is just rolling up the patches of the former
and an official rename and it's been in place for long enough to be an
unlikely candidate for breakage.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gfortran segfaults on "Hello world"
  2015-11-19  7:06   ` Thomas Koenig
@ 2015-11-19 12:06     ` Marco Atzeri
  0 siblings, 0 replies; 6+ messages in thread
From: Marco Atzeri @ 2015-11-19 12:06 UTC (permalink / raw)
  To: cygwin

On 19/11/2015 08:05, Thomas Koenig wrote:
> Hi,
>
>> Cygwin64 now offers a choice among 4.9.2-3, 4.9.3-1, and 5.2.0-1.  I
>> have the last one installed, and in addition a recently built 6.0 on my
>> Haswell laptop.  I’m fairly certain I have used the 4.9.3 successfully
>> in the past.  It looks like you need to update to the current gmp and
>> mpfr.  Normally, cygwin install.exe would tell you to do that if you
>> install a gcc and gfortran built against those.
>
> I just installed 5.2.0, and got the same warning about mismatched
> libraries and the same segfault.
>
>> If you really wanted 4.9.3-1 running against the older gmp and mpfr, you
>> could build it yourself.
>
> The library versions are *newer* than what both 4.9.3 and 5.2.0 from the
> distribution are built against.  This may or may not be the cause of the
> problem; either way gfortran is currently broken on Cygwin 64.

gfortran 4.9.3-1 is working fine on my W7-64 system

$ cygcheck -cd |grep -E "fortran|gmp|mpfr"
gcc-fortran                             4.9.3-1
gmp                                     6.1.0-1
libgfortran3                            4.9.3-1
libgmp-devel                            6.1.0-1
libgmp10                                6.1.0-1
libgmpxx4                               6.1.0-1
libmpfr-devel                           3.1.3-1
libmpfr4                                3.1.3-1
mpfr                                    3.1.3-1

$ gfortran  -ffree-form helloworld.f -o helloworld-f77-gcc

$ ./helloworld-f77-gcc.exe
  Hello World!

$ cat helloworld.f
        write (*,*) "Hello World!"
end




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gfortran segfaults on "Hello world"
  2015-11-18 22:26 gfortran segfaults on "Hello world" Thomas Koenig
                   ` (2 preceding siblings ...)
  2015-11-19  7:43 ` Achim Gratz
@ 2015-11-26 19:10 ` Achim Gratz
  3 siblings, 0 replies; 6+ messages in thread
From: Achim Gratz @ 2015-11-26 19:10 UTC (permalink / raw)
  To: cygwin

Thomas Koenig writes:
[…]

Can you please post cygcheck output as per
https://cygwin.com/problems.html


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-26 18:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 22:26 gfortran segfaults on "Hello world" Thomas Koenig
2015-11-18 23:07 ` Tim Prince
     [not found] ` <20151118225059.5EF9811DB5@cc-mx2.netcologne.de>
2015-11-19  7:06   ` Thomas Koenig
2015-11-19 12:06     ` Marco Atzeri
2015-11-19  7:43 ` Achim Gratz
2015-11-26 19:10 ` Achim Gratz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).