[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Crashes on malformed music
From: |
David Kastrup |
Subject: |
Re: Crashes on malformed music |
Date: |
Mon, 20 Jan 2014 22:32:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Devon Schudy <address@hidden> 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