Discussion:
GCC: Precompiled headers - Segmentation fault
(too old to reply)
Jiří Engelthaler
2018-11-27 10:32:54 UTC
Permalink
Hi,
I have a problem with GCC 7.3.0 (problem is in all versions) and
precompiled headers.
I have the sample file http://ge.tt/7fRLk1t2 which causes Segmentation
fault in cc1.
The test passes normally on Linux. I searched why and found that the result
here
https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/ggc-common.c#L626
is 1 in Linux and -1 in CygWin.

In Linux the method called is
https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/config/host-linux.c#L182

In Cygwin the method called is
https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/ggc-common.c#L708
- mmap return address is not equal to base address.

There are also some reports in gcc bugzilla.

Regards
Jiří Engelthaler

--
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
Corinna Vinschen
2018-11-27 13:13:06 UTC
Permalink
Post by Jiří Engelthaler
Hi,
I have a problem with GCC 7.3.0 (problem is in all versions) and
precompiled headers.
I have the sample file http://ge.tt/7fRLk1t2 which causes Segmentation
fault in cc1.
The test passes normally on Linux. I searched why and found that the result
here
https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/ggc-common.c#L626
is 1 in Linux and -1 in CygWin.
In Linux the method called is
https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/config/host-linux.c#L182
In Cygwin the method called is
https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/ggc-common.c#L708
- mmap return address is not equal to base address.
This version assumes that the kernel honors the START operand of mmap
even without MAP_FIXED if START through START+SIZE are not currently
mapped with something.

Sigh.


Corinna
--
Corinna Vinschen
Cygwin Maintainer
Loading...