[Csnd] csoundTableCopyIn documentation
Date | 2019-03-05 18:57 |
From | Justin Smith |
Subject | [Csnd] csoundTableCopyIn documentation |
I'm looking at the API reference for csoundTableCopyIn, https://csound.com/docs/api/group___t_a_b_l_e.html#ga177f7340f0da596c2872331f6bc3ac2a Currently the documentation is as follows: "Copy the contents of an array *src into a given function table The table number is assumed to be valid, and the table needs to have sufficient space to receive all the array contents." Shouldn't that be "the array needs to have sufficient size to fill the array contents"? The C API doesn't have size metadata on arrays, but Csound does know the size of a table, so I'd assume the potential runtime error here is reading past the end of the array, rather than writing past the end of the table which the current string describes. Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-03-05 19:09 |
From | Justin Smith |
Subject | Re: [Csnd] csoundTableCopyIn documentation |
I hit send too soon - "the array needs to have sufficient size to fill the *table* contents" is my suggested change. On Tue, Mar 5, 2019 at 10:57 AM Justin Smith |
Date | 2019-03-05 19:13 |
From | Victor Lazzarini |
Subject | Re: [Csnd] csoundTableCopyIn documentation |
Possibly… my mind can’t process any text semantics at the moment, but this is what the code does len = csoundGetTable(csound, &ftab, table); if (UNLIKELY(len>0x00ffffff)) len = 0x00ffffff; // As coverity is unhappy memcpy(ftab, ptable, (size_t) (len*sizeof(MYFLT))); so if it looks like that’s what we should mean, we should change the description ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 5 Mar 2019, at 19:09, Justin Smith |
Date | 2019-03-05 19:35 |
From | Justin Smith |
Subject | Re: [Csnd] csoundTableCopyIn documentation |
I think we are talking about this function https://github.com/csound/csound/blob/c26d7bcc5c9edabe39c0ad66eb6282168fa103bb/Top/csound.c#L3598 (csoundTableCopyInInternal which is called in a thread-safe manner by csoundTableCopyIn) The way I read it, the input array (ptable) doesn't have size information, as it's just a MYFLT pointer, so if the size of the table is greater than the memory allocated for ptable, it would result in reading beyond the end of the allocated memory for ptable, which is best case garbage data, and worst case a segfault. If all that is correct, how about this for a new documentation string: "Copy the contents of an array *src into a given function table. The table number is assumed to be valid, and the array needs to have sufficient size to fill the entire table." On Tue, Mar 5, 2019 at 11:13 AM Victor Lazzarini |
Date | 2019-03-05 19:38 |
From | Victor Lazzarini |
Subject | Re: [Csnd] csoundTableCopyIn documentation |
That’s the one I quoted from, and yes there needs to be enough data in the source being copied into the table. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 5 Mar 2019, at 19:35, Justin Smith |
Date | 2019-03-05 22:19 |
From | John ff |
Subject | Re: [Csnd] csoundTableCopyIn documentation |
Surely this should be policed? Sent from TypeApp On Mar 5, 2019, 19:39, at 19:39, Victor Lazzarini |
Date | 2019-03-05 23:06 |
From | Justin Smith |
Subject | Re: [Csnd] csoundTableCopyIn documentation |
you can't police an array that's supplied via a client of the API, so it makes sense to at least say "the array should be at least this big" unless we want to switch to a different argument type that can be bounds checked On Tue, Mar 5, 2019 at 2:19 PM John ff |
Date | 2019-03-06 08:34 |
From | Jeff Harrington |
Subject | [Csnd] New Csound Piece - fragment for csound |
Hi Csound Folks! It's been a while, but I've got a new piece which uses Pinkston's DX7 emulator with one of my glass DX7 patches in a short sustained 19EDO chorale. https://open.spotify.com/album/1bEO2x7RxzuBMTPGlHYxy6?si=ZmHGnxt0T0qSiqrwMF4Pvw Source (old school style): http://parnasse.com/fragment_for_csound.zip Jeff Harrington http://jeffharrington.org Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-03-07 16:16 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] New Csound Piece - fragment for csound |
Hello Jeff, Nice. Love that it and you are on Spotify. Also, appreciate that you have "shared" the "old-school" style with us too - some still study and run .csd files! Best, -dB _____________________________________________ Dr. Richard Boulanger Professor of Electronic Production and Design Professional Writing and Music Technology Division Berklee College of Music ______________________________________________ OFFICE: 1126 Boylston St., Suite 201 (EPD), Suite 208 (Boulanger) ______________________________________________ President of Boulanger Labs - http://boulangerlabs.com Author & Editor of The Csound Book - http://mitpress.mit.edu/books/csound-book Author & Editor of The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book ______________________________________________ about: http://www.boulangerlabs.com/#about about: http://www.csounds.com/community/developers/dr-richard-boulanger/ music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/ ______________________________________________ email: rboulanger@berklee.edu facebook: https://www.facebook.com/richard.boulanger.58 On Wed, Mar 6, 2019 at 3:44 AM Jeff Harrington <jeff@parnasse.com> wrote: Hi Csound Folks! |
Date | 2019-03-08 19:47 |
From | Jeff Harrington |
Subject | Re: [Csnd] New Csound Piece - fragment for csound |
Thanks, Doctor B... FWIW, I'd be happy
to put together a Csound playlist if anybody else on the list has
works on Spotify. Just email me.
Jeff
On 3/7/2019 5:16 PM, Dr. Richard
Boulanger wrote:
|