realloc() error?
Date | 2016-10-19 22:59 |
From | Aaron Krister Johnson |
Subject | realloc() error? |
Something is up with the heap. This is a new install of Csound-6.06: Is there a fix? Thanks! |
Date | 2016-10-19 23:32 |
From | Victor Lazzarini |
Subject | Re: realloc() error? |
Try 6.07 and if you have a problem, give us more details.
We can't fix 6.06.
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2016-10-20 04:03 |
From | Aaron Krister Johnson |
Subject | Re: realloc() error? |
It must be something in my larger orchestra file for microcsound (microcsound.orc)...something that's not agreeing with newer versions. I wonder if it relates to tables or soundfont loading or something. I will comment out things, narrowing it down until it works. Or -- maybe I can see about more verbose messages :) I have 6.08 now installed (I guess that's the new default git branch...if necessary I can help debug with devel if you give me the git command). My system is Linux Mint on a Mac PowerBook. On Wed, Oct 19, 2016 at 5:32 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2016-10-20 06:49 |
From | Victor Lazzarini |
Subject | Re: realloc() error? |
I can try it here, if I am given the files.
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2016-10-20 16:48 |
From | Aaron Krister Johnson |
Subject | Re: realloc() error? |
I've narrowed the issue down to something happening in newer versions that didn't happen in older ones: sfload will fail if one loads too many soundfonts in one orchestra. It doesn't appear to be related to a certain soundfont, just that there are a certain amount loaded, which I presume has to do with RAM/heap usage via calls to realloc(). I'm wondering if something changed either globally or local to the source code of sfload that may have changed something about memory limits, or something in particular between versions related to calls to realloc()...? I hope that helps. I would give you my orchestra, but as the issue seems related to soundfonts, I think you could probably narrow it down yourself by just loading up any old orchestra with enough instances of sfload and seeing the behavior yourself :) Plus, soundfonts tend to be large and unwieldy to send back and forth. -A. On Thu, Oct 20, 2016 at 12:49 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2016-10-20 17:10 |
From | jpff |
Subject | Re: realloc() error? |
I see one call to realloc; unsure why this is not using csound->ReAlloc() Also result not checked which is wrong. On Thu, 20 Oct 2016, Aaron Krister Johnson wrote: > I've narrowed the issue down to something happening in newer versions that > didn't happen in older ones: sfload will fail if one loads too many soundfonts > in one orchestra. It doesn't appear to be related to a certain soundfont, just > that there are a certain amount loaded, which I presume has to do with > RAM/heap usage via calls to realloc(). > I'm wondering if something changed either globally or local to the source code > of sfload that may have changed something about memory limits, or something in > particular between versions related to calls to realloc()...? > > I hope that helps. > > I would give you my orchestra, but as the issue seems related to soundfonts, I > think you could probably narrow it down yourself by just loading up any old > orchestra with enough instances of sfload and seeing the behavior yourself :) > Plus, soundfonts tend to be large and unwieldy to send back and forth. > > -A. > > Aaron Krister Johnson > http://www.untwelve.org > > On Thu, Oct 20, 2016 at 12:49 AM, Victor Lazzarini |
Date | 2016-10-20 17:48 |
From | Victor Lazzarini |
Subject | Re: realloc() error? |
it should ideally use our mem management. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 20 Oct 2016, at 17:10, jpff |
Date | 2016-10-20 17:52 |
From | Aaron Krister Johnson |
Subject | Re: realloc() error? |
If you guys fix this (I assume it's in Engine/memalloc.c) can you post a patch? Thanks a million. -A. On Thu, Oct 20, 2016 at 11:48 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: it should ideally use our mem management. |
Date | 2016-10-20 18:09 |
From | John ff |
Subject | Re: realloc() error? |
I have a possible if fix in Opcodes/sfont .c but cannot test
On 20 Oct 2016, at 17:53, Aaron Krister Johnson <akjmicro@GMAIL.COM> wrote:
|
Date | 2016-10-20 18:17 |
From | jpff |
Subject | Re: realloc() error? |
try @@ -172,9 +172,10 @@ static int SfLoad_(CSOUND *csound, SFLOAD *p, int istring) csound->Free(csound,fname); if (UNLIKELY(++globals->currSFndx>=globals->maxSFndx)) { globals->maxSFndx += 5; - globals->sfArray = (SFBANK *)realloc(globals->sfArray, - globals->maxSFndx*sizeof(SFBANK)); + globals->sfArray = (SFBANK *)csound->ReAlloc(csound, globals->sfArray, + /* JPff fix */ globals->maxSFndx*sizeof(SFBANK)); csound->Warning(csound, Str("Extending soundfonts")); + if (globals->sfArray == NULL) return NOTOK; } return OK; } On Thu, 20 Oct 2016, Aaron Krister Johnson wrote: > If you guys fix this (I assume it's in Engine/memalloc.c) can you post a > patch? > Thanks a million. > > -A. > > Aaron Krister Johnson > http://www.untwelve.org > > On Thu, Oct 20, 2016 at 11:48 AM, Victor Lazzarini |
Date | 2016-10-20 18:27 |
From | Victor Lazzarini |
Subject | Re: realloc() error? |
did the original code ever free the memory? Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 20 Oct 2016, at 18:17, jpff |
Date | 2016-10-21 21:04 |
From | jpff |
Subject | Re: realloc() error? |
ot ta I can see at present. it is a global so reset shoud deal wit it I guess. The sfont code is problematic to my eyes. On Thu, 20 Oct 2016, Victor Lazzarini wrote: > did the original code ever free the memory? > > Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy > Maynooth University > Ireland > >> On 20 Oct 2016, at 18:17, jpff |