Bug#730756: libimobiledevice crash, fails to get buid from usbmuxd...

2014-05-02 Thread Josep M. Perez Cancer

Hi,

Apparently usbmuxd is not expecting the ReadBUID command:

[11:56:02.254][4] New client on fd 14
[11:56:18.430][5] Client command in fd 14 len 501 ver 1 msg 8 tag 10
[11:56:18.430][1] Unexpected command 'ReadBUID' received!
[11:56:18.430][5] send_pkt fd 14 tag 10 msg 8 payload_length 278

I also see that the versions of usbmuxd and libusbmuxd do not match:
usbmuxd 1.0.8
libusbmuxd 1.0.9

Perhaps that is the real problem.

Cheers,
Josep M. Perez



On 30/04/14 18:53, Andreas Henriksson wrote:

Hello!

Thanks for the backtrace you provided in your bug report!

It looks to me like the problem is in this snippet from libimobiledevice
src/lockdown.c :

 /* set SystemBUID */
 userpref_read_system_buid(system_buid);
 plist_dict_set_item(*pair_record, USERPREF_SYSTEM_BUID_KEY, 
plist_new_string(system_buid));

userpref_read_system_buid, which calls usbmuxd_read_buid, fails for some reason
and system_buid remains/becomes NULL and when it gets passed as an argument
to plist_new_string being NULL the code explodes.

The return code from userpref_read_system_buid should be checked.
  * @return 1 if the system buid could be retrieved or 0 otherwise.

Next question to investigate is why does usbmuxd_read_buid fail?

Do you think you could add a call to libusbmuxd_set_debug_level(99)
to libimobiledevice, build it and reproduce the problem and provide
the debug output from libusbmuxd? This should give us an idea
where it's failing.

(For reference see implementation of usbmuxd_read_buid: 
http://anonscm.debian.org/gitweb/?p=pkg-gtkpod/packages/libusbmuxd.git;a=blob;f=src/libusbmuxd.c;h=6a6b3e686f95ddbdea2d11b5074f8016e24c795c;hb=HEAD#l1079
 )


Regards,
Andreas Henriksson




WARNING / LEGAL TEXT: This message is intended only for the use of the
individual or entity to which it is addressed and may contain
information which is privileged, confidential, proprietary, or exempt
from disclosure under applicable law. If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, you are strictly prohibited from disclosing,
distributing, copying, or in any way using this message. If you have
received this communication in error, please notify the sender and
destroy and delete any copies you may have received.

http://www.bsc.es/disclaimer


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#730756: libimobiledevice crash, fails to get buid from usbmuxd...

2014-05-02 Thread Andreas Henriksson
Hello Josep!

On Fri, May 02, 2014 at 12:03:35PM +0200, Josep M. Perez Cancer wrote:
 Hi,
 
 Apparently usbmuxd is not expecting the ReadBUID command:
 
 [11:56:02.254][4] New client on fd 14
 [11:56:18.430][5] Client command in fd 14 len 501 ver 1 msg 8 tag 10
 [11:56:18.430][1] Unexpected command 'ReadBUID' received!
 [11:56:18.430][5] send_pkt fd 14 tag 10 msg 8 payload_length 278
[...]

Thanks for the info!

 
 On 30/04/14 18:53, Andreas Henriksson wrote:
 Hello!
 
 Thanks for the backtrace you provided in your bug report!
 
 It looks to me like the problem is in this snippet from libimobiledevice
 src/lockdown.c :
 
  /* set SystemBUID */
  userpref_read_system_buid(system_buid);
  plist_dict_set_item(*pair_record, USERPREF_SYSTEM_BUID_KEY, 
  plist_new_string(system_buid));
[...]

Do you think you could rebuild libimobiledevice with the above code
changed to:

if (userpref_read_system_build(system_buid)) {
plist_dict_set_item(*pair_record, USERPREF_SYSTEM_BUID_KEY, 
plist_new_string(system_buid));
}

... and report back what happens?

(Sorry for not providing a proper patch, but I have very limited connection
right now.)

Would also be nice to have some information on which model of the
device you are using for testing!

The crash seems to have been introduced in:
https://github.com/libimobiledevice/libimobiledevice/commit/1331f6baa1799e41003aa812c0d1bf36193535ea

Regards,
Andreas Henriksson


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#730756: libimobiledevice crash, fails to get buid from usbmuxd...

2014-04-30 Thread Andreas Henriksson
Hello!

Thanks for the backtrace you provided in your bug report!

It looks to me like the problem is in this snippet from libimobiledevice
src/lockdown.c :

/* set SystemBUID */
userpref_read_system_buid(system_buid);
plist_dict_set_item(*pair_record, USERPREF_SYSTEM_BUID_KEY, 
plist_new_string(system_buid));

userpref_read_system_buid, which calls usbmuxd_read_buid, fails for some reason
and system_buid remains/becomes NULL and when it gets passed as an argument
to plist_new_string being NULL the code explodes.

The return code from userpref_read_system_buid should be checked.
 * @return 1 if the system buid could be retrieved or 0 otherwise.

Next question to investigate is why does usbmuxd_read_buid fail?

Do you think you could add a call to libusbmuxd_set_debug_level(99)
to libimobiledevice, build it and reproduce the problem and provide
the debug output from libusbmuxd? This should give us an idea
where it's failing.

(For reference see implementation of usbmuxd_read_buid: 
http://anonscm.debian.org/gitweb/?p=pkg-gtkpod/packages/libusbmuxd.git;a=blob;f=src/libusbmuxd.c;h=6a6b3e686f95ddbdea2d11b5074f8016e24c795c;hb=HEAD#l1079
 )


Regards,
Andreas Henriksson


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org