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

Re: [sc-dev] [Linux] Cause of segfault?

Hi, James

On Sun, 14 Dec 2003 10:01:57 -0800, James McCartney <asynth@xxxxxx> wrote:

The file format for synthdefs is supposed to be big endian. So scsynth is doing it right.
The problem I'd guess is that SClang file routines write native endian.
Before making any changes I decided to see if CVS had been updated in the meantime, and indeed it had. Thanks! But I noticed some funny parameter values, and tracked it down to writeFloat_be in headers/lang/ReadWriteMacros.h. There's a preprocessor check if BIG_ENDIAN is defined, which it is, so floats get written in native byte order. This can't be right can it?

On Dec 14, 2003, at 8:29 AM, Arve Knudsen wrote:

Hi list, first post :)

I find that scsynth segfaults within GraphDef_Read, due to what looks like reading beyond the input buffer. What's the cause of this, I'm not really intimate with the code yet, but it looks like variables are being read in big endian order? I'm on x86, so could be a likely explanation. Anyway, this is the source of the problem with synth definitions right (having to delete synthdefs/*)? From what I can see there exists functions for reading bytes in little endian order, how come these aren't being used?

Best regards

Arve Knudsen