From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Marco Atzeri Newsgroups: gmane.lisp.guile.devel Subject: Re: Segfault while building on 64-bit Cygwin Date: Sat, 15 Feb 2020 18:58:03 +0100 Message-ID: <4548f494-6be3-8463-f33a-dd53a0da28e0@gmail.com> References: <87zherlphs.fsf@pobox.com> <875zh6gk72.fsf_-_@gnu.org> <20200120172253.GA1112065@spikycactus.com> <87wo90kmw9.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="64848"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Feb 15 19:10:00 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j31tA-000GjR-1g for guile-devel@m.gmane-mx.org; Sat, 15 Feb 2020 19:10:00 +0100 Original-Received: from localhost ([::1]:53352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j31t9-0002gz-2K for guile-devel@m.gmane-mx.org; Sat, 15 Feb 2020 13:09:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56423) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j31hh-0007OZ-Cg for guile-devel@gnu.org; Sat, 15 Feb 2020 12:58:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j31hg-0007rM-5h for guile-devel@gnu.org; Sat, 15 Feb 2020 12:58:09 -0500 Original-Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:33713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j31hf-0007qw-Ss for guile-devel@gnu.org; Sat, 15 Feb 2020 12:58:08 -0500 Original-Received: by mail-wr1-x443.google.com with SMTP id u6so14824579wrt.0 for ; Sat, 15 Feb 2020 09:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=Mn1IgSBIgp/G2t3dYkHgQrH+yEXYKj3LNY9uxuAENq8=; b=lHd5aBZ91qwrM4S8weOMQdeVEYFjkY08L4418n7OcZkWGylkfPedrr3knv2qNExLJJ 7wiNkChpdMVI9Fi4MiSv1zYv5CawtAeKNtIMD23R/Td2a/RZQ4NPZWjV3sYEYZUVbnd7 OZ1SCV1wqAtDoL5EIq5JWoex2LvSg7f9W3EkDk16J6vcfX5p4xTTBkVSnC+cfHFWknMP x74QbCKMv8HYjlKyOLx3FxDk7K6KBambu4m78IpNjFdlI5+FzcBetbSwDt1Llds8YAhP i7EWCVwnkzXgkBcp9fDnvWpkSGyslbZZ6FeEUO1/V0vqtJZQtmXM0XuhVWxTsvmBB8k+ mFwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Mn1IgSBIgp/G2t3dYkHgQrH+yEXYKj3LNY9uxuAENq8=; b=CFHmLclrxjXpLzePIUwsjrFnBkScX7yBWs9n27uiA4xMORi3DQID51ZDtviV/Q1+Aw SRirmbdLsugdUAqP/SuTMKQJaQ1le0GdW9recb81s43y3dx7EfFZJXP0tPZN+TzwyaGX yfrSBHNwmpLLS6jdFynIfEN/8f9llT00BUbkM9Mep8PJopcuJnUTNWQlsHkQM7zRW0yw 2knMuaQv0HSTd4m6EbU4Pf15PwTYdNOlCOBDtUINQLSLHrg5BQHo2v3WxKFSVkxmuRyN NtRMWpryrspW72odWgXN9ldjSI4qCRoqSoQm0ACQcre17qkdjPaFuWaIKDfmiCUZHuUc nXCg== X-Gm-Message-State: APjAAAUIDAHs/rPzA4rsY/OvTxzpymQRM/5Cn3Pa3MEQ9EL8Or9eD0s0 zgvjZ3Ikqzv25DnGlGHC8tCFhCLj X-Google-Smtp-Source: APXvYqzPNONXeJYBBOyXA8XrxG5DSgXLLGYRNUA667ILLIR+/fhAldHclFu6dt0I1Mg4dyFONIzghQ== X-Received: by 2002:adf:e692:: with SMTP id r18mr11118741wrm.413.1581789486249; Sat, 15 Feb 2020 09:58:06 -0800 (PST) Original-Received: from ?IPv6:2003:ee:6727:2e01:69b2:d3e1:5e11:2c63? (p200300EE67272E0169B2D3E15E112C63.dip0.t-ipconnect.de. [2003:ee:6727:2e01:69b2:d3e1:5e11:2c63]) by smtp.gmail.com with ESMTPSA id v12sm12344281wru.23.2020.02.15.09.58.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Feb 2020 09:58:05 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-Mailman-Approved-At: Sat, 15 Feb 2020 13:09:47 -0500 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20416 Archived-At: Am 14.02.2020 um 18:46 schrieb Charles Stanhope: > On 2/6/20, Charles Stanhope wrote: >> On 2/6/20, Andy Wingo wrote: >> >>> Given that John said that compilation went fine with >>> GUILE_JIT_THRESHOLD=-1, I think perhaps this problem may have been fixed >>> in the past. My suspicions are that this issue is an ABI issue with >>> lightening that could perhaps be reproduced by: >>> >>> git co https://gitlab.com/wingo/lightening >>> cd lightening >>> make -C tests test-native >>> >>> Of course any additional confirmation is useful and welcome! >> >> I haven't been able to get guile to compile under Cygwin (just a >> compilation error I haven't had time to track down), but I was able to >> quickly try the above. I get: >> >> Testing: test-native-call_10 >> call_10.c:9: assertion failed: e == 4 >> /bin/sh: line 1: 7063 Aborted (core dumped) ./$test >> make: *** [Makefile:31: test-native] Error 134 >> > > Andy, I don't know if you'd want to continue this here or on > lightening's gitlab page, but I looked into this a little bit a few > minutes here and there this past weeek. The x86 "fast-call" calling > convention used on Windows x64[0] and shared by Cygwin[1] requires > that the caller reserve 32 bytes of memory on the stack for the callee > to spill the register parameters (even if the callee takes fewer than > four parameters). I think lightening is currently missing that for the > x64 case for Cygwin. > > To test the idea, I made a small modification (patch attached) that is > *not* intended as a solution as it doesn't work for the general case, > but it does allow the tests to pass on Cygwin 64. > > [0] https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019 > [1] https://cygwin.com/cygwin-ug-net/programming.html#gcc-64 > > -- > Charles > as guile 3.0 builds fine on Cygwin i686 but segfault immediately on bootstrap for x86_64 I bet you are right on the root cause Marco