Re: 3 SAOL questions, was Re: [linux-audio-user] What's up with SAOL?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: 3 SAOL questions, was Re: [linux-audio-user] What's up with SAOL?
From: John Lazzaro (lazzaro_AT_CS.Berkeley.EDU)
Date: Tue Jan 22 2002 - 23:18:41 EET


> Paul Winkler <pw_lists_AT_slinkp.com> writes:
>
> 3. Any idea why the attached saol/sasl compiles but segfaults

Yes :-). The default options for sfront are non-compliant with the
standard, in that array and table bounds are not checked -- so,
rather than get a nice error message telling you you overstepped
a table, you get the sort of error message C gives you (Segmentation
Error: Core Dumped :-). I've been holding off making bounds checking
the default until I get a chance to read up on the Java lore for doing
fast bounds checking.

However, if you're happy with slow runtimes, you can get full error
checking today with sfront, use the -O0 option -- mostly handy for
tracking down core dumps of this nature. For the example you posted:

sfront -O0 -aout output.wav -orc sine.saol -sco sine.sasl
sfront, a SAOL to C translator. Version --IDSTRING--.
Run sfront with -license option for Copyright/License info.

gcc -O3 sa.c -lm -o sa
./sa

Runtime Error.
Location: File sine.saol near line 65.
While executing: tableread.
Potential problem: Tableread index out of range.
Exiting program.

There's actually a set of -O options that turn off different types
of optimization (the default is full optimization), see:

http://www.cs.berkeley.edu/~lazzaro/sa/sfman/user/cmdline/index.html#optoptions

for the full list; in practice -O0 is the easiest way to catch these
sorts of bugs, though ...

Hope this helps ...

-------------------------------------------------------------------------
John Lazzaro -- Research Specialist -- CS Division -- EECS -- UC Berkeley
lazzaro [at] cs [dot] berkeley [dot] edu www.cs.berkeley.edu/~lazzaro
-------------------------------------------------------------------------


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Jan 22 2002 - 23:10:40 EET