Csound Csound-dev Csound-tekno Search About

[Cs-dev] Csound crash-FLTK and ftgen

Date2005-07-15 17:32
FromAndres Cabrera
Subject[Cs-dev] Csound crash-FLTK and ftgen
Attachmentsvoc.csd  
Hi,
I'm trying some stuff and csound is crashing on me. It seems related to
the amount of ftgens used. If I use none, the csd runs OK, as soon as I
start adding, it gets worse, until the segmentation fault occurs before
the fltk window is created.
gdb gives the following stack trace:
#0  0x45c2b134 in _int_malloc () from /lib/tls/libc.so.6
#1  0x45c2a25d in malloc () from /lib/tls/libc.so.6
#2  0x420b475f in XListFonts () from /usr/X11R6/lib/libX11.so.6
#3  0xb7fd4069 in find () from /usr/local/lib/libfltk.so.1.1
#4  0xb7fd40f1 in fl_font () from /usr/local/lib/libfltk.so.1.1
#5  0xb7faafad in Fl_Input_::setfont () from
/usr/local/lib/libfltk.so.1.1
#6  0xb7fab0ca in Fl_Input_::drawtext () from
/usr/local/lib/libfltk.so.1.1
#7  0xb7faa035 in Fl_Input::draw () from /usr/local/lib/libfltk.so.1.1
#8  0xb7fa1b81 in Fl_Group::draw_child () from
/usr/local/lib/libfltk.so.1.1
#9  0xb7fa1a1f in Fl_Group::draw_children () from
/usr/local/lib/libfltk.so.1.1
#10 0xb7fa1a91 in Fl_Group::draw () from /usr/local/lib/libfltk.so.1.1
#11 0xb7fc7b4f in Fl_Window::draw () from /usr/local/lib/libfltk.so.1.1
#12 0xb7f8fbbb in Fl_Window::flush () from /usr/local/lib/libfltk.so.1.1
#13 0xb7f8ea4d in Fl::flush () from /usr/local/lib/libfltk.so.1.1
#14 0xb7f8e6a1 in Fl::wait () from /usr/local/lib/libfltk.so.1.1
#15 0xb7e3ad72 in fltkRun (userdata=0x80e5290) at InOut/widgets.cpp:1754
#16 0x45e0498c in start_thread () from /lib/tls/libpthread.so.0
#17 0x45c857da in clone () from /lib/tls/libc.so.6

Sometimes the crash is so bad, X just quits... Any ideas?
Cheers,
Andres


Date2005-07-15 19:33
FromIstvan Varga
SubjectRe: [Cs-dev] Csound crash-FLTK and ftgen
Actually, the bug is in GEN20, particularly in the case of the
sinc window (but other window types are also suspect, just do not
seem to trigger the crash in this example).
Running with valgrind --tool=memcheck shows an obvious write past
the end of allocated memory in fgens.c at line 915, and commenting
out the last ftgen statement also makes the crash go away.
The memory error is caused by the use of floating point data types
as loop iterator, and the loop may run more times than expected
due to round-off errors.

Andres Cabrera wrote:

> gigrainshp1 ftgen 0,1, igrainshpprec, 20, 6, 1  ;gaussian
> gigrainshp2 ftgen 0,1, igrainshpprec, 20, 1, 1  ;hamming
> gigrainshp3 ftgen 0,1, igrainshpprec, 20, 2, 1  ;hanning
> gigrainshp4 ftgen 0,1, igrainshpprec, 20, 3, 1  ;bartlett (triangle)
> gigrainshp5 ftgen 0,1, igrainshpprec, 20, 4, 1  ;blackman
> gigrainshp6 ftgen 0,1, igrainshpprec, 20, 5, 1  ;blakcman-harris
> gigrainshp7 ftgen 0,1, igrainshpprec, -20, 9, 0.75  ;sync


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-07-16 00:02
FromAndres Cabrera
SubjectRe: [Cs-dev] Csound crash-FLTK and ftgen
Istvan,
You're right, I don't know how I got the impression that the other
tables also caused crashes, but only when moving the sliders. It's not
happening now...
Thanks, I'll stay away from the sync function for now...

Andrés

On Fri, 2005-07-15 at 13:33, Istvan Varga wrote:
> Actually, the bug is in GEN20, particularly in the case of the
> sinc window (but other window types are also suspect, just do not
> seem to trigger the crash in this example).
> Running with valgrind --tool=memcheck shows an obvious write past
> the end of allocated memory in fgens.c at line 915, and commenting
> out the last ftgen statement also makes the crash go away.
> The memory error is caused by the use of floating point data types
> as loop iterator, and the loop may run more times than expected
> due to round-off errors.
> 
> Andres Cabrera wrote:
> 
> > gigrainshp1 ftgen 0,1, igrainshpprec, 20, 6, 1  ;gaussian
> > gigrainshp2 ftgen 0,1, igrainshpprec, 20, 1, 1  ;hamming
> > gigrainshp3 ftgen 0,1, igrainshpprec, 20, 2, 1  ;hanning
> > gigrainshp4 ftgen 0,1, igrainshpprec, 20, 3, 1  ;bartlett (triangle)
> > gigrainshp5 ftgen 0,1, igrainshpprec, 20, 4, 1  ;blackman
> > gigrainshp6 ftgen 0,1, igrainshpprec, 20, 5, 1  ;blakcman-harris
> > gigrainshp7 ftgen 0,1, igrainshpprec, -20, 9, 0.75  ;sync
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> 



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-07-16 05:43
FromDavid Akbari
SubjectRe: [Cs-dev] Csound crash-FLTK and ftgen
On Jul 15, 2005, at 7:02 PM, Andres Cabrera wrote:

> Thanks, I'll stay away from the sync function for now...
>

But it sounds so good!!

I say use your favorite flavor of Csound 4 distribution to render a 
cycle of the sync function as audio and do table lookup!

Gotta have the sync!!!


-David



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-07-16 11:16
FromIstvan Varga
SubjectRe: [Cs-dev] Csound crash-FLTK and ftgen
David Akbari wrote:

> I say use your favorite flavor of Csound 4 distribution to render a 
> cycle of the sync function as audio and do table lookup!
> 
> Gotta have the sync!!!

I am afraid that GEN20 in Csound 4 most probably has the exact same bug
(and it is there for a long time). On the other hand, I have already
fixed it in Csound 5, so there is no longer a reason to avoid GEN 20 or
trying other versions of Csound.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-07-16 13:53
FromAndres Cabrera
SubjectRe: [Cs-dev] Csound crash-FLTK and ftgen
Thanks Istvan, you are too quick!

Andrés

On Sat, 2005-07-16 at 05:16, Istvan Varga wrote:
> David Akbari wrote:
> 
> > I say use your favorite flavor of Csound 4 distribution to render a 
> > cycle of the sync function as audio and do table lookup!
> > 
> > Gotta have the sync!!!
> 
> I am afraid that GEN20 in Csound 4 most probably has the exact same bug
> (and it is there for a long time). On the other hand, I have already
> fixed it in Csound 5, so there is no longer a reason to avoid GEN 20 or
> trying other versions of Csound.
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> 



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net