[Cs-dev] A potential danger with csoundDestroy()
Date | 2013-05-14 15:30 |
From | Francois PINOT |
Subject | [Cs-dev] A potential danger with csoundDestroy() |
Attachments | None None |
Hello, when csoundDestroy is called to destroy an instance of Csound, the memory used by the struct CSOUND_ pointed by the CSOUND pointer is freed (line 1198 in csound.c).#include <csound/csound.h> int main(int argc, char *argv[]) { CSOUND *csound = csoundCreate(NULL); printf("%d\n", (int)csoundGetSr(csound)); csoundDestroy(csound); sleep(10); printf("%d\n", (int)csoundGetKr(csound)); } |
Date | 2013-05-14 15:37 |
From | Michael Gogins |
Subject | Re: [Cs-dev] A potential danger with csoundDestroy() |
Attachments | None None |
I don't think there is a real problem here. This kind of insecurity comes with the territory in C libraries. The user can be warned about it in the documentation. Regards,
Mike On Tue, May 14, 2013 at 10:30 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Michael Gogins Irreducible Productions http://www.michael-gogins.com Michael dot Gogins at gmail dot com |
Date | 2013-05-14 15:46 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] A potential danger with csoundDestroy() |
Hi François, can you submit a ticket on this? Then we can keep track of it and decide what to do (before the release). This seems to be an issue that has been there since 2004-5, and we have not yet seen it as a cause of problems, but let's review it. Thanks. Regards Victor On 14 May 2013, at 15:30, Francois PINOT wrote: > Hello, > > when csoundDestroy is called to destroy an instance of Csound, the memory used by the struct CSOUND_ pointed by the CSOUND pointer is freed (line 1198 in csound.c). > But the pointer itself still points to this memory. If the operating system does not realloc this memory, there's a potential danger. You can see this by running the example below: > > #include |
Date | 2013-05-14 16:02 |
From | Francois PINOT |
Subject | Re: [Cs-dev] A potential danger with csoundDestroy() |
Attachments | None None |
Ticket submitted in Csound6 Francois2013/5/14 Victor Lazzarini <Victor.Lazzarini@nuim.ie> Hi François, |
Date | 2013-05-14 16:08 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] A potential danger with csoundDestroy() |
Attachments | None None |
Thanks. On 14 May 2013, at 16:02, Francois PINOT wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |