[CM] Grace segfaults while reading from a file

Sergey cmdist at nospam.frostglow.com
Mon Sep 24 14:42:19 PDT 2012

Curiously, this works fine (well, it's slow, but at least it doesn't


So it seems that it's only printing during the loop that segfaults.


On Sun, Sep 23, 2012 at 04:25:07PM -0400, Sergey wrote:
> Seeing that neither Common Music nor s7 have any built-in procedures for
> reading in a file as a list of characters, nor as a list of strings, nor
> as a single string, I set out to write these procedures myself.
> While trying to write the first of these, I came up with this
> (incomplete) code:
>   http://pastie.org/4787162
> When the file "foo.txt" contains only the single word "test", executing
> line 10 in Grace works -- each of the individual characters is printed.
> It also works with one longer line of characters, and two lines.
> But, at some point, when the file grows to a certain size or there
> are enough characters or lines in the file, Grace segfaults.
> Here is a sample 501-line, 32565-character file that causes Grace to
> segfault on my system:
>   http://pastie.org/4787221
> Unfortunately, it seems that the Grace binary was stripped during the
> build process, so I am unable to get a useful backtrace.  This is the
> best I can get:
>   http://pastie.org/4787240
> Here is the last bit of an strace:
>   http://pastie.org/4787257
>   --Sergey

More information about the Cmdist mailing list