Csound Csound-dev Csound-tekno Search About

[Cs-dev] memory problem

Date2014-01-30 17:29
Fromjpff
Subject[Cs-dev] memory problem
I am seeing an illegal free

Elapsed time at end of score sort: real: 0.808s, CPU: 0.763s
==6250== Invalid free() / delete / delete[] / realloc()
==6250==    at 0x4C28ADC: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6250==    by 0x4F8A0F1: csoundCompileArgs (main.c:314)
==6250==    by 0x4F8AC88: csoundCompile (main.c:491)
==6250==    by 0x4013BF: main (csound_main.c:133)
==6250==  Address 0x8b65490 is 32 bytes inside a block of size 53 alloc'd
==6250==    at 0x4C29964: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6250==    by 0x4E85862: mcalloc (memalloc.c:106)
==6250==    by 0x4E8B50B: csoundCreateGlobalVariable (namedins.c:246)
==6250==    by 0x4F88C76: csoundReset (csound.c:2901)
==6250==    by 0x4F89273: csoundCreate (csound.c:1141)
==6250==    by 0x4013AD: main (csound_main.c:130)
==6250== 

Do not think I changed this area.  Any ideas?

I think it relates to  the free(s) at the end of csoundCompileArgs and
the code about line 248 where s is strdup in one case and different in
another.

==John ffitch

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-01-30 18:15
FromVictor Lazzarini
SubjectRe: [Cs-dev] memory problem
Does changing strdup() to cs_strdup() fix it?
In any case, I think we should use cs_strdup() and mfree() in this case.

On 30 Jan 2014, at 17:29, jpff  wrote:

> I am seeing an illegal free
> 
> Elapsed time at end of score sort: real: 0.808s, CPU: 0.763s
> ==6250== Invalid free() / delete / delete[] / realloc()
> ==6250==    at 0x4C28ADC: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6250==    by 0x4F8A0F1: csoundCompileArgs (main.c:314)
> ==6250==    by 0x4F8AC88: csoundCompile (main.c:491)
> ==6250==    by 0x4013BF: main (csound_main.c:133)
> ==6250==  Address 0x8b65490 is 32 bytes inside a block of size 53 alloc'd
> ==6250==    at 0x4C29964: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6250==    by 0x4E85862: mcalloc (memalloc.c:106)
> ==6250==    by 0x4E8B50B: csoundCreateGlobalVariable (namedins.c:246)
> ==6250==    by 0x4F88C76: csoundReset (csound.c:2901)
> ==6250==    by 0x4F89273: csoundCreate (csound.c:1141)
> ==6250==    by 0x4013AD: main (csound_main.c:130)
> ==6250== 
> 
> Do not think I changed this area.  Any ideas?
> 
> I think it relates to  the free(s) at the end of csoundCompileArgs and
> the code about line 248 where s is strdup in one case and different in
> another.
> 
> ==John ffitch
> 
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable 
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-01-30 18:19
FromVictor Lazzarini
SubjectRe: [Cs-dev] memory problem
I think we can definitely change strdup() to cs_strdup() and remove the free(s).

If that’s the problem, that’ll fix it.

Victor
On 30 Jan 2014, at 17:29, jpff  wrote:

> I am seeing an illegal free
> 
> Elapsed time at end of score sort: real: 0.808s, CPU: 0.763s
> ==6250== Invalid free() / delete / delete[] / realloc()
> ==6250==    at 0x4C28ADC: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6250==    by 0x4F8A0F1: csoundCompileArgs (main.c:314)
> ==6250==    by 0x4F8AC88: csoundCompile (main.c:491)
> ==6250==    by 0x4013BF: main (csound_main.c:133)
> ==6250==  Address 0x8b65490 is 32 bytes inside a block of size 53 alloc'd
> ==6250==    at 0x4C29964: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6250==    by 0x4E85862: mcalloc (memalloc.c:106)
> ==6250==    by 0x4E8B50B: csoundCreateGlobalVariable (namedins.c:246)
> ==6250==    by 0x4F88C76: csoundReset (csound.c:2901)
> ==6250==    by 0x4F89273: csoundCreate (csound.c:1141)
> ==6250==    by 0x4013AD: main (csound_main.c:130)
> ==6250== 
> 
> Do not think I changed this area.  Any ideas?
> 
> I think it relates to  the free(s) at the end of csoundCompileArgs and
> the code about line 248 where s is strdup in one case and different in
> another.
> 
> ==John ffitch
> 
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable 
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-01-30 19:09
FromMichael Gogins
SubjectRe: [Cs-dev] memory problem
AttachmentsNone  None  
I have been seeing this problem as well, not with standalone Csound but when using CsoundQt.

Regards,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Jan 30, 2014 at 1:19 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I think we can definitely change strdup() to cs_strdup() and remove the free(s).

If that’s the problem, that’ll fix it.

Victor
On 30 Jan 2014, at 17:29, jpff <jpff@cs.bath.ac.uk> wrote:

> I am seeing an illegal free
>
> Elapsed time at end of score sort: real: 0.808s, CPU: 0.763s
> ==6250== Invalid free() / delete / delete[] / realloc()
> ==6250==    at 0x4C28ADC: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6250==    by 0x4F8A0F1: csoundCompileArgs (main.c:314)
> ==6250==    by 0x4F8AC88: csoundCompile (main.c:491)
> ==6250==    by 0x4013BF: main (csound_main.c:133)
> ==6250==  Address 0x8b65490 is 32 bytes inside a block of size 53 alloc'd
> ==6250==    at 0x4C29964: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6250==    by 0x4E85862: mcalloc (memalloc.c:106)
> ==6250==    by 0x4E8B50B: csoundCreateGlobalVariable (namedins.c:246)
> ==6250==    by 0x4F88C76: csoundReset (csound.c:2901)
> ==6250==    by 0x4F89273: csoundCreate (csound.c:1141)
> ==6250==    by 0x4013AD: main (csound_main.c:130)
> ==6250==
>
> Do not think I changed this area.  Any ideas?
>
> I think it relates to  the free(s) at the end of csoundCompileArgs and
> the code about line 248 where s is strdup in one case and different in
> another.
>
> ==John ffitch
>
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2014-01-30 19:23
Fromjpff
SubjectRe: [Cs-dev] memory problem
cs_astrdup/mfree do not fix.  I have submitted a patch thatr I think is 
correct -- it at least works -- but I am a little confused by the whole 
thing -- why there is a strdup at all and not just an assignment

Will experiment.

==John

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-01-30 19:51
FromVictor Lazzarini
SubjectRe: [Cs-dev] memory problem
What about using cs_strdup() alone (no mfree())?

Victor
On 30 Jan 2014, at 19:23, jpff  wrote:

> cs_astrdup/mfree do not fix.  I have submitted a patch thatr I think is 
> correct -- it at least works -- but I am a little confused by the whole 
> thing -- why there is a strdup at all and not just an assignment
> 
> Will experiment.
> 
> ==John
> 
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable 
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-01-31 01:47
FromMichael Gogins
SubjectRe: [Cs-dev] memory problem
AttachmentsNone  None  
The problem that I was seeing, CsoundQt crashing, is now gone. 

Thanks,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Jan 30, 2014 at 2:51 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
What about using cs_strdup() alone (no mfree())?

Victor
On 30 Jan 2014, at 19:23, jpff <jpff@codemist.co.uk> wrote:

> cs_astrdup/mfree do not fix.  I have submitted a patch thatr I think is
> correct -- it at least works -- but I am a little confused by the whole
> thing -- why there is a strdup at all and not just an assignment
>
> Will experiment.
>
> ==John
>
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel