#204 ✓resolved
W. Trevor King

parser errors from ideviceinfo with iOS 4.2.6

Reported by W. Trevor King | February 28th, 2011 @ 07:05 PM | in 1.2.0 Release

I'm trying to work the kinks out of a connection to a new iPhone 4 (iOS 4.2.6).

$ lsusb
Bus 001 Device 006: ID 05ac:129c Apple, Inc.
...

Simple ideviceinfo works fine:

$ ideviceinfo -s
ActivationPublicKey: ...=
BasebandChipId: 5243105
BasebandGoldCertId: 2
BasebandSerialNumber: IG+B5g==
BuildVersion: 8E200
DeviceClass: iPhone
DeviceName: iPhone
DevicePublicKey: ...=
DieID: 3170607768282189192
HardwareModel: N92AP
PartitionType: GUID_partition_scheme
ProductVersion: 4.2.6
ProductionSOC: true
ProtocolVersion: 2
UniqueChipID: ...
UniqueDeviceID: ...

But non-simple (complicated? ;) idevice info fails with a few parsing errors:

$ ideviceinfo
Entity: line 96: parser error : Char 0x0 out of allowed range
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag string line 96
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag dict line 10
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag dict line 4
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag plist line 3
                <string>s5l8930x
                                ^

Running with debug enabled gives:

$ ideviceinfo --debug
...
12:42:33 idevice.c:625 idevice_connection_enable_ssl(): GnuTLS handshake done...
12:42:33 idevice.c:636 idevice_connection_enable_ssl(): SSL mode enabled
12:42:33 property_list_service.c:142 internal_plist_send(): sending 292 bytes
12:42:33 idevice.c:507 internal_ssl_write(): pre-send length = 37
12:42:33 idevice.c:509 internal_ssl_write(): post-send sent 37 bytes
12:42:33 idevice.c:507 internal_ssl_write(): pre-send length = 325
12:42:33 idevice.c:509 internal_ssl_write(): post-send sent 325 bytes
12:42:33 property_list_service.c:147 internal_plist_send(): sent 292 bytes
12:42:33 property_list_service.c:148 internal_plist_send(): printing 292 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>ideviceinfo</string>
        <key>Request</key>
        <string>GetValue</string>
</dict>
</plist>
12:42:33 idevice.c:467 internal_ssl_read(): pre-read client wants 5 bytes
12:42:33 idevice.c:477 internal_ssl_read(): post-read we got 5 bytes
12:42:33 idevice.c:467 internal_ssl_read(): pre-read client wants 32 bytes
12:42:33 idevice.c:477 internal_ssl_read(): post-read we got 32 bytes
12:42:33 property_list_service.c:224 internal_plist_receive_timeout(): initial read=4
12:42:33 property_list_service.c:233 internal_plist_receive_timeout(): 6083 bytes following
12:42:33 idevice.c:467 internal_ssl_read(): pre-read client wants 5 bytes
12:42:33 idevice.c:477 internal_ssl_read(): post-read we got 5 bytes
12:42:33 idevice.c:467 internal_ssl_read(): pre-read client wants 6112 bytes
12:42:33 idevice.c:477 internal_ssl_read(): post-read we got 6112 bytes
12:42:33 property_list_service.c:242 internal_plist_receive_timeout(): received 6083 bytes
Entity: line 96: parser error : Char 0x0 out of allowed range
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag string line 96
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag dict line 10
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag dict line 4
                <string>s5l8930x
                                ^
Entity: line 96: parser error : Premature end of data in tag plist line 3
                <string>s5l8930x
12:42:33 lockdown.c:152 lockdownd_stop_session(): stopping session AE762072-FFB3-4EB2-8BA1-EA33D53D3FB4
...

I imagine this is just a minor tweak due to a newer iOS. I glanced through the libimobiledevice source, but haven't found the right place to start poking around yet.

Let me know if there's anything I can do to help fix/debug.

Comments and changes to this ticket

  • Martin S.

    Martin S. March 12th, 2011 @ 02:51 PM

    • Tag set to libplist, parsing
    • State changed from “new” to “open”

    Unable to reproduce especially since iOS 4.2.6 is only for the CDMA iPhone 4 model.
    I roughly remember we had such an issue and as you might see from the "parser error" lines it is about parsing the received plist messages.

    The main component to check here is libplist which spits out those errors you see due to apparently an empty character.

    Please post your OS version and versions of installed packages, perhaps an update of libplist might solve this issue for you.

  • W. Trevor King

    W. Trevor King March 12th, 2011 @ 03:32 PM

    On Sat, Mar 12, 2011 at 09:51:29AM -0500, Martin S. wrote:

    The main component to check here is libplist which spits out those errors you see due to apparently an empty character.

    Ok. I'll check there once my wife returns from a trip with the phone ;).

    Please post your OS version and versions of installed packages, perhaps an update of libplist might solve this issue for you.

    OS: Gentoo
    Kernel: gentoo-sources-2.6.37

    libimobiledevice-1.0.4
    libplist-1.3
    usbmuxd-1.0.6
    libgcrypt-1.4.6
    gnutls-2.11.6
    fuse-2.8.5
    libusb-1.0.8

  • hannes

    hannes March 13th, 2011 @ 10:51 AM

    I can confirm the behaviour with a iPod 4g with iOS 4.3

    OS: Ubuntu (kernel: 2.6.35-28-generic)

    libimobiledevice: 1.0.4-1ubuntu1~maverick1
    libplist: 1.3-1
    libusbmuxd: 1.0.6-1ubuntu1~maverick1
    libgcrypt: 1.4.5-2ubuntu1
    fuse: 2.8.4-1ubuntu1.3
    libusb: 1.0.8-2

  • Martin S.

    Martin S. March 13th, 2011 @ 03:46 PM

    • Tag changed from libplist, parsing to ios 4.3, libplist, parsing
    • Milestone set to 1.2.0 Release
    • Milestone order changed from “190912” to “0”

    Thanks for confirmation hannes, so at least we should be able to reproduce and fix it without needing a CDMA iPhone 4.

    However right now we have to wait for a 4.3 jailbreak in order to not loose "full debugging" possibilities on our testing devices.

    Some things you might help us with meanwhile:
    - Run idevicesyslog in parallel and post the lines of output during the error - Alter the ideviceinfo tool manually to dump the received plist to disk and post it here (so we can verify it's integrity)

  • W. Trevor King

    W. Trevor King March 13th, 2011 @ 06:27 PM

    Alter the ideviceinfo tool manually to dump the received plist to disk and post it here (so we can verify it's integrity)

    I've put in code to do this (http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=libimobi..., but I won't have the phone around for another two weeks to run it. A log file stores information from the crashing internal_plist_receive_timeout call.

  • hannes

    hannes March 13th, 2011 @ 09:00 PM

    (Your code segfaults when trying to open a file with fopen. Don't know why, don't care, did it with printf. I never claimed that i can program c or anything :) )

    Here's the output of some similar debug code.
    No idevicesyslog as far as I can tell.

  • W. Trevor King

    W. Trevor King March 13th, 2011 @ 09:18 PM

    Is that output from a crashing run? I don't see anything resembling the

    <string>s5l8930x
    

    that my crashes mentioned. I also don't understand how you can have "plist debugged" but not "free and return" because nothing happens between the two printfs:

        fprintf(fd, "plist debugged\n"); fflush(fd);
        res = PROPERTY_LIST_SERVICE_E_SUCCESS;
      } else {
        res = PROPERTY_LIST_SERVICE_E_PLIST_ERROR;
      }
      fprintf(fd, "free and return\n"); fflush(fd);
    
  • Martin S.

    Martin S. March 14th, 2011 @ 12:36 PM

    Thanks, it appears that the plist is not fully send over from the device which of course results in parsing errors as the XML is not valid.

    @hannes: I don't understand what you mean about idevicesyslog. Does the tool not show any output at all or what do you mean?

    In such cases the device definitely reports the error in it's syslog.
    Anyways, it looks like some low-level usbmux communication issue.

  • W. Trevor King

    W. Trevor King March 14th, 2011 @ 01:16 PM

    it appears that the plist is not fully send over from the device

    I may be missing something obvious, but the plist in hannes' dump looks like valid XML to me.

  • Martin S.

    Martin S. March 14th, 2011 @ 01:23 PM

    <string>s5l8930x

    How is that valid? It would need to be <string>s5l8930x</string>, right?
    Not event talking about the fact that the previous two nodes are not closed either.

    The data of the plist between "begin content" and "end content" is clearly not valid XML.
    Thus it is absolutely expected to cause parsing errors.

  • W. Trevor King

    W. Trevor King March 14th, 2011 @ 03:31 PM

    Oops, I had been looking at the wrong file ;). Please disregard all of my previous comments about hannes' dump.

  • Piotr Wlodarczyk

    Piotr Wlodarczyk March 20th, 2011 @ 10:24 PM

    I've got the same error on my iPad with 4.3 iOS when I try ideviceinfo or idevicebackup.

    deb:~# ideviceinfo --debug
    Entity: line 81: parser error : Char 0x0 out of allowed range

                <string>s5l8930x
                                ^
    

    Entity: line 81: parser error : Premature end of data in tag string line 81

                <string>s5l8930x
                                ^
    

    Entity: line 81: parser error : Premature end of data in tag dict line 10

                <string>s5l8930x
                                ^
    

    Entity: line 81: parser error : Premature end of data in tag dict line 4

                <string>s5l8930x
                                ^
    

    Entity: line 81: parser error : Premature end of data in tag plist line 3

                <string>s5l8930x
    
  • Piotr Wlodarczyk

    Piotr Wlodarczyk March 20th, 2011 @ 10:27 PM

    My libs (I hope this helps):

    ifuse-1.1.1
    libplist-1.3
    libgpg-error-1.9
    gnutls-2.8.6
    libusb-1.0.8
    usbmuxd-1.0.6
    libgcrypt-1.4.6
    libtasn1-2.9

  • Martin S.

    Martin S. March 21st, 2011 @ 08:54 AM

    Thanks for testing. I am still waiting for a jailbreak in order to be able to upgrade to iOS 4.3 to debug.

    Meanwhile if one want's to help, please run the tool "idevicesyslog", then run "ideviceinfo --debug" in parallel.

    Afterwards please supply any output of "idevicesyslog" at the time of the error.
    The device's syslog should give us a hint at why transferring this PLIST from the device is not working correctly.

  • Martin S.

    Martin S. March 21st, 2011 @ 03:29 PM

    • State changed from “open” to “resolved”

    Thanks for reporting, the issue has been fixed in git master.

    It appears iOS 4.2.6 and iOS 4.3 have a bug and we have added a workaround.

  • Alex Veer
  • Alex Veer

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket

Attachments

Pages