From 134a4cd91489858598570a6ee1331c6ee5863297 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 6 Jun 2014 14:52:05 +0200 Subject: [PATCH] fix invalid memory access and add warning about memory leak in quality reporting --- coreapi/quality_reporting.c | 24 ++++++++++++------------ tester/call_tester.c | 10 ++++++---- tester/liblinphone_tester.c | 2 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index 102f38c9e..e0f21d377 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -31,20 +31,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /*************************************************************************** * TODO / REMINDER LIST *************************************************************************** -For codecs that are able to change sample rates, the lowest and highest sample rates MUST be reported (e.g., 8000;16000). -moslq == moscq -valgrind -video: what happens if doing stop/resume? -one single report <- merge audio/video? -rlq value: need algo to compute it -3.4 overload avoidance? + For codecs that are able to change sample rates, the lowest and highest sample rates MUST be reported (e.g., 8000;16000). + moslq == moscq + rlq value: need algo to compute it - - The Session report when session terminates, media change (codec change or a session fork), session terminates due to no media packets being received - - The Interval report SHOULD be used for periodic or interval reporting + 3.4 overload avoidance? + a. Send only one report at the end of each call. (audio | video?) + b. Use interval reports only on "problem" calls that are being closely monitored. - -> avg values - -> interval report - -> custom metrics + + - The Session report when + codec change + session fork + video enable/disable <-- what happens if doing stop/resume? *************************************************************************** * END OF TODO / REMINDER LIST ****************************************************************************/ @@ -340,6 +339,7 @@ static void send_report(const LinphoneCall* call, reporting_session_report_t * r content.data = buffer; content.size = strlen(buffer); + /*(WIP) Memory leak: PUBLISH message is never freed (issue 1283)*/ linphone_core_publish(call->core, addr, "vq-rtcpxr", expires, &content); linphone_address_destroy(addr); diff --git a/tester/call_tester.c b/tester/call_tester.c index bede109ed..0548c7c1e 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -576,7 +576,7 @@ static bool_t check_ice(LinphoneCoreManager* caller, LinphoneCoreManager* callee } ms_usleep(50000); } - + if (video_enabled){ for (i=0;i<200;i++){ if ((c1 != NULL) && (c2 != NULL)) { @@ -967,7 +967,7 @@ static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* ma CU_ASSERT_TRUE(call_with_params(pauline,marie,caller_params,callee_params)); marie_call=linphone_core_get_current_call(marie->lc); pauline_call=linphone_core_get_current_call(pauline->lc); - + linphone_call_params_destroy(caller_params); linphone_call_params_destroy(callee_params); @@ -2213,14 +2213,16 @@ static void quality_reporting_at_call_termination() { create_call_for_quality_reporting_tests(marie, pauline, &call_marie, &call_pauline); linphone_core_terminate_all_calls(marie->lc); + + // now dialog id should be filled + CU_ASSERT_PTR_NOT_NULL(call_marie->log->reports[0]->dialog_id); + CU_ASSERT_TRUE(wait_for_until(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallReleased,1, 10000)); CU_ASSERT_TRUE(wait_for_until(pauline->lc,NULL,&pauline->stat.number_of_LinphoneCallReleased,1, 10000)); CU_ASSERT_PTR_NULL(linphone_core_get_current_call(marie->lc)); CU_ASSERT_PTR_NULL(linphone_core_get_current_call(pauline->lc)); - // now dialog id should be filled - CU_ASSERT_PTR_NOT_NULL(call_marie->log->reports[0]->dialog_id); // PUBLISH submission to the collector should be ok CU_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphonePublishProgress,1)); diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index c5d017566..825e16727 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -119,7 +119,7 @@ static void liblinphone_tester_qnx_log_handler(OrtpLogLevel lev, const char *fmt void helper(const char *name) { - fprintf(stderr,"%s \t--help\n" + fprintf(stderr,"%s --help\n" "\t\t\t--verbose\n" "\t\t\t--silent\n" "\t\t\t--list-suites\n"