Originally created by: *anonymous
Originally created by: v.villenave
The following code (which basically amounts to what showLastLength does, as inspired by issue 1173) produces a segfault:
\version "2.13.36"
<<
{
\time 3/4
\set Score.skipBars = ##t
% permuting the two following lines fixes the problem.
a4 a a
[r2].*2
}
\\
{
\set Score.skipTypesetting = ##t
s2. s4
\set Score.skipTypesetting = ##f
}
>>
This looks like a serious problem, and probably requires to modify the Timing translator (possibly introducing a new property) or the Score engraver.
Originally posted by: n.putt...@gmail.com
Heh, crash.ly crashes even without my patch:
Interpreting music...
Preprocessing graphical objects...
programming error: didn't find a vertical alignment in this system
programming error: didn't find a vertical alignment in this system
programming error: didn't find a vertical alignment in this system
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
programming error: didn't find a vertical alignment in this system
programming error: didn't find a vertical alignment in this system
programming error: didn't find a vertical alignment in this system
programming error: system with empty extent
programming error: didn't find a vertical alignment in this system/home/neil/lilypond/out/share/lilypond/current/scm/page.scm:243:68: In procedure - in expression (- 0 y ...):
/home/neil/lilypond/out/share/lilypond/current/scm/page.scm:243:68: Wrong type: ()
Originally posted by: v.villenave
Yes, that's been a known-but-undocumented limitation (at least to me) for several years now.
I think the way to go is to merge your patch anyway, and possibly open a new issue about that. (Non-Critical, by all means.)
Until then, if anything, I'm able to modify my skip-as-needed function in music-functions.scm to make sure that the segfault doesn't happen when using showLastLength or showFirstLength.
The ideal thing to do, of course, would be to exit cleanly with a "no music in this score" message. But I suspect it's beyond my abilities.
Originally posted by: n.putt...@gmail.com
> Yes, that's been a known-but-undocumented limitation (at least to me) for several years now.
Shall we fix the crash then? :) Even if we can't find a way of squelching the programming errors, getting rid of the `Wrong type' error should be easy.
> I think the way to go is to merge your patch anyway, and possibly open a new issue about that. (Non-Critical, by all means.)
It's trading one critical bug for another. I'd rather put the patch on hold if I can't find a way around this.
Originally posted by: percival.music.ca@gmail.com
As long as your patch passes the regtests, I'd so go for it.
I just tried compiling the regtests with your patch + the one below, and nothing crashed. I didn't do an actual regtest *comparison*, so it's possible that my patch makes something stop working. If any unskilled programmer has some time, it would be great if they could do a regtest comparison between current git master and master+Neil's patch + this patch.
diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc
index 9cdf664..e320c30 100644
--- a/lily/simple-spacer.cc
+++ b/lily/simple-spacer.cc
@@ -393,6 +393,11 @@ vector<Real>
get_line_forces (vector<Grob*> const &columns,
Real line_len, Real indent, bool ragged)
{
+ if (columns.size() < 2) {
+ printf("whoops, time to bail\n");
+ printf("Not enough music in score.\n");
+ exit(0);
+ }
vector<vsize> breaks;
vector<Real> force;
vector<Grob*> non_loose;
Originally posted by: Carl.D.S...@gmail.com
I've put together Neil's patch, together with Graham's patch (modifed to use the lilypond error call).
Everything seems fine.
I'll post it on Rietveld.
diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc
index 33690e3..764937c 100644
--- a/lily/paper-column-engraver.cc
+++ b/lily/paper-column-engraver.cc
@@ -199,6 +199,8 @@ Paper_column_engraver::process_music ()
void
Paper_column_engraver::stop_translation_timestep ()
{
+ if (to_boolean (get_property ("skipTypesetting")))
+ return;
SCM m = now_mom ().smobbed_copy ();
command_column_->set_property ("when", m);
musical_column_->set_property ("when", m);
@@ -267,7 +269,7 @@ Paper_column_engraver::start_translation_timestep ()
/*
TODO: don't make columns when skipTypesetting is true.
*/
- if (!first_)
+ if (!first_ && !to_boolean (get_property ("skipTypesetting")))
make_columns ();
}
diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc
index 9cdf664..f9d9cd2 100644
--- a/lily/simple-spacer.cc
+++ b/lily/simple-spacer.cc
@@ -245,7 +245,7 @@ Simple_spacer::compress_line ()
assert (fabs (configuration_length (cur_force) - cur_len) < 1e-6);
return cur_force;
}
-
+
cur_len -= block_dist;
inv_hooke -= compressed ? sp.inverse_compress_strength () : sp.inverse_stretch_strength ();
cur_force = sp.blocking_force ();
@@ -381,7 +381,7 @@ get_column_description (vector<Grob*> const &cols, vsize col_index, bool line_st
description.end_rods_.push_back (Rod_description (j, scm_to_double (scm_cdar (s))));
}
}
-
+
if (!line_starter && to_boolean (col->get_property ("keep-inside-line")))
description.keep_inside_line_ = col->extent (col, X_AXIS);
@@ -393,6 +393,8 @@ vector<Real>
get_line_forces (vector<Grob*> const &columns,
Real line_len, Real indent, bool ragged)
{
+ if (columns.size () < 2)
+ error (_ ("no music remaining to typeset"));
vector<vsize> breaks;
vector<Real> force;
vector<Grob*> non_loose;
Originally posted by: nez...@gmail.com
http://codereview.appspot.com/3594041/
Labels: Patch
Originally posted by: percival.music.ca@gmail.com
I've pushed Neil's patch. Thanks so much to him and Carl for fixing this!
Labels: fixed_2_13_43
Status: Fixed
Originally posted by: Carl.D.S...@gmail.com
Verified, and regression tests pushed. Regtests are not part of .43, but fix is.
Status: Verified