I have traced a floating point exception to the occurance of a slur
that spans two lines.  I know this used to work, so there might be a
new bug here.

Details:
  GNU LilyPond 1.1.37.
  FreeBSD 3.1
  egcs-1.1.1 release

Quick fix (hopefully a real bug fix will be considered for a later
version of lilypond):

Offset
complex_multiply (Offset z1, Offset z2)
{
  Offset z;
  if(!isinf(z2[Y_AXIS]))
  {
      z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS]*z2[Y_AXIS];
      z[Y_AXIS] = z1[X_AXIS] * z2[Y_AXIS] + z1[Y_AXIS] * z2[X_AXIS];
  }
  return z;
}

This just checks to see if the z2 argument is infinity, and if it is,
don't do the multiply.  Pretty naive, but at least the compile
finishes.

Here's a few levels of stack trace.  Notice the -Inf value of the z2
argument. 

Program received signal SIGFPE, Arithmetic exception.
0x81631da in complex_multiply (z1={coordinate_a_ = {1, 0}}, z2={
      coordinate_a_ = {-28.740801907348626, -Inf}}) at offset.cc:31
(gdb) up
#1  0x8071f15 in Curve::rotate (this=0xefbfd3b0, phi=0) at
bezier.cc:56
(gdb) 
#2  0x807573a in Bezier_bow::transform (this=0xefbfd394) at
bezier.cc:549
(gdb) down
#1  0x8071f15 in Curve::rotate (this=0xefbfd3b0, phi=0) at
bezier.cc:56
(gdb) 
#0  0x81631da in complex_multiply (z1={coordinate_a_ = {1, 0}}, z2={
      coordinate_a_ = {-28.740801907348626, -Inf}}) at offset.cc:31
(gdb) where
#0  0x81631da in complex_multiply (z1={coordinate_a_ = {1, 0}}, z2={
      coordinate_a_ = {-28.740801907348626, -Inf}}) at offset.cc:31
#1  0x8071f15 in Curve::rotate (this=0xefbfd3b0, phi=0) at
bezier.cc:56
#2  0x807573a in Bezier_bow::transform (this=0xefbfd394) at
bezier.cc:549
#3  0x80735aa in Bezier_bow::calc (this=0xefbfd394) at bezier.cc:243
#4  0x8076bed in Bow::get_controls (this=0x83f5a00) at bow.cc:91
#5  0x8076ad4 in Bow::do_height (this=0x83f5a00) at bow.cc:76
#6  0x80f9aa6 in Score_element::dim_cache_callback (c=0x83f5a80)
    at score-element.cc:33

-- 
John Galbraith                    email: [EMAIL PROTECTED]
University of Arizona,            home phone: (520) 327-6074
Los Alamos National Laboratory    work phone: (520) 626-6277
                                  home page: www.ece.arizona.edu:/~john

"As had been true historically, Gates' concern was not making great
 products, but keeping the world locked into using his products."
    --- Wendy Goldman Rohm, The Microsoft File

Reply via email to