Cyg32 on Win64 fails with stack-protector

Carter, Mark Andrew (Andy) andy.carter@flightsafety.com
Mon Jun 25 15:36:00 GMT 2018


We use Cyg32 on a Win64 system and have encountered a gcc compiler bug causing stack corruption due to an invalid optimized stack allocation for a function call that return a large structure (40 bytes).  Possibly related to the long standing bug reported here "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83116".  This bug could bite with compiler version / switch settings or otherwise valid code changes.

Andy Carter  -  Senior Staff Software Engineer
FVS -  FVS Engineering  -  5695 Campus Parkway  -  Hazelwood, MO, 63042  -  United States
Tel: 314.551.8573  
Andy.Carter@FlightSafety.com  -  flightsafety.com  -  A Berkshire Hathaway company

-----Original Message-----
From: cygwin-developers-owner@cygwin.com [mailto:cygwin-developers-owner@cygwin.com] On Behalf Of Corinna Vinschen
Sent: Monday, June 25, 2018 4:45 AM
To: cygwin-developers@cygwin.com
Cc: Yaakov Selkowitz <yselkowi@redhat.com>
Subject: Re: Cyg32 on Win64 fails with stack-protector

Yaakov, can you take a look, please?


Thanks,
Corinna

On Jun 23 15:50, Ben RUBSON wrote:
> On 29 May 2018 18:59, Corinna Vinschen wrote:
> 
> > I suggest to build your own Cygwin and bisect it.
> 
> So I tried to bisect and had some difficulties.
> I used a fresh 32 bits installation on a 64 bits system and followed 
> this howto :
> https://cygwin.com/faq/faq.html#faq.programming.building-cygwin
> 
> Prior to this commit : 6a848db44242a24d6570ef7994918c66ce483fd2
> 2017-11-29 - Yaakov Selkowitz - cygwin: export SSP functions (which is 
> the one JonY suspects)
> 
> With gcc 7.3, compilation fails with undefined __stack_chk_fail, 
> __stack_chk_guard etc...
> With gcc 6.4, compilation succeeds. Cygwin correctly starts with the 
> new cygwin1.dll, but then, some programs, such as cmake (cmake --help) 
> do not show any output anymore.
> Same behavior using Cygwin snapshots. As it worked a few weeks ago, I 
> tried to downgrade some runtime libraries, but with no luck.
> This is easily reproductible, just install Cygwin32 on a 64-bits 
> system, and select Cygwin 2.9 library instead of the 2.10 one.
> 
> So, unfortunately, I was not able to test any commit prior to the one 
> given above.
> This commit however correctly compiles with both gcc 6.4 and 7.3.
> Cygwin correctly starts with it, program correctly show their output. 
> And I'm able to reproduce the issue I opened this topic for.
> So something important has changed between 2017-11-14 and 2017-11-29 
> which triggers this bug.
> 
> Perhaps the new SSP mechanism is more powerful than the previous one 
> and triggers a long-time existing bug ?
> 
> Thank you again,
> 
> Ben

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat


More information about the Cygwin-developers mailing list