[MXS-1979] Possibility of memory leakage in dcb_add_to_worker Created: 2018-07-15  Updated: 2018-07-16  Resolved: 2018-07-16

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: 2.2.11
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: markus makela Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None


 Description   

The following was reported with commit 19a349a4a8f66ac9fdf7cb2a27871ed974ccfa55. The leak apparently happened at a point where the posting of a message failed. No accompanying error message was found in the logs.

==3326== 96 bytes in 4 blocks are definitely lost in loss record 1,140 of 1,556
==3326==    at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
==3326==    by 0x4EC4C1A: mxs_malloc (alloc.cc:32)
==3326==    by 0xA497DF8: server_command_init(server_command_st*, mxs_mysql_cmd_t) (mysql_common.cc:487)
==3326==    by 0xA498173: protocol_add_srv_command (mysql_common.cc:597)
==3326==    by 0xB17A200: prepare_for_write (mysql_backend.c:420)
==3326==    by 0xB17A76B: gw_read_backend_event (mysql_backend.c:539)
==3326==    by 0x4EE9A3C: dcb_process_poll_events(dcb*, unsigned int) (dcb.cc:3105)
==3326==    by 0x4EE9DE1: dcb_handler(dcb*, unsigned int) (dcb.cc:3190)
==3326==    by 0x4EE9E8E: dcb_poll_handler(mxs_poll_data*, int, unsigned int) (dcb.cc:3226)
==3326==    by 0x4F4B552: maxscale::Worker::poll_waitevents() (worker.cc:1212)
==3326==    by 0x4F4A649: maxscale::Worker::run() (worker.cc:892)
==3326==    by 0x4F4B0D3: maxscale::Worker::thread_main(void*) (worker.cc:1113)

As the likelihood of this failing outside of Valgring testing is low, setting the initial priority to Minor.



 Comments   
Comment by markus makela [ 2018-07-16 ]

This apparently isn't a "real" memory leak as, given enough time to settle, valgrind eventually removes that from the definite leak report. This would suggest that the memory is "lost" while the message is in the worker's queue.

Generated at Thu Feb 08 04:10:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.