Memory leaks/corruption with libplist
-
Martin S.
Below patch silences 3 warnings.
-
Jonathan Beck
- State changed from new to open
Thanks for the patch Martin, both are applied.
Unfortunately I cannot reproduce your memory corruption. How many contacts do you have on the phone ? Do you have big plist transfert ?
on what architecture do you have this corruption ?
I'm running ubuntu intrepid i386.
-
Martin S.
I actually just have 3 contacts on my iPod Touch, however all have a photo associated which gets transferred in a data section.
It does not seem to be a parsing issue as I have dumped all bplist packets to make sure and used plutil on them without issues.
The corruption happens on openSUSE 11.1/x86 with Python 2.6 and libxml2 2.7.1.
In order to come behind what's wrong I'll check on a different computer and a few different devices later.
As noted, valgrind still shows there are leaks with the g_node stuff.
Did you try to run my mobilesync Python stuff like "./iphonesync.py com.apple.Contacts"? Did it work ok and dump VCards? Do you have any photos associated with contacts?
-
Martin S.
Just tried it on an iPhone with loads of contacts and photos, worked without issues on the same system. :(
Another thought I had is that this might be an issue because I have some Unicode text in my contacts...
You seem to handle PLIST_UNICODE as an extra case in libplist aswell, just mind that from what I saw the Apple specs/tools for plists just treat those as a "regular" string.
Must dig deeper into getting something that can be reproduced...
-
Jonathan Beck
I did add pictures to some of my contacts (3 over 60) and i still don't get a memory corruptions.
for g_node stuff, try with
G_SLICE=always-mallocAnd see if the leaks remain.
I did run ./iphonesync.py com.apple.Contacts, and it dumped all my contacts, photo included. Nice work !
The only thing not working are unicode strings, which are not getting through the SWIG interface. I am looking on a generic way to do that.
-
Jonathan Beck
You can try with last libplist revision, which merge ascii and unicode string handling.
Surprisingly, data is processed well and i get all characters in the vcard dump, without changing anything in python-iphonesync.
However, i still do not have any segfaults :)
Warning : last libplist breaks API, so you need to recompile libiphone and iphone wrapper. Attached is a path that remove deprecated call to PLIST_UNICODE.
-
Martin S.
- State changed from open to resolved
First, G_SLICE=always-malloc makes valgrind report zero leaks, so there were just false positives due to the g_slice allocator.
Second, something in your last change for libplist regarding the Unicode stuff appears to have cured the memory corruption. Works fine now. Maybe I will try to cherrypick it at some time.
Awesome, thanks!
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
