lilypond-user
[Top][All Lists]
Advanced

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

Re: Lilypond bug "Exited with return code-1073741819" & workaround


From: Thomas Morley
Subject: Re: Lilypond bug "Exited with return code-1073741819" & workaround
Date: Sun, 6 Nov 2016 12:02:33 +0100

mclaren,

2016-11-06 2:28 GMT+01:00 mclaren <address@hidden>:
> This simple example crashes Lilypond.

It's not a simple example.
If you want to announce a bug provide a minimal example, as others
said already. More below.

> You wouldn't think putting
> 6 broken tuplets into a measure would make Lilypond stop working,
> but it does. To get the error
>
> Exited with return code-1073741819

This is not a LilyPond-error-code/message.

> uncomment the line
>  % \time 4918233/340340
>
> and comment the lines immediately below
>
>  \once \override Staff.TimeSignature #'stencil = ##f
>  \time 3237/224
>
>   The workaround for this Lilypond bug is to approximate the
> time signature 4918233/340340 with the smaller rational
> fraction time signature 3237/224. Apparently Lilypond can't
> deal with large time signatures.

Please, don't do unproofed statements.
How about testing with a minimal?

\version "2.18.2"

{
  \time 4918233/340340
  c'1*4918233/340340
  |
}

Works perfectly fine:

lilypond mclaren-01.ly
GNU LilyPond 2.18.2
Processing `mclaren-01.ly'
Parsing...
Interpreting music...
warning: strange time signature found: 4918233/340340
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `mclaren-01.ps'...
Converting to `./mclaren-01.pdf'...
Success: compilation successfully completed


> This makes no sense, since
> Lilypond runs on a modern computer with 64-bit integers,
> but Donald Trump is running for president, so no one
> said things would make sense.

Please, no politics on this list, it's no go.

>   To get the large time signature to print, we override
> printing the smaller rational fraction approximation
> time signature and then force printing of the large
> time signature.
>
>   Here's the Lilypond code:
>

Let's see how to create a minimal from your code to show a possible bug:

> \version "2.18.2"
>

header is not needed, delete

> \header {
>   tagline = ""  % removed
> }

paper-size is not needed, delete

> #(set-default-paper-size "a4" 'landscape)

indent is not needed, delete (I'm somewhat surprised it works at all,
not being in paper or layout)
> indent=0
>

You can delete the whole layout.
It makes no sense to always copy Score-settings to add one or two
overrides. And those overrides or not needed to show the bug at all.
Moving around engravers makes no sense as well, cause you obviously
use no different timing for the two staves.

>   \layout {
>   \context {
>       \Score
>      \override SpacingSpanner.uniform-stretching = ##t
>    }
>   % \override Score.SpacingSpanner.strict-note-spacing = ##t
>    \context {
>       \Score
>       proportionalNotationDuration = #(ly:make-moment 5/60)
>     }
>

No clue what you try to achieve here, delete

>   \context {
>     \type Engraver_group
>     % Add elements that _can_ be printed
>     \consists "Timing_translator"
>     \consists "Time_signature_engraver"
>
>     \alias "Staff"
>
>   }
>   \context {
>     \Score
>     %\accepts "TimeLine"
>
>     \override TupletNumber.text = #tuplet-number::calc-fraction-text
>     \override TupletBracket.bracket-visibility = ##t
>   }
>   \context {
>     \Staff
>     \consists "Timing_translator"
>     \consists "Default_bar_line_engraver"
>
>   }
> }
>
>
>
>
> <<
>
> % Time signature:  [2 x (9/11) + 2 x (5/8) + 2 x (11/13) +
> %  2 x (3/5) + 2 x (13/17) + 2 x (4/7) + 6 ] eighth notes =
> % 11*11*13*5*17*7 = 680680, but this can be reduced by a
> % factor of 2 because there's an 8 in the denominator and
> % 2 in the numerator.
>
>
>
>

delete treble-clef, it's the default

> \new Staff { \clef "treble"
>    % \time 4918233/340340
>
>   % This is the accurate time signature, but it crashes
>   % Lilypond. The solution? Use a rational approximation
>   % program to find the closest time signature -- 3237/224
>   % approximates 4918233/340340 to within 0.000007142857143094261
>     %\time 4918233/340340
>
>  %\once \override Staff.TimeSignature #'stencil = ##f
>   %\time 3237/224
>
>   \override Staff.TimeSignature.stencil = #ly:text-interface::print
>   \override Staff.TimeSignature.text =
>   \markup \override #'(baseline-skip . 0) \center-column \number {
>     \concat {
>       "4918233"
>
>     }
>     "340340"
>   }
>
> {
>
>
Why you copy 5 times the same?
Use repeat unfold.

Why repeating relative c'' all the time, set it once.

> \relative c''
>

You wrap this expression into {}, adding a new layer of sequential
music, delete those opening/closing brackets.

> {\tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} c8 }
>
> \relative c''
>
> { \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} c8 }
> }
> \bar "|"
> \relative c''
> {\tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} c8 }
>
> \relative c''
>
> { \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} c8 }
>
> \bar "|"
>
> \relative c''
> {\tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} c8 }
>
> \relative c''
>
> { \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} c8 }
>
> \bar "|"
>
> \relative c''
> {\tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} c8 }
>
> \relative c''
>
> { \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} c8 }
>
> \bar "|"
>
> \relative c''
> {\tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} c8 }
>
> \relative c''
>
> { \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} c8 }
>
> \bar "|"
>
>
>
> }
>
>

Same for this Staff

> \new Staff { \clef "treble"
>
>  \once \override Staff.TimeSignature #'stencil = ##f
>   \time 3237/224
>
>   \override Staff.TimeSignature.stencil = #ly:text-interface::print
>   \override Staff.TimeSignature.text =
>   \markup \override #'(baseline-skip . 0) \center-column \number {
>     \concat {
>       "4918233"
>
>     }
>     "340340"
>   }
> \relative c''
> {c8 \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} }
>
>
> \relative c''
> {c8 \tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} }
>
> \bar "|"
>
> \relative c''
> {c8 \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} }
>
>
> \relative c''
> {c8 \tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} }
>
> \bar "|"
>
> \relative c''
> {c8 \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} }
>
>
> \relative c''
> {c8 \tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} }
>
> \bar "|"
>
> \relative c''
> {c8 \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} }
>
>
> \relative c''
> {c8 \tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} }
>
> \bar "|"
>
> \relative c''
> {c8 \tuplet 11/9 {c8[ c8]}  c8 \tuplet 8/5 {c8[ c8]} c8 \tuplet 13/11
>  {c8[ c8]} }
>
> \relative c''
> {c8 \tuplet 5/3 {c8[ c8]}  c8 \tuplet 17/13 {c8[ c8]} c8
>  \tuplet 7/4 {c8[ c8]} }
>
> \bar "|"
>
> }
>
>>>

Now let's see what we've got:

\version "2.18.2"

<<
  \new Staff
    \relative c'' {
      \time 4918233/340340
      %\time 3237/224
      \repeat unfold 5 {
        \tuplet 5/3 {c8[ c8]}  c8
         \tuplet 17/13 {c8[ c8]} c8
          \tuplet 7/4 {c8[ c8]} c8


        \tuplet 11/9 {c8[ c8]}  c8
         \tuplet 8/5 {c8[ c8]} c8
          \tuplet 13/11 {c8[ c8]} c8

      \bar "|"
    }
  }

  \new Staff
    \relative c'' {
      \time 4918233/340340
      %\time 3237/224
       \repeat unfold 5 {
         c8 \tuplet 11/9 {c8[ c8]}
          c8 \tuplet 8/5 {c8[ c8]}
           c8 \tuplet 13/11 {c8[ c8]}


         c8 \tuplet 5/3 {c8[ c8]}
          c8 \tuplet 17/13 {c8[ c8]}
           c8 \tuplet 7/4 {c8[ c8]}
           \bar "|"
      }
  }
>>

More readable. Now let's apply the method described here:
http://lilypond.org/doc/v2.19/Documentation/usage/troubleshooting

Consequently done the result is:

\version "2.18.2"

{
  \time 4918233/340340
  c8
}

Which indeed crashes with 2.18.2

lilypond mclaren-01.ly
GNU LilyPond 2.18.2
Processing `mclaren-01.ly'
Parsing...
Interpreting music...
warning: strange time signature found: 4918233/340340
Segmentation fault (core dumped)

Though 2.18.2 was released March 2014, i.e. two and a half years old.

Trying the minimal with 2.19.49, (the latest devel-version), works.
As well as your original code (with \time 4918233/340340)
I tested this first. Admittedly your original code takes some minutes
to compile and uses a lot of memory on my weak laptop, but it
succeeded.


In general:
(1)
Obviously you test the limits of LilyPond, which is fine. Though, to
get an impression of the current limits I'd recommend to use the
latest devel-version, not the fairly outdated 2.18.2.

(2)
Also, you seem to test the patience of our community, which is bad.
It took me 3h to boil down your code to a minimal, which is _your_
duty, not mine, testing code and writing this mail.

You want help from us.
Blowing up your code by just copying the same things over and over,
forces everyone to compare each line with the others again and again,
and it's so easy to prevent.
All those other superfluos stuff in it...

It's wasting my time.

Your comments about politics are a no go on this list.

Confusing names will not increase the motivation to help you.

Your comments about LilyPond-Docs (in another thread) are strange.
I never understood those people saying: "I didn't understand the Docs,
_ergo_ the documentation is bad"
Don't you think another conclusion may be thinkable?

Please, read:
http://www.catb.org/~esr/faqs/smart-questions.html

Now I've wasted a lot of hours on this, I've no time left to look into
any of your other posts.

-Harm



reply via email to

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