Re: [Sofia-sip-devel] Possible Memory leak in 1.12.9
2008/7/9 Colin Whittaker <[EMAIL PROTECTED]>: > 1. My ancient system does NOT have CLOCK_MONOTONIC, but does have > clock_gettime(). Had to manually #undefine HAVE_CLOCK_GETTIME in config.h Added check for CLOCK_MONOTONIC, too. > 2. My system is also missing va_copy(), which is taken care of in many > .c files, but su_tagarg.h uses it in the macro for ta_start, but relies > on it being supplied by some system include file. > Here is the change I copied from one of the C files that had it: Applied. > So I'm running 1.12.9 and I am seeing a memory leak if the caller hangs > up, i.e. sends the BYE. > Looks like the handle is not being free'd > But, it is no longer on the nua->nua_handles list. I'm not sure where to > start looking for the problem. Looks yet another complication on making BYE method a first class citizen. I'll see it with test programs (when I remember to use --trace-children=yes), too -- Pekka.Pessi mail at nokia.com - 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=/ ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
Re: [Sofia-sip-devel] Possible Memory leak in 1.12.9
Hi Jerry, We have a sofia based UA application that has been running on 1.12.6 for quite a while. The application does call nua_handle_destroy(). It is in the debug print trace after the r_bye event. I have many tools to watch memory usage, but the easiest way to see this is to look at the VmData in the /proc/pid/status file. I determined it was a handle by using mtrace(). I also have a way to display all the memory allocations by object since sofia has an object based memory allocation scheme. Some interesting details: The handle no longer lives in the nua agent nua_handles list. The handle home object has 1 reference. The handle has a sub object which is also a home, which also has 1 reference. This object was allocated in nua_client_check_restart(), by ca_create(). My guess here is the credentials created for the handle are not being dereferenced. Strange that this only happens when we generate the BYE. If we CANCEL or receive a BYE, the handle is freed. Colin.. Jerry Richards wrote: > Hello, > > Questions: How did you first detect this memory leak? Shouldn't your NUA > application freeing the handle (via nua_handle_destroy())? > > Best Regards, > Jerry > > > -- > > Message: 6 > Date: Wed, 09 Jul 2008 13:49:52 -0700 > From: Colin Whittaker <[EMAIL PROTECTED]> > Subject: [Sofia-sip-devel] Possible Memory leak in 1.12.9 > To: Sofia-sip-devel@lists.sourceforge.net > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi all, > Finally got a change to look at 1.12.9. > Had a few little issues with the build. Nothing big, and mostly due to the > age of my system. > > 1. My ancient system does NOT have CLOCK_MONOTONIC, but does have > clock_gettime(). Had to manually #undefine HAVE_CLOCK_GETTIME in config.h > > 2. My system is also missing va_copy(), which is taken care of in many .c > files, but su_tagarg.h uses it in the macro for ta_start, but relies on it > being supplied by some system include file. > Here is the change I copied from one of the C files that had it: > diff -n libsofia-sip-ua/su/sofia-sip/su_tagarg.h su_tagarg.h > a84 8 > #if defined(va_copy) > /* Xyzzy */ > #elif defined(__va_copy) > #define va_copy(dst, src) __va_copy((dst), (src)) #else #define va_copy(dst, > src) (memcpy(&(dst), &(src), sizeof (va_list))) #endif > > > So I'm running 1.12.9 and I am seeing a memory leak if the caller hangs up, > i.e. sends the BYE. > Looks like the handle is not being free'd But, it is no longer on the > nua->nua_handles list. I'm not sure where to start looking for the problem. > > - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
Re: [Sofia-sip-devel] Possible Memory leak in 1.12.9
Hello, Questions: How did you first detect this memory leak? Shouldn't your NUA application freeing the handle (via nua_handle_destroy())? Best Regards, Jerry -- Message: 6 Date: Wed, 09 Jul 2008 13:49:52 -0700 From: Colin Whittaker <[EMAIL PROTECTED]> Subject: [Sofia-sip-devel] Possible Memory leak in 1.12.9 To: Sofia-sip-devel@lists.sourceforge.net Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi all, Finally got a change to look at 1.12.9. Had a few little issues with the build. Nothing big, and mostly due to the age of my system. 1. My ancient system does NOT have CLOCK_MONOTONIC, but does have clock_gettime(). Had to manually #undefine HAVE_CLOCK_GETTIME in config.h 2. My system is also missing va_copy(), which is taken care of in many .c files, but su_tagarg.h uses it in the macro for ta_start, but relies on it being supplied by some system include file. Here is the change I copied from one of the C files that had it: diff -n libsofia-sip-ua/su/sofia-sip/su_tagarg.h su_tagarg.h a84 8 #if defined(va_copy) /* Xyzzy */ #elif defined(__va_copy) #define va_copy(dst, src) __va_copy((dst), (src)) #else #define va_copy(dst, src) (memcpy(&(dst), &(src), sizeof (va_list))) #endif So I'm running 1.12.9 and I am seeing a memory leak if the caller hangs up, i.e. sends the BYE. Looks like the handle is not being free'd But, it is no longer on the nua->nua_handles list. I'm not sure where to start looking for the problem. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel