Hooking malloc/calloc/free not working correctly on iOS 9 Beta 3+

Originator:Trimix2013
Number:rdar://22010422 Date Originated:7/27/2015
Status:Open Resolved:
Product:iOS 9 SDL Product Version:iOS 9 Beta 3
Classification:Serious Reproducible:Always
 
Summary:
We have a built-in diagnostics mode in our production code that monitors all memory allocations and deallocations to help identify potential sources of leaks and heap corruption.  In iOS 8 this worked correctly, but in iOS 9, beta 3 and later, this is no longer working due to changes to how the Apple SDKs are linked.  It appears that the Apple SDKs no longer use the import table to resolve the addresses of system calls, and this renders our diagnostics code useless.

Steps to Reproduce:
1. Open attached "DocTest" app.
2. Run the app on an iOS 8 device, and observe the console log output.
3. Run the app on an iOS 9 device (beta 3 or later), and observe the console log output.



Expected Results:
The console output should show all memory allocations/deallocations.

Actual Results:
The console output on the iOS 8 device shows all allocations/deallocations, from all sources including Apple SDKs.  On iOS 9 we only see a very small subset.

Version:
iOS 9 Beta 4

Notes:


Configuration:
iPad 2 WiFi running iOS 8.4,  iPad Air 2 running iOS 9 beta 4

Attachments:
'DocTest.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!