Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

Dave Plater
Hi, I maintain Lilypond for openSUSE and also created guile1 for
lilypond using guile-1.8.8
I have a problem, guile-1.8.8 doesn't build with gcc 10:
cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc
chars.doc continuations.doc debug.doc deprecation.doc deprecated.doc
discouraged.doc dynl.doc dynwind.doc environments.doc eq.doc error.doc
eval.doc evalext.doc extensions.doc feature.doc fluids.doc fports.doc
futures.doc gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc
gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc hooks.doc
i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc
macros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc
options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc
properties.doc random.doc rdelim.doc read.doc root.doc rw.doc
scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc
stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srfi-13.doc
srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc
threads.doc throw.doc values.doc variable.doc vectors.doc version.doc
vports.doc weaks.doc ramap.doc unif.doc dynl.doc filesys.doc posix.doc
net_db.doc socket.doc regex-posix.doc |
GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
../scripts/snarf-check-and-output-texi          >
guile-procedures.texi || { rm guile-procedures.texi; false; }

Causes a:
15388 Segmentation fault      |
GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
../scripts/snarf-check-and-output-texi > guile-procedures.texi

This is beyond my capabilities, the above command resists gdb --args
so I'm unable to see where the segfault happens. Something in gcc10 is
exposing a problem in guile-1.8.8

My first thought is to update guile to 2.2 but lilypond's configure
complains. I've seen a lot of talk about using guile 2.2,
openSUSE:Factory is at guile-3.0.2 so 2.2 is quite old but I'm
hopefull that it will resist gcc10. Gcc9 is still available for use
but that will be patching a leaky boat. See:
https://build.opensuse.org/build/home:plater:lilypond/Tumbleweed/x86_64/guile1/_log
for the full story and
https://build.opensuse.org/package/show/home:plater:lilypond/guile1
I appreciate any help.
Thanks
Dave Plater

Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

David Kastrup
Dave Plater <[hidden email]> writes:

> Hi, I maintain Lilypond for openSUSE and also created guile1 for
> lilypond using guile-1.8.8
> I have a problem, guile-1.8.8 doesn't build with gcc 10:
> cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc
> chars.doc continuations.doc debug.doc deprecation.doc deprecated.doc
> discouraged.doc dynl.doc dynwind.doc environments.doc eq.doc error.doc
> eval.doc evalext.doc extensions.doc feature.doc fluids.doc fports.doc
> futures.doc gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc
> gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc hooks.doc
> i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc
> macros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc
> options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc
> properties.doc random.doc rdelim.doc read.doc root.doc rw.doc
> scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc
> stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srfi-13.doc
> srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc
> threads.doc throw.doc values.doc variable.doc vectors.doc version.doc
> vports.doc weaks.doc ramap.doc unif.doc dynl.doc filesys.doc posix.doc
> net_db.doc socket.doc regex-posix.doc |
> GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
> ../scripts/snarf-check-and-output-texi          >
> guile-procedures.texi || { rm guile-procedures.texi; false; }
>
> Causes a:
> 15388 Segmentation fault      |

Last time I checked, a successful Guile-1.8 build needed to use the
branch_release-1-8 branch from the Guile repository (which has a few
commits on top).  However, I don't know whether this will already help
with your GCC 10 problem: I don't remember anything related to that.  If
it doesn't, you might want to ask Thien-Thi Nguyen (who has made this
branch tip work so far) to take a look.

--
David Kastrup

Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

Dev mailing list
Am Montag, den 08.06.2020, 11:16 +0200 schrieb David Kastrup:

> Dave Plater <[hidden email]> writes:
>
> > Hi, I maintain Lilypond for openSUSE and also created guile1 for
> > lilypond using guile-1.8.8
> > I have a problem, guile-1.8.8 doesn't build with gcc 10:
> > cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc
> > chars.doc continuations.doc debug.doc deprecation.doc deprecated.doc
> > discouraged.doc dynl.doc dynwind.doc environments.doc eq.doc error.doc
> > eval.doc evalext.doc extensions.doc feature.doc fluids.doc fports.doc
> > futures.doc gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc
> > gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc hooks.doc
> > i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc
> > macros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc
> > options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc
> > properties.doc random.doc rdelim.doc read.doc root.doc rw.doc
> > scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc
> > stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srfi-13.doc
> > srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc
> > threads.doc throw.doc values.doc variable.doc vectors.doc version.doc
> > vports.doc weaks.doc ramap.doc unif.doc dynl.doc filesys.doc posix.doc
> > net_db.doc socket.doc regex-posix.doc |
> > GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
> > ../scripts/snarf-check-and-output-texi          >
> > guile-procedures.texi || { rm guile-procedures.texi; false; }
> >
> > Causes a:
> > 15388 Segmentation fault      |
>
> Last time I checked, a successful Guile-1.8 build needed to use the
> branch_release-1-8 branch from the Guile repository (which has a few
> commits on top).
I had no problems with using the released tarball of 1.8.8, but I think
that was earlier this year with GCC 9.2. I'll check again later today
with version 10.1 of GCC on Arch Linux.

Regards
Jonas

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

Dev mailing list
In reply to this post by Dave Plater
Am Montag, den 08.06.2020, 10:24 +0200 schrieb Dave Plater:

> Hi, I maintain Lilypond for openSUSE and also created guile1 for
> lilypond using guile-1.8.8
> I have a problem, guile-1.8.8 doesn't build with gcc 10:
> [...]
>
> Causes a:
> 15388 Segmentation fault      |
> GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
> ../scripts/snarf-check-and-output-texi > guile-procedures.texi
>
> This is beyond my capabilities, the above command resists gdb --args
> so I'm unable to see where the segfault happens. Something in gcc10 is
> exposing a problem in guile-1.8.8
Yep, GCC 10 "breaks" the configure check to find the stack direction.
This makes Guile believe the stack grows up, which is of course plain
wrong. I was able to workaround this issue by disabling optimizations
for the configure check, see attached diff.

(For the technically interested: GCC 10 succeeds in rewriting a
particular tail call into jumps. This avoids stack frames from the
recursive call which the check relies on. Funnily enough, a comment
says: "If the code could be inlined, that might cause the test to give
an incorrect answer." - indeed.)

Cheers
Jonas

guile-1.8.8-gcc-10-configure.diff (944 bytes) Download Attachment
signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

Dave Plater
On 6/8/20, Jonas Hahnfeld <[hidden email]> wrote:

> Am Montag, den 08.06.2020, 10:24 +0200 schrieb Dave Plater:
>> Hi, I maintain Lilypond for openSUSE and also created guile1 for
>> lilypond using guile-1.8.8
>> I have a problem, guile-1.8.8 doesn't build with gcc 10:
>> [...]
>>
>> Causes a:
>> 15388 Segmentation fault      |
>> GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
>> ../scripts/snarf-check-and-output-texi > guile-procedures.texi
>>
>> This is beyond my capabilities, the above command resists gdb --args
>> so I'm unable to see where the segfault happens. Something in gcc10 is
>> exposing a problem in guile-1.8.8
>
> Yep, GCC 10 "breaks" the configure check to find the stack direction.
> This makes Guile believe the stack grows up, which is of course plain
> wrong. I was able to workaround this issue by disabling optimizations
> for the configure check, see attached diff.
>
> (For the technically interested: GCC 10 succeeds in rewriting a
> particular tail call into jumps. This avoids stack frames from the
> recursive call which the check relies on. Funnily enough, a comment
> says: "If the code could be inlined, that might cause the test to give
> an incorrect answer." - indeed.)
>
> Cheers
> Jonas
>

Thanks, I didn't use the patch because CFLAGS are modified by the
%configure macro, just used CFLAGS=`echo %optflags | tr 02 00` on the
build service build and it works like a charm.

Thanks
Dave Plater

Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

Dev mailing list
Am Montag, den 08.06.2020, 13:53 +0200 schrieb Dave Plater:

> On 6/8/20, Jonas Hahnfeld <[hidden email]> wrote:
> > Am Montag, den 08.06.2020, 10:24 +0200 schrieb Dave Plater:
> > > Hi, I maintain Lilypond for openSUSE and also created guile1 for
> > > lilypond using guile-1.8.8
> > > I have a problem, guile-1.8.8 doesn't build with gcc 10:
> > > [...]
> > >
> > > Causes a:
> > > 15388 Segmentation fault      |
> > > GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
> > > ../scripts/snarf-check-and-output-texi > guile-procedures.texi
> > >
> > > This is beyond my capabilities, the above command resists gdb --args
> > > so I'm unable to see where the segfault happens. Something in gcc10 is
> > > exposing a problem in guile-1.8.8
> >
> > Yep, GCC 10 "breaks" the configure check to find the stack direction.
> > This makes Guile believe the stack grows up, which is of course plain
> > wrong. I was able to workaround this issue by disabling optimizations
> > for the configure check, see attached diff.
> >
> > (For the technically interested: GCC 10 succeeds in rewriting a
> > particular tail call into jumps. This avoids stack frames from the
> > recursive call which the check relies on. Funnily enough, a comment
> > says: "If the code could be inlined, that might cause the test to give
> > an incorrect answer." - indeed.)
> >
> > Cheers
> > Jonas
> >
>
> Thanks, I didn't use the patch because CFLAGS are modified by the
> %configure macro, just used CFLAGS=`echo %optflags | tr 02 00` on the
> build service build and it works like a charm.
This means you'll build all of Guile without optimizations which is
very likely not what you want. My patch instead modifies CFLAGS only
for the duration of that particular check. Flags passed by %configure
will still make it during build.

Jonas

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

David Kastrup
In reply to this post by Dev mailing list
Jonas Hahnfeld via Discussions on LilyPond development
<[hidden email]> writes:

> Am Montag, den 08.06.2020, 10:24 +0200 schrieb Dave Plater:
>> Hi, I maintain Lilypond for openSUSE and also created guile1 for
>> lilypond using guile-1.8.8
>> I have a problem, guile-1.8.8 doesn't build with gcc 10:
>> [...]
>>
>> Causes a:
>> 15388 Segmentation fault      |
>> GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
>> ../scripts/snarf-check-and-output-texi > guile-procedures.texi
>>
>> This is beyond my capabilities, the above command resists gdb --args
>> so I'm unable to see where the segfault happens. Something in gcc10 is
>> exposing a problem in guile-1.8.8
>
> Yep, GCC 10 "breaks" the configure check to find the stack direction.
> This makes Guile believe the stack grows up, which is of course plain
> wrong. I was able to workaround this issue by disabling optimizations
> for the configure check, see attached diff.
>
> (For the technically interested: GCC 10 succeeds in rewriting a
> particular tail call into jumps. This avoids stack frames from the
> recursive call which the check relies on. Funnily enough, a comment
> says: "If the code could be inlined, that might cause the test to give
> an incorrect answer." - indeed.)

It's easy enough to write a recursive call that cannot be tail-call
optimised.  It may be old code, but it was trouble waiting to happen.

--
David Kastrup

Reply | Threaded
Open this post in threaded view
|

Re: Need help with guile 1.88 or using guile 2.2 with lilypond-2.20

Anthony Fok-2
In reply to this post by Dev mailing list
Hi Dave and Jonas,

On Mon, Jun 8, 2020 at 4:38 AM Jonas Hahnfeld via Discussions on
LilyPond development <[hidden email]> wrote:

> Am Montag, den 08.06.2020, 10:24 +0200 schrieb Dave Plater:
> > Hi, I maintain Lilypond for openSUSE and also created guile1 for
> > lilypond using guile-1.8.8
> > I have a problem, guile-1.8.8 doesn't build with gcc 10:
> > [...]
> >
> > Causes a:
> > 15388 Segmentation fault      |
> > GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
> > ../scripts/snarf-check-and-output-texi > guile-procedures.texi
> >
> > This is beyond my capabilities, the above command resists gdb --args
> > so I'm unable to see where the segfault happens. Something in gcc10 is
> > exposing a problem in guile-1.8.8

Dave, thank you so much for bringing up this issue in the mailing list.
I have just started to look at this same issue yesterday for Debian:

  #966353 - FTBFS: guile segfaults when run to collect docs - Debian
Bug report logs
  https://bugs.debian.org/966353

and had no idea where to start except to use gcc-9 instead, until I
came upon this thread.  :-)

> Yep, GCC 10 "breaks" the configure check to find the stack direction.
> This makes Guile believe the stack grows up, which is of course plain
> wrong. I was able to workaround this issue by disabling optimizations
> for the configure check, see attached diff.
>
> (For the technically interested: GCC 10 succeeds in rewriting a
> particular tail call into jumps. This avoids stack frames from the
> recursive call which the check relies on. Funnily enough, a comment
> says: "If the code could be inlined, that might cause the test to give
> an incorrect answer." - indeed.)

Jonas, thank you so much!  This is most insightful, as otherwise
I wouldn't even know where to start looking!

It turns out the fix was applied to Guile-2.0 in 2011,
and was backported to Guile-1.8 (but not released as tarball)
in 2012.  Here is what I will be using for the Debian changelog:

  Patch Guile-1.8 to the latest branch_release-1-8 branch
  found in Guile git repository on Savannah, see patches 1801 to 1825.
  In particular, 1812-Fix-stack-growth-direction-check.patch,
  originally written for Autoconf by Paul Eggert for Autoconf
  and pulled into Guile-2.0 in 2011, fixed a build error with
  -O3 back then, and fixes FTBFS with gcc-10 nowadays,
  due to a bug in find_stack_direction() code in configure.in.  See
  http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00035.html
  for the whole story.  (Closes: #966353)

Relevant commits:
 * https://git.savannah.gnu.org/cgit/guile.git/commit/configure.ac?id=62bc107
 * https://git.savannah.gnu.org/cgit/guile.git/commit/configure.ac?id=236f901
 * https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12

Cheers,
Anthony