Sunday, February 11, 2018

February 11, 2018 - the hunt for a reference counting leak

The entire day at work, sans the meetings, I have been looking for a leaked reference counting bug.
For now, the bug has won the first round, but I am pretty confident that I will win the match.

The problem with the leak in a ref count is how to catch it.
I have tried the following strategies:

  1. Go over the code and try to find the leak. At first no results, but then found something at the end of the day. Sadly I had to catch the train.
  2. Try to find the exact leak scenario by testing various inputs. Failed as there appears to be no clear dependency on the input.
  3. Check the reference count at the various functions and try to find the leaky function. Didn't really worked as the functions are running in parallel, so the count is not always can be compared.
  4. Comment out code chunks. Didn't work well yet. The changes are distributed across the code and thus, are relatively hard to cherry-comment-out. 
Tomorrow will see the late found issue and maybe will ask for a code review some coworker. 

No comments: