Segfault with voice and empty music

2015-03-13 Thread Roman Stawski

Hi folks

I've noticed the following problem in 2.19.16 after updating from 2.19.11.

When the code below compiles I get the error
"warning: cannot find Voice `refrain"
and then the  compilation segfaults.

If I comment out the line marked "NOT OK" then the compilation
and the output are fine.

It seems that the empty music and the voices don't play well
together inside the inner double brackets. Any ideas, anyone?

(Duh: The reason that I'm generating empty music is that I'm
 conditionally inserting other lyrics in the real piece.)

Roman

 Problem code follows

\version "2.19.16"

<<
  \new Staff {
\new Voice = "couplet" \relative c' { \voiceOne c2 }
\new Voice = "refrain" \relative c' { \voiceOne c2 }
  }

  #(make-music 'Music)  %% OK
  \tag #'optional <<
#(make-music 'Music) %% NOT OK
\new Lyrics \lyricsto "couplet" { Foo }
\new Lyrics \lyricsto "refrain" { Bar }
  >>
  #(make-music 'Music)  %% OK
>>



___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Segfault with voice and empty music

2015-03-13 Thread David Kastrup
Roman Stawski  writes:

> Hi folks
>
> I've noticed the following problem in 2.19.16 after updating from 2.19.11.
>
> When the code below compiles I get the error
> "warning: cannot find Voice `refrain"
> and then the  compilation segfaults.

Which is not something we want to see.

> It seems that the empty music and the voices don't play well
> together inside the inner double brackets. Any ideas, anyone?

This is very likely the fix to issues 2010, 1551, 702
https://code.google.com/p/lilypond/issues/detail?id=2010>. After
this fix, putting synchronized music and independent non-synchronized
music of different length at the same level will likely cause trouble.

A segfault, however, is more trouble than permissible.

> (Duh: The reason that I'm generating empty music is that I'm
>  conditionally inserting other lyrics in the real piece.)

Possibly making this a skip may help?  Not really sure.

> Roman
>
>  Problem code follows
>
> \version "2.19.16"
>
> <<
>   \new Staff {
> \new Voice = "couplet" \relative c' { \voiceOne c2 }
> \new Voice = "refrain" \relative c' { \voiceOne c2 }
>   }
>
>   #(make-music 'Music)  %% OK
>   \tag #'optional <<
> #(make-music 'Music) %% NOT OK
> \new Lyrics \lyricsto "couplet" { Foo }
> \new Lyrics \lyricsto "refrain" { Bar }
>   >>
>   #(make-music 'Music)  %% OK
>>>

Backtrace is

#0  is_alias (sym=0xb67b20d0, this=0x0) at context.cc:514
#1  find_context_below (where=0x0, type=0xb67b20d0, id="refrain")
at context.cc:594
#2  0x080f66ce in Lyric_combine_music_iterator::find_voice (this=0x87816d0)
at lyric-combine-music-iterator.cc:275
#3  0x080f6d1e in check_new_context (this=0x87816d0)
at lyric-combine-music-iterator.cc:239
#4  Lyric_combine_music_iterator::check_new_context_callback (self=0x87816d0, 
ev=0xb7289f90) at lyric-combine-music-iterator.cc:230
#5  0x0810757f in dispatch (sev=0xb7289f90, this=)
at dispatcher.cc:147
#6  Dispatcher::dispatch_callback (self=0x8749240, ev=0xb7289f90)
at dispatcher.cc:75
#7  0x0810757f in dispatch (sev=0xb7289f90, this=)
at dispatcher.cc:147
#8  Dispatcher::dispatch_callback (self=0x8631050, ev=0xb7289f90)
at dispatcher.cc:75
#9  0x0810757f in dispatch (sev=0xb7289f90, this=)
at dispatcher.cc:147
#10 Dispatcher::dispatch_callback (self=0x8776cd8, ev=0xb7289f90)
at dispatcher.cc:75
#11 0x08107b3f in dispatch (sev=, this=0x8776398)
at dispatcher.cc:147
#12 Dispatcher::broadcast (this=0x8776398, ev=0x8786f98) at dispatcher.cc:203
#13 0x081036e5 in Context::internal_send_stream_event (this=0x8776508, 
type=0xb6813670, origin=0x0, props=0xbfffc700) at context.cc:505
#14 0x081039a2 in Context::create_context (this=0x8776508, cdef=0x87281c8, 
id="refrain", ops=0x404) at context.cc:370
#15 0x081045e3 in Context::create_unique_context (this=0x8776508, 
name=0xb67b20d0, id="refrain", operations=0x404) at context.cc:128
#16 0x081047ee in Context::create_unique_context (this=0x8777e88, 
name=0xb67b20d0, id="refrain", operations=0x404) at context.cc:140
#17 0x0828565b in Context_specced_music_iterator::construct_children (
this=0x8786e08) at context-specced-music-iterator.cc:45
#18 0x08100869 in Music_iterator::get_iterator (this=0x8777838, m=0x87460c0)
at music-iterator.cc:153
#19 0x08072d14 in Sequential_iterator::next_element (this=0x8777838)
at sequential-iterator.cc:198
#20 0x080729ab in Sequential_iterator::process (this=0x8777838, until=...)
at sequential-iterator.cc:234
#21 0x0819e756 in Music_wrapper_iterator::process (this=0x86302a0, m=...)
at music-wrapper-iterator.cc:70
#22 0x0833bd64 in Simultaneous_music_iterator::process (this=0x8749360, 
until=...) at simultaneous-music-iterator.cc:98
#23 0x08130c0a in Global_context::run_iterator_on_me (this=0x8748d78, 
iter=0x8749360) at global-context.cc:170
#24 0x082c205a in ly_interpret_music_expression (mus=0xb719b2e8, 
ctx=0xb7228598) at global-context-scheme.cc:118
#25 0x082c24ab in ly_run_translator (mus=0xb719b2e8, output_def=0xb7204dd8)
at global-context-scheme.cc:145
#26 0x0821b055 in Score::book_rendering (this=0x8747e48, layoutbook=0x8748018, 
default_def=0x8734cc0) at score.cc:141

and the rest is not really interesting.

-- 
David Kastrup

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond