bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: merge-rests.ily w/ text on full measure rest segfault 2.13.53 (and f


From: Neil Puttock
Subject: Re: merge-rests.ily w/ text on full measure rest segfault 2.13.53 (and from git)
Date: Wed, 16 Mar 2011 14:28:49 +0000

On 12 March 2011 23:37, Jay Anderson <address@hidden> wrote:
> This uses merge-rests.ily which is included with issue 1228
> (http://code.google.com/p/lilypond/issues/detail?id=1228). I'm running
> ubuntu x86-64 linux (2.6.35-22-generic). Below is a minimal example.
> Two things make the segfault go away: remove the mergeRests from the
> layout block and removing the markup from the full measure rest. I
> hope this is clearer and easier to reproduce than the last
> segmentation fault bug I submitted. Thanks for the help!

The `merge-multi-measure-rest-on-Y-offset' callback suicides one of
the full-bar rests, which is a bad idea when there's another object
(in this case, a MultiMeasureRestText) which relies on the rest as its
Y-parent for positioning.  The quickest workaround is to make the rest
transparent (though this obviously doesn't deal with duplicated texts
stacking up; if you need something more intelligent, a scheme engraver
checking for different texts before moving them to the visible rest
would be better).

#(define merge-multi-measure-rest-on-Y-offset
  ;; Call this to get the 'Y-offset of a MultiMeasureRest.
  ;; It keeps track of other MultiMeasureRests in the same NonMusicalPaperColumn
  ;; and StaffSymbol. If two are found, delete one and return 0 for Y-offset of
  ;; the other one.
  (let ((table (make-weak-key-hash-table)))
    (lambda (grob)
      (let* ((ssymb (ly:grob-object grob 'staff-symbol))
             (nmcol (ly:grob-parent grob X))
             (ssymb-hash (begin
               (if (not (hash-ref table ssymb))
                   (hash-set! table ssymb (make-hash-table 1)))
               (hash-ref table ssymb)))
             (othergrob (hash-ref ssymb-hash nmcol)))
            (if (ly:grob? othergrob)
              (begin
                ;; Make merged rest transparent instead of suiciding
                ;; in case it supports text/counter
                (set! (ly:grob-property othergrob 'transparent) #t)
                (hash-remove! ssymb-hash nmcol)
                0)
              (begin
                ;; Just save this grob and return the default value
                (hash-set! ssymb-hash nmcol grob)
                (ly:staff-symbol-referencer::callback grob)))))))

Cheers,
Neil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]