Menu

#4653 French beam ending on rest causes segfault

Verified
Crash
2015-11-26
2015-11-02
No

Reported by Jean Menezes da Rocha:

If, with override Stem.french-beaming = ##t, a beam ends over a rest, Lily will exit with a segfault.

:::TeX
\version "2.19.30"

\relative c'' {
  \override Stem #'french-beaming = ##t
  c16[ d e r]
}

I reproduced this with vv. 2.16.2, 2.18.2, and 2.19.28.

Discussion

  • Simon Albrecht

    Simon Albrecht - 2015-11-03

    Here is a GDB backtrace, which Jean kindly provided:

    GNU gdb (GDB) 7.10
    Copyright (C) 2015 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-unknown-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from lilypond...(no debugging symbols found)...done.
    (gdb) r example.ly
    Starting program: /usr/bin/lilypond example.ly
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    GNU LilyPond 2.19.30
    Processing `example.ly'
    Parsing...
    Interpreting music...
    Preprocessing graphical objects...
    Finding the ideal number of pages...
    Fitting music on 1 page...
    Drawing systems...
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff793df7e in scm_c_memq () from /usr/lib/libguile.so.17
    (gdb) bt full
    #0  0x00007ffff793df7e in scm_c_memq () from /usr/lib/libguile.so.17
    No symbol table info available.
    #1  0x00000000005aa9c9 in ?? ()
    No symbol table info available.
    #2  0x00000000006b74db in ?? ()
    No symbol table info available.
    #3  0x00000000006b8f3b in ?? ()
    No symbol table info available.
    #4  0x00000000005aa631 in ?? ()
    No symbol table info available.
    #5  0x00007ffff79216f3 in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #6  0x00007ffff7920bbc in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #7  0x0000000000650f93 in ?? ()
    No symbol table info available.
    #8  0x00000000005aab7f in ?? ()
    No symbol table info available.
    #9  0x00007ffff79204d2 in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #10 0x0000000000650f93 in ?? ()
    No symbol table info available.
    #11 0x00000000005ac46c in ?? ()
    No symbol table info available.
    #12 0x00007ffff79204d2 in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #13 0x0000000000650f93 in ?? ()
    No symbol table info available.
    #14 0x00000000004e02a7 in ?? ()
    No symbol table info available.
    #15 0x00007ffff79204d2 in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #16 0x0000000000650f93 in ?? ()
    No symbol table info available.
    #17 0x00000000006a03c0 in ?? ()
    No symbol table info available.
    #18 0x00000000006a0fdb in ?? ()
    No symbol table info available.
    ---Type <return> to continue, or q <return> to quit---
    #19 0x00000000006a2bd1 in ?? ()
    No symbol table info available.
    #20 0x00007ffff79204d2 in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #21 0x0000000000650f93 in ?? ()
    No symbol table info available.
    #22 0x00000000006db753 in ?? ()
    No symbol table info available.
    #23 0x00000000006dc977 in ?? ()
    No symbol table info available.
    #24 0x00000000005777dc in ?? ()
    No symbol table info available.
    #25 0x00000000005796cd in ?? ()
    No symbol table info available.
    #26 0x00000000006622a2 in ?? ()
    No symbol table info available.
    #27 0x00000000005c8da3 in ?? ()
    No symbol table info available.
    #28 0x0000000000478f0f in ?? ()
    No symbol table info available.
    #29 0x00007ffff79204d2 in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #30 0x000000000055c959 in ?? ()
    No symbol table info available.
    #31 0x000000000055ccd2 in ?? ()
    No symbol table info available.
    #32 0x000000000055cee1 in ?? ()
    No symbol table info available.
    #33 0x00000000005f9c8d in ?? ()
    No symbol table info available.
    #34 0x00007ffff792067f in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #35 0x00007ffff792166e in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #36 0x00007ffff792acd2 in scm_c_with_fluid () from /usr/lib/libguile.so.17
    No symbol table info available.
    #37 0x000000000043ba03 in ?? ()
    No symbol table info available.
    ---Type <return> to continue, or q <return> to quit---
    #38 0x000000000073000e in ?? ()
    No symbol table info available.
    #39 0x00000000007447a7 in ?? ()
    No symbol table info available.
    #40 0x000000000073b503 in ?? ()
    No symbol table info available.
    #41 0x0000000000744734 in ?? ()
    No symbol table info available.
    #42 0x00007ffff792acd2 in scm_c_with_fluid () from /usr/lib/libguile.so.17
    No symbol table info available.
    #43 0x00000000006fb430 in ?? ()
    No symbol table info available.
    #44 0x0000000000460688 in ?? ()
    No symbol table info available.
    #45 0x00007ffff7922880 in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #46 0x00007ffff7920bbc in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #47 0x00007ffff79795b0 in scm_c_catch () from /usr/lib/libguile.so.17
    No symbol table info available.
    #48 0x00007ffff79796cd in scm_catch_with_pre_unwind_handler () from /usr/lib/libguile.so.17
    No symbol table info available.
    #49 0x00007ffff792067f in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #50 0x00007ffff792166e in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #51 0x00007ffff79218be in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #52 0x00007ffff7920bbc in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #53 0x00007ffff1e4c788 in scm_srfi1_for_each () from /usr/lib/libguile-srfi-srfi-1-v-3.so
    No symbol table info available.
    #54 0x00007ffff79216f3 in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #55 0x00007ffff79218be in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #56 0x00007ffff79225a4 in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    ---Type <return> to continue, or q <return> to quit---
    #57 0x00007ffff7920bbc in scm_dapply () from /usr/lib/libguile.so.17
    No symbol table info available.
    #58 0x00000000005ed211 in ?? ()
    No symbol table info available.
    #59 0x00007ffff793b96f in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #60 0x00007ffff7912d3a in ?? () from /usr/lib/libguile.so.17
    No symbol table info available.
    #61 0x00007ffff79795b0 in scm_c_catch () from /usr/lib/libguile.so.17
    No symbol table info available.
    #62 0x00007ffff7913314 in scm_i_with_continuation_barrier () from /usr/lib/libguile.so.17
    No symbol table info available.
    #63 0x00007ffff79133f0 in scm_c_with_continuation_barrier () from /usr/lib/libguile.so.17
    No symbol table info available.
    #64 0x00007ffff7977956 in scm_i_with_guile_and_parent () from /usr/lib/libguile.so.17
    No symbol table info available.
    #65 0x00007ffff793bae5 in scm_boot_guile () from /usr/lib/libguile.so.17
    No symbol table info available.
    #66 0x000000000041d4e7 in ?? ()
    No symbol table info available.
    #67 0x00007ffff59d8610 in __libc_start_main () from /usr/lib/libc.so.6
    No symbol table info available.
    #68 0x0000000000429e89 in ?? ()
    No symbol table info available.
    

    The issue has been confirmed for Linux only, in case that be important.

     
  • David Kastrup

    David Kastrup - 2015-11-03

    This is due to the lackadaisical way in which

    commit dafef223123bb629eab05e53c443c6e6d20e9481
    Author: Han-Wen Nienhuys hanwen@xs4all.nl
    Date: Mon May 22 14:06:28 2006 +0000

    * input/regression/beam-single-stem.ly: new file.
    
    * lily/stem.cc (set_beaming): use #f as signaling value for
    beamcount 0.
    
    * lily/beam-engraver.cc (typeset_beam): set right bound if unset.
    
    * lily/beam.cc (set_beaming): read clip-edges property.
    (calc_direction): don't suicide for single stem.
    
    * lily/beaming-info.cc (best_splitpoint_index): take bool*
    argument, remove 1<<15 hack. Remove clip_edges()
    
    * lily/hairpin.cc (print): only do padding for nonmusical bounds
    

    has been done. Most of the code is not prepared to "use #f as signaling value for beamcount 0". It's surprising that stuff does not break entirely much more often. I'm rather doubtful that this "design" can sensibly be made to behave consistently while retaining (or rather getting) maintainable code.

     
  • David Kastrup

    David Kastrup - 2015-11-03

    Issue 4653: French beam ending on rest causes segfault

    The issue here is that Stem::set-beaming may set one of the beaming
    segment lists to #f instead of an empty list, and not all users of
    "beaming" (in this case where_are_the_whole_beams) were prepared to
    deal with this.

    Also contains commit:

    Implement ly_memv as a sloppy memv variant

    http://codereview.appspot.com/274280043

     
  • David Kastrup

    David Kastrup - 2015-11-03
    • status: Accepted --> Started
    • assigned_to: David Kastrup
    • Needs: -->
    • Type: --> Crash
     
  • Anonymous

    Anonymous - 2015-11-04

    Passes make, make check and a full make doc

     
  • Anonymous

    Anonymous - 2015-11-04
    • Patch: new --> review
     
  • Anonymous

    Anonymous - 2015-11-07
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2015-11-07

    Patch on countdown for November 10th

     
  • Anonymous

    Anonymous - 2015-11-10
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2015-11-10

    Patch counted down - please push

     
  • David Kastrup

    David Kastrup - 2015-11-10
    • labels: --> Fixed_2_19_32
    • status: Started --> Fixed
    • Patch: push -->
     
  • David Kastrup

    David Kastrup - 2015-11-10

    Pushed to staging as
    commit 272e82d1174fdf303fcbbadc7648f75ac881ad3a
    Author: David Kastrup dak@gnu.org
    Date: Tue Nov 3 13:36:54 2015 +0100

    Issue 4653: French beam ending on rest causes segfault
    
    The issue here is that Stem::set-beaming may set one of the beaming
    segment lists to #f instead of an empty list, and not all users of
    "beaming" (in this case where_are_the_whole_beams) were prepared to
    deal with this.
    

    commit 6a7c432f7a33081e18cd4a911c459cc8c805e35d
    Author: David Kastrup dak@gnu.org
    Date: Tue Nov 3 18:22:20 2015 +0100

    Implement ly_memv as a sloppy memv variant
    
     
  • Phil Holmes

    Phil Holmes - 2015-11-26
    • status: Fixed --> Verified