X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; q=dns; s=default; b=Erz4IR2n7Miciu9gyH5MG2UMxJuY 1ZPVAhQd0azGyJ8ZFgk4YDa5N1M90frPZzbgcIf/fqGa44/CX+8ng1/Ur3gOr/Yi sPEVtZ5p2cfh8p0rLNj7boGzwGzEJZGc4/o19M3ugZO53QdxB6sex1VIVg9f0nK0 ye3osMtshLhvQ/s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; s=default; bh=TUoph8WLQ8lxk4QBBCpj2muKMP8=; b=nb QnDABc5aPZxx5RXulgsRhmVgw1QcqP+JA2fk1G6okbNQSyWC+oJ3Cj2bkHvg3+mB DbTd+/JQtY+0XkZvx6rkinGt69D6jDahdp5xhQLa+MjedoS2OpWt9hTky1Q5+9TW 4hcyow34p+liQ6u9sQjzb6tsnbVM535stryBrRb4w= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=0.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=isn=e2, H*MI:sk:5698031, haven, H*r:envelope-sender?= X-HELO: etr-usa.com Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: short C code that uses AVX and fails under Cygwin From: Warren Young <wyml AT etr-usa DOT com> In-Reply-To: <56980313.5030205@mit.edu> Date: Thu, 14 Jan 2016 13:58:36 -0700 Message-Id: <E6B1821E-06EE-4594-9857-62B9A93CA653@etr-usa.com> References: <56980313 DOT 5030205 AT mit DOT edu> To: The Cygwin Mailing List <cygwin AT cygwin DOT com> X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u0EKwudY021192 On Jan 14, 2016, at 1:20 PM, Ilya Razenshteyn <ilyaraz AT mit DOT 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