lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request for a warning if set is misused


From: Colin Hall
Subject: Re: Feature request for a warning if set is misused
Date: Tue, 18 Dec 2012 01:06:05 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Dec 17, 2012 at 05:21:05AM -0800, Eluze wrote:
> Colin Hall-3 wrote
> > OK, it looks like I have misunderstood the intention of your original
> > bug report, Eluze.
> > 
> > Please specify the circumstances under which you would like to see a
> > warning.
> 
> ok, I'll try to be more precise:
> 
> with the code (admittedly wrong) 
> 
>   {  \set Fingering = #'(up)  g1 -1 } 
> 
> LilyPond stops working and the log only says:
> 
> GNU LilyPond 2.17.8 
> Processing `test.ly' 
> Parsing... 
> Interpreting music...

I just tried reproducing the behaviour and on my system. I see the
output you describe followed by a report of a segmentation fault and
core dump. It's a crash, as you said in your original bug report.

You have made it clear that you were knowingly mis-using the Fingering
object. I'm not familiar with the Fingering object so I went and
looked it up. There's some quite detailed documentation in the
Internals Reference:

http://www.lilypond.org/doc/v2.17/Documentation/notation/layout-interfaces

If you scroll to the bottom of that section you can see that Fingering
is defined as a complicated Lisp object:

(Fingering
  . ((padding . 0.5)
     (avoid-slur . around)
     (slur-padding . 0.2)
     (staff-padding . 0.5)
     (self-alignment-X . 0)
     (self-alignment-Y . 0)
     (script-priority . 100)
     (stencil . ,ly:text-interface::print)
     (direction . ,ly:script-interface::calc-direction)
     (font-encoding . fetaText)
     (font-size . -5)           ; don't overlap when next to heads.
     (meta . ((class . Item)
     (interfaces . (finger-interface
                    font-interface
                    text-script-interface
                    text-interface
                    side-position-interface
                    self-alignment-interface
                    item-interface))))))

So when you put this in your source file:

\set Fingering = #'(up)

you are replacing a large, complicated structure with something
utterly different. If this badly mangled structure is not used, as you
discovered, nothing bad happens. If it is used, a crash occurs. I
would imagine that the crash happens when that Lisp structure is
passed across the Lisp/C boundary.

Lilypond does report line numbers where it detects errors in the
source. I guess you are hoping for something similar for crashes,
also.

I don't know, but I suspect that the crash we witness occurs
long after the correspondence between source line and the
Finger-structure-mangling has been lost.

This sounds pretty fundamental to me and I'm really not sure it's
feasible without a big redesign.

As I think I said before, I suspect this is the down side of the
wonderful flexibility of Lilypond that allows you to \set anthing to
be anything you like, without contraint.

> if it's not possible to locate/identify the error causing command a simple
> message like "LilyPond stopped working" or "LilyPond ended abnormally" plus
> a "normal" termination would be better than nothing.

The trouble is that a segmentation fault means that Lilypond has been
terminated by the operating system, and not by software that is part
of Lilypond. So no, I don't think even a simple helpful message is
possible. There may be operating system services to do this, but I am
not aware of them.

Cheers,
Colin.

-- 

Colin Hall



reply via email to

[Prev in Thread] Current Thread [Next in Thread]