Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-13241

Memory leak when executing remote commands through proxy

XMLWordPrintable

    • Sprint 23, Sprint 24
    • 0.25

      After sending proxy data response JSON is cleaned instead of being freed

      Index: src/zabbix_server/trapper/proxydata.c
      ===================================================================
      --- src/zabbix_server/trapper/proxydata.c	(revision 76251)
      +++ src/zabbix_server/trapper/proxydata.c	(working copy)
      @@ -59,7 +59,7 @@
       			zbx_tm_update_task_status(&tasks, ZBX_TM_STATUS_INPROGRESS);
       	}
       
      -	zbx_json_clean(&json);
      +	zbx_json_free(&json);
       
       	zbx_vector_ptr_clear_ext(&tasks, (zbx_clean_func_t)zbx_tm_task_free);
       	zbx_vector_ptr_destroy(&tasks);
      
      ==13590== 131,072 bytes in 1 blocks are definitely lost in loss record 51 of 51
      ==13590==    at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
      ==13590==    by 0x567CDF: zbx_malloc2 (misc.c:491)
      ==13590==    by 0x59375D: __zbx_json_realloc (json.c:100)
      ==13590==    by 0x594AB3: zbx_json_addstring (json.c:325)
      ==13590==    by 0x6339EF: tm_json_serialize_remote_command (task.c:486)
      ==13590==    by 0x6339EF: zbx_tm_json_serialize_tasks (task.c:543)
      ==13590==    by 0x45E6CF: zbx_send_proxy_data_respose (proxydata.c:54)
      ==13590==    by 0x45E901: zbx_recv_proxy_data (proxydata.c:116)
      ==13590==    by 0x45BE03: process_trap (trapper.c:982)
      ==13590==    by 0x45D3A5: process_trapper_child (trapper.c:1118)
      ==13590==    by 0x45D3A5: trapper_thread (trapper.c:1168)
      ==13590==    by 0x55EB2C: zbx_thread_start (threads.c:128)
      ==13590==    by 0x43294B: MAIN_ZABBIX_ENTRY (server.c:1080)
      ==13590==    by 0x533BE6: daemon_start (daemon.c:392)
      ==13590== 
      ==13590== LEAK SUMMARY:
      ==13590==    definitely lost: 131,072 bytes in 1 blocks
      ==13590==    indirectly lost: 0 bytes in 0 blocks
      ==13590==      possibly lost: 0 bytes in 0 blocks
      ==13590==    still reachable: 169,516 bytes in 174 blocks
      ==13590==         suppressed: 0 bytes in 0 bloc
      

            vso Vladislavs Sokurenko
            vso Vladislavs Sokurenko
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: