Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(120)

Issue 7377057: Issue 3205: opening bar check causes crash if \score contains the \midi block (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by dak
Modified:
11 years, 1 month ago
Reviewers:
Keith
CC:
lilypond-devel_gnu.org, hanwenn
Visibility:
Public.

Description

Issue 3205: opening bar check causes crash if \score contains the \midi block This derives Bar_check_iterator from Music_iterator rather than from Simple_music_iterator. In \score { { | d } \midi { } } the bar check iterator is being called while only the \Global context exists. That causes Score_performer::one_time_step to be called without getting Score_performer::prepare to be called previously, probably because the Score context is created at the wrong time. The Score_performer is not prepared for this situation. I have no idea how to fix Simple_music_iterator, why it exists in the first place and is written like it is, and why this appears to work.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M lily/bar-check-iterator.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 2
Keith
I tried skipTypesetting and showFirstLength in different situations. They seem to work. It would be ...
11 years, 2 months ago (2013-02-27 07:07:58 UTC) #1
dak
11 years, 2 months ago (2013-02-27 08:28:51 UTC) #2
On 2013/02/27 07:07:58, Keith wrote:
> I tried skipTypesetting and showFirstLength in different situations.  They
seem
> to work.
> 
> It would be nice to know at least /how/ this change causes 
> Score_performer::prepare() to be called.
> 
> On the other hand, it seems that the bar-check-iterator should not have caused
> Score_performer::one_time_step() to be called at all.

It is not the bar-check-iterator that calls one_time_step as you can see by
leaving off the note.  But the bar-check-iterator causes
Score_performer::prepare to be missed.

The code in score-performer.cc (as well as score-engraver.cc except that the
latter does not mind missing prepare all that much) registers listeners for
Prepare and OneTimeStep _when_ the Score context is created.

A mere \context Score { | d } is already enough to prevent the segfault.  But if
you start right with | without a score context, Prepare and OneTimeStep only get
registered once d turns up, and it would appear that the Prepare event has gone
by that time and is no longer seen by the listener.

I have no clue what makes the standard Music_iterator different here.  The only
other use of Simple_music_iterator is with \partial, and \partial wraps its
music event in (descend-to-context ... and thus is impervious to this problem
(the raw music event in itself will likely crash LilyPond equally well).

I have no idea what Simple_music_iterator is for.  Possibly for getting
triggered at most once per time step, but then it should likely be possible to
get this effect without needing to actually compare moments.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b