[CM] Grace segfaults while reading from a file

Sergey cmdist at nospam.frostglow.com
Sun Sep 23 13:25:07 PDT 2012

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:


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:


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:


Here is the last bit of an strace:



More information about the Cmdist mailing list