Devon Schudy <[email protected]> writes:

> There are a lot of places where Lilypond assumes music expressions
> (and other Scheme values) are of the right type, and unsmobs them
> without checking for null. This means it's easy to crash Lilypond by
> making invalid music. For example, this segfaults in
> Music_iterator::get_iterator (because
> Lyric_combine_music_iterator::construct_children passes it null):
>
> \score {
>   <<
>     \new Staff = "A" { c' }
>     #(make-music 'ContextSpeccedMusic
>         'create-new #t
>         'context-type 'Lyrics
>         'element (make-music 'LyricCombineMusic
>                   'associated-context "A"
>                   'element #f))
>   >>
> }
>
> Is this something to bother fixing? There are lots of ways to crash
> Lilypond with Scheme, but fixing at least the common ones would save
> some frustration.

I think it might be worth replacing the crash with a fatal error
pointing to the source music expression.

Probably using something like
unsmob_music_or_die (SCM music, Music *parent)
and possibly some other second arguments pinpointing the source location
of one finds oneself using this too often.  Perhaps some more
identifying info?

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to