This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: short C code that uses AVX and fails under Cygwin


On Jan 14, 2016, at 1:20 PM, Ilya Razenshteyn <ilyaraz@mit.edu> wrote:
> 
> the below C code fails under Cygwin.

It segfaults here.  Is that what you mean by âfailsâ?

> the environment is: Windows 8.1, Cygwin 2.3.1, GCC 4.9.3, CPU 'Intel(R) Core(TM) i7-4510U CPU @ 2.00GHzâ

It fails on my recently-updated Windows 10 64-bit VM running a recently-updated 64-bit Cygwin on an Intel(R) Core i7-3770 CPU @ 3.40GHz.

> int main(void) {
>  void *buf = malloc(1);

The problem isnât the malloc, the problem is the pointer pushing âresâ 4 or 8 bytes down the stack.  The same thing happens with an int.

This feels like an alignment problem, so I started throwing other stuff ahead of res to see if I could make the symptom go away.  This is the smallest object Iâve been able to make that does that:

      uint8_t x[20] = { 0 };

I havenât tried every value between 1 and 19, but all of the obvious ones (8, 10, 12, 16) fail.  I donât know what makes 20 magic.
--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]