Bug 2696 - SecKeyChain.QueryAsRecord leaks if generic data is available.
Summary: SecKeyChain.QueryAsRecord leaks if generic data is available.
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
Depends on:
Reported: 2011-12-29 23:36 UTC by Jackson Harper
Modified: 2012-01-11 20:12 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

test case (2.85 MB, application/zip)
2011-12-29 23:37 UTC, Jackson Harper

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jackson Harper 2011-12-29 23:36:37 UTC
Possible I'm using it wrong, but it appears that grabbing a password using QueryAsRecord leaks when there is a password set. 

Run the attached test case with Instruments, click the button every once in a while.
Comment 1 Jackson Harper 2011-12-29 23:37:32 UTC
Created attachment 1114 [details]
test case
Comment 2 Sebastien Pouliot 2012-01-11 11:50:17 UTC
Heapshot shows that the IntPtr[] is growing (few 2-3 clicks) then stabilizing. 
However Instruments shows a linear growth, looks like we're leaking (or not disposing) NSMutableDictionary.
Comment 3 Jackson Harper 2012-01-11 11:55:46 UTC
That is exactly what I suspected from playing with it.
Comment 4 Sebastien Pouliot 2012-01-11 15:26:17 UTC
Found it. It's likely affecting other methods too, so I'll need to test a few things before committing the fix.
Comment 5 Sebastien Pouliot 2012-01-11 20:12:58 UTC
Fixed in master. I'll write some tests and let it cool down a bit before backporting it to stable.