Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5261 closed defect (fixed)

Eliminate valgrind errors in libkea-http

Reported by: marcin Owned by: marcin
Priority: medium Milestone: Kea1.3 beta
Component: Unclassified Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


When running unit tests through valgrind some "definitely lost" bytes are reported which indicates that we don't free memory in the isc::http::Connection. The issue was originally brought in #5260.

The issue appears to be related to the fact that we use interval timers both in the tests and in the Connection class. The interval timers are scheduled and are referenced by the queue as shared pointers. This means that the reference to the IntervalTimerImpl? pointer is held until the timer callback is executed. If the callback is not executed (because the timeout doesn't occur) the instance is still dangling. The only way to get rid of the timer is to force invocation of the callback. It is possible by doing cancel() on the timer but that requires changes to the unit tests to not perform io_service.stop() but rather continue until all handles have been invoked.


Change History (7)

comment:1 Changed 3 years ago by tomek

  • Milestone changed from Kea-proposed to Kea1.3

Moving to 1.3 as these are necessary follow-ups for 1.2 ("technical debt").

comment:2 Changed 3 years ago by marcin

  • Owner set to UnAssgned
  • Status changed from new to assigned

I made a simple change which resolved the problem and explained the commentary why using "this" instead of "shared_from_this()" for the timer.

Proposed ChangeLog:

1259.	[bug]		marcin
	Eliminated valgrind errors in libkea-http.
	(Trac #5261, git xxx)

comment:3 Changed 3 years ago by marcin

  • Owner changed from UnAssgned to UnAssigned
  • Status changed from assigned to reviewing

comment:4 Changed 3 years ago by tomek

  • Owner changed from UnAssigned to tomek

comment:5 Changed 3 years ago by tomek

  • Owner changed from tomek to marcin

The changes are good. Please merge.

Compiled ok, unit-tests passed on Ubuntu 16.04 x64.

comment:6 Changed 3 years ago by marcin

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged with commit 34addef4a654665c6022f0269d51970c72431ac2.

comment:7 Changed 3 years ago by vicky

  • Milestone changed from Kea1.3 to Kea1.3 beta

Milestone renamed

Note: See TracTickets for help on using tickets.