From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Charles Stanhope Newsgroups: gmane.lisp.guile.devel Subject: Re: Segfault while building on 64-bit Cygwin Date: Mon, 17 Feb 2020 11:27:42 -0800 Message-ID: References: <87zherlphs.fsf@pobox.com> <875zh6gk72.fsf_-_@gnu.org> <20200120172253.GA1112065@spikycactus.com> <87wo90kmw9.fsf@pobox.com> <20200216232334.GA2448000@spikycactus.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000009e8abe059eca8c53" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="53372"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andy Wingo , 39118@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= , John Cowan , guile-devel@gnu.org To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Feb 17 20:30:10 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 1j3m5q-000Dku-Mh for guile-devel@m.gmane-mx.org; Mon, 17 Feb 2020 20:30:10 +0100 Original-Received: from localhost ([::1]:51826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3m5p-0000V3-Om for guile-devel@m.gmane-mx.org; Mon, 17 Feb 2020 14:30:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55209) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3m3Y-0005LN-HC for guile-devel@gnu.org; Mon, 17 Feb 2020 14:27:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3m3X-0002g2-CK for guile-devel@gnu.org; Mon, 17 Feb 2020 14:27:48 -0500 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:59479) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j3m3X-0002fL-22 for guile-devel@gnu.org; Mon, 17 Feb 2020 14:27:47 -0500 X-Originating-IP: 209.85.208.176 Original-Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (Authenticated sender: charles@stanho.pe) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id CE4BD240007 for ; Mon, 17 Feb 2020 19:27:43 +0000 (UTC) Original-Received: by mail-lj1-f176.google.com with SMTP id x7so20135046ljc.1 for ; Mon, 17 Feb 2020 11:27:43 -0800 (PST) X-Gm-Message-State: APjAAAUsNhS6ZjcWi1p50B92EXO0ptCGiVenoZ7MseAV+LZ95Pw8zpID FwEjGmPrCn+9vmlMjMQUDy5JeFQ3mVgPrMeaVRSTXA== X-Google-Smtp-Source: APXvYqyW3MJTDlHa0kh+wbNc+P0zdj/Ck+HLyA8odgVqzcp37mOdmZF/Kd+57JKB1qBPP/OSPmrleohFQHjQaOeg528= X-Received: by 2002:a2e:95c4:: with SMTP id y4mr10704057ljh.38.1581967663325; Mon, 17 Feb 2020 11:27:43 -0800 (PST) Original-Received: by 2002:ab3:6883:0:0:0:0:0 with HTTP; Mon, 17 Feb 2020 11:27:42 -0800 (PST) X-Originating-IP: [50.45.151.166] In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.183.193 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:20421 Archived-At: --0000000000009e8abe059eca8c53 Content-Type: text/plain; charset="UTF-8" On 2/16/20, Charles Stanhope wrote: > On 2/16/20, Mike Gran wrote: >> >> I can confirm that Charles's patch, plus another one line patch >> to define CPU_SETSIZE, is enough to get Guile 3.0.x to build and run >> on my box. All tests pass except strptime in French, and the absence >> of crypt. This is a 64-bit build. > > Mike, thanks for going further with the Guile build. The CPU_SETSIZE > issue was what was hanging me up from compiling before Andy's comment > got me to look at lightening. I assumed I had some configuration, > package, or compiler issue. Good to know there's a simple fix. > > Just a further warning to anyone watching, that patch I posted is a > real hack job just to test my theory of the cause of the segfault. I > would expect it to fail when you have fewer than four arguments in a > JITed function call. I wouldn't try doing much else with that Guile > build besides run the tests. :) I had a little bit more time to look into the lightening implementation last night. I've attached a patch that is less horrible and more correct than my previous one. It reserves the stack space regardless of the number of parameters and appears to work. But I'm new to the lightening code base, so I'm not convinced it is the correct solution. It's just the solution I was left with after my time ran out. I wanted to post this patch as a replacement to the prior one in case people did want to do more testing with Guile 3.0 on Cygwin x64. With that, I will let more experienced people come up with the appropriate solution. Happy hacking, everybody! -- Charles --0000000000009e8abe059eca8c53 Content-Type: text/x-patch; charset="US-ASCII"; name="x86-fastcall-stack-reservation-2.patch" Content-Disposition: attachment; filename="x86-fastcall-stack-reservation-2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 ZGlmZiAtLWdpdCBhL2xpZ2h0ZW5pbmcveDg2LmMgYi9saWdodGVuaW5nL3g4Ni5jCmluZGV4IDk2 NTE5MWEuLmJkZDI2ZTEgMTAwNjQ0Ci0tLSBhL2xpZ2h0ZW5pbmcveDg2LmMKKysrIGIvbGlnaHRl bmluZy94ODYuYwpAQCAtMzI4LDYgKzMyOCwxMCBAQCByZXNldF9hYmlfYXJnX2l0ZXJhdG9yKHN0 cnVjdCBhYmlfYXJnX2l0ZXJhdG9yICppdGVyLCBzaXplX3QgYXJnYywKICAgbWVtc2V0KGl0ZXIs IDAsIHNpemVvZiAqaXRlcik7CiAgIGl0ZXItPmFyZ2MgPSBhcmdjOwogICBpdGVyLT5hcmdzID0g YXJnczsKKyNpZiBfX0NZR1dJTl9fICYmIF9fWDY0CisgIC8vIFJlc2VydmUgc2xvdHMgb24gdGhl IHN0YWNrIGZvciA0IHJlZ2lzdGVyIHBhcmFtZXRlcnMgKDggYnl0ZXMgZWFjaCkuCisgIGl0ZXIt PnN0YWNrX3NpemUgPSAzMjsKKyNlbmRpZgogfQogCiBzdGF0aWMgdm9pZAo= --0000000000009e8abe059eca8c53--