[squeak-dev] Homing in on FreeBSD vm build error

Gary Dunn garydunnhi at gmail.com
Thu Mar 31 01:25:11 UTC 2011


The "missing" error function is in sqUnixX11.c, line 3076. It and the
vicinity look like this:

/* The remainder of color table defines a color cube with six steps
     for each primary color. Note that the corners of this cube repeat
     previous colors, but simplifies the mapping between RGB colors and
     color map indices. This color cube spans indices 40 through 255.
     */
  {
    int r, g, b;

    for (r= 0; r < 6; r++)
      for (g= 0; g < 6; g++)
        for (b= 0; b < 6; b++)
          {
            int i= 40 + ((36 * r) + (6 * b) + g);
            if (i > 255) error("index out of range in color table
compuation"); <<<<<<< line 3076
            initColourmap(i, (r * 65535) / 5, (g * 65535) / 5, (b * 65535) / 5);
          }
  }

Every other error function call in that source file uses perror, so I
changed this one and recompiled. Again the vm hung, just like when I
used the define.

I checked the logic with my fingers and with maximum values of r, g
and b i will be 255, so the limit test should never succeed. But it
must be, to be triggering that function. Is one of these variables
getting whacked? I could hack in a print to stderr to show the values
through the loop ... I'll wait to hear from the experts.

I checked man 3 perror and it looks reasonable.

     The perror() function finds the error message corresponding to the cur-
     rent value of the global variable errno (intro(2)) and writes it, fol-
     lowed by a newline, to the standard error file descriptor.  If the argu-
     ment string is non-NULL and does not point to the null character, this
     string is prepended to the message string and separated from it by a
     colon and space (``: ''); otherwise, only the error message string is
     printed.

However, in this case errno may not be set because this is not a
system error. The man entry is not clear what happens in that case.

But I could be way off the path here!
-- 
Gary Dunn
Honolulu



More information about the Squeak-dev mailing list