Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Serious problem in csoundFTAlloc

Date2008-11-29 13:44
Fromvictor
SubjectRe: [Cs-dev] Serious problem in csoundFTAlloc
Why is this being called? I can't understand. It seems to
be a problem in the CSD, as the code should not be
fiddling with a function table currently in use. Perhaps
instead of the warning, we should not allow it to
go ahead?

Victor

----- Original Message ----- 
From: "jpff" 
To: 
Sent: Saturday, November 29, 2008 11:57 AM
Subject: [Cs-dev] Serious problem in csoundFTAlloc


> This is a follow upo to the problem some people have with the
> contrapunctus example.  The trouble is in Engine/fgens.c in
> csoundFTAlloc.
>  In particular the lines
>    else if (len != (int) ftp->flen) {
>      if (csound->actanchor.nxtact != NULL) { /*   & chk for danger    */
>        csound->Warning(csound, Str("ftable %d relocating due to size 
> change"
>                                    "\n         currently active 
> instruments "
>                                    "may find this disturbing"), tableNum);
>      }
>      csound->flist[tableNum] = NULL;
>      csound->Free(csound, ftp);
>      csound->flist[tableNum] = (FUNC*) csound->Malloc(csound, (size_t) 
> size);
>    }
>
> This destroys a table and creates a new one.  If any other opcode is
> running at that time the Free will lead to a dangling pointer.
>
> At present I cannot think of a solution, good or otherwise!  Best
> might be to not free and so waste space.  Anyone any other ideas?
>
> ==John ffitch
>
> PS I have an e-mail problem at present so I cannot see csound or
> csound-devel mailing lists until some engineering works are completed.
> Please copy me in directly on any response
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's 
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great 
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the 
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-29 14:13
FromRichard Dobson
SubjectRe: [Cs-dev] Serious problem in csoundFTAlloc
It's historical - permitted (or rather, not forbidden)  in the original 
docs:

"An existing function table can be removed ... by the generation  of 
another table  with the same p1. Functions are not automatically erased 
  at the end of a score section."

No discussion of when it is or is not a good idea. In those days, it was 
just a "reference manual" and it was assumed users would already know 
the hazards.

In short, it is virtually enshrined as part of standard practice.

So, yes, it should not be  allowed, but that may depend on how many 
Csounders have relied on that permission, over the years. You would need 
Yet Another Commandline Flag so users could elect to protect themselves, 
or not. The new warning message would then helpfully mention it.


Richard Dobson

victor wrote:
> Why is this being called? I can't understand. It seems to
> be a problem in the CSD, as the code should not be
> fiddling with a function table currently in use. Perhaps
> instead of the warning, we should not allow it to
> go ahead?
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-12-01 01:29
From"Andres Cabrera"
SubjectRe: [Cs-dev] Serious problem in csoundFTAlloc
AttachmentsNone