GNU bug report logs - #39118
3.0.0 JIT segfaults on 64-bit Cygwin

Previous Next

Package: guile;

Reported by: John Cowan <cowan <at> ccil.org>

Date: Mon, 13 Jan 2020 17:27:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: John Cowan <cowan <at> ccil.org>
Subject: bug#39118: closed (Re: Segfault while building on 64-bit Cygwin)
Date: Mon, 17 Feb 2020 21:07:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#39118: 3.0.0 JIT segfaults on 64-bit Cygwin

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 39118 <at> debbugs.gnu.org.

-- 
39118: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39118
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andy Wingo <wingo <at> pobox.com>
To: Charles Stanhope <charles <at> stanho.pe>
Cc: John Cowan <cowan <at> ccil.org>,
 Ludovic Courtès <ludo <at> gnu.org>, 39118-done <at> debbugs.gnu.org,
 guile-devel <at> gnu.org, Mike Gran <spk121 <at> yahoo.com>
Subject: Re: Segfault while building on 64-bit Cygwin
Date: Mon, 17 Feb 2020 22:05:45 +0100
Aah, you all are amazing -- thank you!!  Applied and merged.

Cheers,

Andy

On Mon 17 Feb 2020 20:27, Charles Stanhope <charles <at> stanho.pe> writes:

> On 2/16/20, Charles Stanhope <charles <at> stanho.pe> wrote:
>> On 2/16/20, Mike Gran <spk121 <at> yahoo.com> 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
>
> diff --git a/lightening/x86.c b/lightening/x86.c
> index 965191a..bdd26e1 100644
> --- a/lightening/x86.c
> +++ b/lightening/x86.c
> @@ -328,6 +328,10 @@ reset_abi_arg_iterator(struct abi_arg_iterator *iter, size_t argc,
>    memset(iter, 0, sizeof *iter);
>    iter->argc = argc;
>    iter->args = args;
> +#if __CYGWIN__ && __X64
> +  // Reserve slots on the stack for 4 register parameters (8 bytes each).
> +  iter->stack_size = 32;
> +#endif
>  }
>  
>  static void

[Message part 3 (message/rfc822, inline)]
From: John Cowan <cowan <at> ccil.org>
To: Andy Wingo <wingo <at> pobox.com>
Cc: bug-guile <at> gnu.org, guile-devel <at> gnu.org
Subject: Re: GNU Guile 2.9.9 Released [beta]
Date: Mon, 13 Jan 2020 12:26:27 -0500
[Message part 4 (text/plain, inline)]
Guile 2.9.9, like .8 and .7, does not build on Cygwin (64 bit).  Configure
runs without error, but make crashes with this (truncated to just the tail):

Making all in bootstrap
make[2]: Entering directory
'/cygdrive/c/Users/rr828893/Downloads/guile-2.9.9/bootstrap'
  BOOTSTRAP GUILEC ice-9/eval.go
  BOOTSTRAP GUILEC ice-9/psyntax-pp.go
  BOOTSTRAP GUILEC language/cps/intmap.go
  BOOTSTRAP GUILEC language/cps/intset.go
  BOOTSTRAP GUILEC language/cps/graphs.go
  BOOTSTRAP GUILEC ice-9/vlist.go
  BOOTSTRAP GUILEC srfi/srfi-1.go
/bin/sh: line 6:  4294 Segmentation fault      (core dumped)
GUILE_AUTO_COMPILE=0 ../meta/build-env guild compile
--target="x86_64-unknown-cygwin" -O1 -Oresolve-primitives -L
"/home/rr828893/Downloads/guile-2.9.9/module" -L
"/home/rr828893/Downloads/guile-2.9.9/guile-readline" -o "srfi/srfi-1.go"
"../module/srfi/srfi-1.scm"
make[2]: *** [Makefile:1930: srfi/srfi-1.go] Error 139
make[2]: Leaving directory
'/cygdrive/c/Users/rr828893/Downloads/guile-2.9.9/bootstrap'
make[1]: *** [Makefile:1849: all-recursive] Error 1
make[1]: Leaving directory
'/cygdrive/c/Users/rr828893/Downloads/guile-2.9.9'
make: *** [Makefile:1735: all] Error 2

All previous problems (which were easy to work around) have gone away in
this release, which is progress, but it doesn't get me past Guile 2.2.



John Cowan          http://vrici.lojban.org/~cowan        cowan <at> ccil.org
Your worships will perhaps be thinking that it is an easy thing
to blow up a dog? [Or] to write a book?
    --Don Quixote, Introduction
[Message part 5 (text/html, inline)]

This bug report was last modified 5 years and 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.