#308 ✓resolved
chris

afc_receive_data() failed with "ERROR: usbmuxd_recv returned -11" on windows (MinGW)

Reported by chris | January 7th, 2013 @ 03:25 AM | in 1.4.0 Release

I compiled libimobiledevice with MinGW under windows, and then I compiled idevice_id, housearresttest and ideviceinstaller. For me, idevice_id works well, ideviceinstaller can get apps list but it can't get directory info, and housearresttest failed at afc_receive_data() - internal_connection_receive(): ERROR: usbmuxd_recv returned -11

Here's the log (housearresttest):

10:54:01 property_list_service.c:145 internal_plist_send(): sending 298 bytes
10:54:01 property_list_service.c:150 internal_plist_send(): sent 298 bytes
10:54:01 property_list_service.c:151 internal_plist_send(): printing 298 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<key>Command</key>
<string>VendDocuments</string>
<key>Identifier</key>
<string>com.apple.iBooks</string>



10:54:01 property_list_service.c:227 internal_plist_receive_timeout(): initial read=4
10:54:01 property_list_service.c:236 internal_plist_receive_timeout(): 234 bytes following
10:54:01 property_list_service.c:245 internal_plist_receive_timeout(): received 234 bytes
10:54:01 property_list_service.c:259 internal_plist_receive_timeout(): printing 234 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<key>Status</key>
<string>Complete</string>



10:54:01 afc.c:45 afc_lock(): Locked
10:54:01 afc.c:255 afc_dispatch_packet(): doin things the old way
10:54:01 afc.c:256 afc_dispatch_packet(): packet length = 42
10:54:01 afc.c:271 afc_dispatch_packet(): packet data follows
10:54:01 idevice.c:407 internal_connection_receive(): ERROR: usbmuxd_recv returned -11 (Resource temporarily unavailable)
10:54:01 afc.c:305 afc_receive_data(): Just didn't get enough.
10:54:01 afc.c:60 afc_unlock(): Unlocked
Directory contents:
0000: 43 46 41 36 4c 50 41 41 2a 00 00 00 00 00 00 00 | CFA6LPAA.......
0010: 2a 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |
...............
0020: 03 00 00 00 00 00 00 00 | ........

0000: 2f 00 | /.

Comments and changes to this ticket

  • chris

    chris January 7th, 2013 @ 08:55 AM

    Looks like some problem with byte order. I took a snapshot with usb snoopy, attached.

  • chris

    chris January 7th, 2013 @ 09:58 AM

    By temporarily undefine AFCPacket_to/from_LE, afc works properly. I don't know whether there's some problem in my compiling process, wait for your reply, thanks!

  • Martin S.

    Martin S. March 18th, 2013 @ 04:00 PM

    • State changed from “new” to “open”
    • Tag set to afc, endianess
    • Milestone set to 1.4.0 Release

    Could you elaborate how you compile? Do you use autotools?

  • chris

    chris March 19th, 2013 @ 11:10 AM

    I didn't use autotools for libimobiledevice library, (I used the shell scripts in the tar.gz package instead).
    My compling process is as follows:

    (libimobiledevice, using MinGW)

    ./autogen.sh ./configure LDFLAGS="-L/c/Python27/libs" --prefix=/usr/local --enable-debug-code --without-cython --with-gnu-ld --disable-shared --enable-silent-rules --disable-dependency-tracking make install-pkgconfigDATA && cd src && make install

    BTW, do you see this ticket #309 ? I found that "__LITTLE_ENDIAN__" in endianness.h may be the reason for this issue. The endianness.h header file is in the tar.gz package file, and it isn't generated by autotools.

  • chris

    chris March 19th, 2013 @ 11:13 AM

    I copied three line of shell scripts above, but I don't know why the "\n" chars are missing.

  • Martin S.

    Martin S. March 19th, 2013 @ 02:21 PM

    Yes, I have seen #309, however the endianess is set by configure/autotools.
    I suspect that the problem is in the way you compile the library, as endianness.h appears to be fine.
    Could you paste the output of ./configure ... ?

    You might want to check the formatting guide (see link above comment textfield) how to paste pre-formatted text properly, too.

  • chris

    chris March 19th, 2013 @ 03:22 PM

    The ./autogen.sh script fires a error like Python package problem, so I run ./configure with some arguments:

    ./configure LDFLAGS="-L/c/Python27/libs" --prefix=/usr/local --enable-debug-code --without-cython --with-gnu-ld --disable-shared --enable-silent-rules --disable-dependency-tracking

    I pasted the outputs below, and attached the logs(include config.log)

    ./autogen.sh outputs:

    libtoolize: putting auxiliary files in `.'.
    libtoolize: linking file `./ltmain.sh'
    libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
    libtoolize: linking file `m4/libtool.m4'
    libtoolize: linking file `m4/ltoptions.m4'
    libtoolize: linking file `m4/ltsugar.m4'
    libtoolize: linking file `m4/ltversion.m4'
    libtoolize: linking file `m4/lt~obsolete.m4'
    configure.ac:25: installing `./compile'
    configure.ac:26: installing `./config.guess'
    configure.ac:26: installing `./config.sub'
    configure.ac:6: installing `./install-sh'
    configure.ac:6: installing `./missing'
    cython/Makefile.am: installing `./depcomp'
    checking for a BSD-compatible install... /bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.exe
    checking for suffix of executables... .exe
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking dependency style of g++... gcc3
    checking whether gcc and cc understand -c and -o together... yes
    checking build system type... i686-pc-mingw32
    checking host system type... i686-pc-mingw32
    checking how to print strings... printf
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... c:/mingw/mingw32/bin/ld.exe
    checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /mingw/bin/nm
    checking the name lister (/mingw/bin/nm) interface... BSD nm
    checking whether ln -s works... no, using cp -p
    checking the maximum length of command line arguments... 8192
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format... func_convert_file_msys_to_w32
    checking how to convert i686-pc-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
    checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
    checking for dlltool... dlltool
    checking how to associate runtime and link libraries... func_cygming_dll_for_implib
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /mingw/bin/nm output from gcc object... ok
    checking for sysroot... no
    checking for mt... no
    checking if : is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... no
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
    checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... yes
    checking dynamic linker characteristics... Win32 ld.exe
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... c:/mingw/mingw32/bin/ld.exe
    checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
    checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
    checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
    checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
    checking if g++ static flag -static works... yes
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
    checking dynamic linker characteristics... Win32 ld.exe
    checking how to hardcode library paths into programs... immediate
    checking pkg-config is at least version 0.9.0... yes
    checking for libusbmuxd... yes
    checking for libplist... yes
    checking for libplistmm... yes
    checking for pthread_create, pthread_mutex_lock in -lpthread... yes
    checking for ANSI C header files... (cached) yes
    checking for stdint.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking gcrypt.h usability... yes
    checking gcrypt.h presence... no
    configure: WARNING: gcrypt.h: accepted by the compiler, rejected by the preprocessor!
    configure: WARNING: gcrypt.h: proceeding with the compiler's result
    checking for gcrypt.h... yes
    checking for an ANSI C-conforming const... yes
    checking for size_t... yes
    checking for ssize_t... yes
    checking for uint16_t... yes
    checking for uint32_t... yes
    checking for uint8_t... yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible realloc... yes
    checking for strcasecmp... yes
    checking for strdup... yes
    checking for strerror... yes
    checking for strndup... no
    checking for asprintf... no
    checking for vasprintf... no
    checking endian.h usability... no
    checking endian.h presence... no
    checking for endian.h... no
    checking for a Python interpreter with version >= 2.3... python2
    checking for python2... /c/Python27/python2
    checking for python2 version... 2.7
    checking for python2 platform... win32
    checking for python2 script directory... ${prefix}\Lib\site-packages
    checking for python2 extension module directory... ${exec_prefix}\Lib\site-packages
    checking for cython... no
    configure: WARNING: cannot find 'cython' program. You should look at http://www.cython.org or install your distribution specific cython package.
    checking for python2.7... (cached) /c/Python27/python2
    checking for a version of Python >= '2.1.0'... yes
    checking for the distutils Python package... yes
    checking for Python include path... -Ic:\Python27\include
    checking for Python library path... -Lc:\Python27\Lib -lpython27
    checking for Python site-packages path... c:\Python27\Lib\site-packages
    checking python extra libraries... None None
    checking python extra linking flags... None
    checking consistency of all components of python development environment... no
    configure: error: 
      Could not link test program to Python. Maybe the main Python library has been
      installed in some non-standard library path. If so, pass it to configure,
      via the LDFLAGS environment variable.
      Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
      ============================================================================
       ERROR!
       You probably have to install the development version of the Python package
       for your distribution.  The exact name of this package varies among them.
      ============================================================================
    

    ./configure outputs:

    checking for a BSD-compatible install... /bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.exe
    checking for suffix of executables... .exe
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... none
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking dependency style of g++... none
    checking whether gcc and cc understand -c and -o together... yes
    checking build system type... i686-pc-mingw32
    checking host system type... i686-pc-mingw32
    checking how to print strings... printf
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... c:/mingw/mingw32/bin/ld.exe
    checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /mingw/bin/nm
    checking the name lister (/mingw/bin/nm) interface... BSD nm
    checking whether ln -s works... no, using cp -p
    checking the maximum length of command line arguments... 8192
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format... func_convert_file_msys_to_w32
    checking how to convert i686-pc-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
    checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
    checking for dlltool... dlltool
    checking how to associate runtime and link libraries... func_cygming_dll_for_implib
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /mingw/bin/nm output from gcc object... ok
    checking for sysroot... no
    checking for mt... no
    checking if : is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... no
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
    checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
    checking dynamic linker characteristics... Win32 ld.exe
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... no
    checking whether to build static libraries... yes
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... c:/mingw/mingw32/bin/ld.exe
    checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
    checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
    checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
    checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
    checking if g++ static flag -static works... yes
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
    checking dynamic linker characteristics... Win32 ld.exe
    checking how to hardcode library paths into programs... immediate
    checking pkg-config is at least version 0.9.0... yes
    checking for libusbmuxd... yes
    checking for libplist... yes
    checking for libplistmm... yes
    checking for pthread_create, pthread_mutex_lock in -lpthread... yes
    checking for ANSI C header files... (cached) yes
    checking for stdint.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking gcrypt.h usability... yes
    checking gcrypt.h presence... no
    configure: WARNING: gcrypt.h: accepted by the compiler, rejected by the preprocessor!
    configure: WARNING: gcrypt.h: proceeding with the compiler's result
    checking for gcrypt.h... yes
    checking for an ANSI C-conforming const... yes
    checking for size_t... yes
    checking for ssize_t... yes
    checking for uint16_t... yes
    checking for uint32_t... yes
    checking for uint8_t... yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible realloc... yes
    checking for strcasecmp... yes
    checking for strdup... yes
    checking for strerror... yes
    checking for strndup... no
    checking for asprintf... no
    checking for vasprintf... no
    checking endian.h usability... no
    checking endian.h presence... no
    checking for endian.h... no
    checking for openssl... yes
    checking for supported compiler flags...  -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter
    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... unknown
    checking for _LARGE_FILES value needed for large files... unknown
    checking for _LARGEFILE_SOURCE value needed for large files... unknown
    checking whether make supports nested variables... (cached) yes
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating src/Makefile
    config.status: creating include/Makefile
    config.status: creating dev/Makefile
    config.status: creating tools/Makefile
    config.status: creating cython/Makefile
    config.status: creating docs/Makefile
    config.status: creating libimobiledevice-1.0.pc
    config.status: creating doxygen.cfg
    config.status: creating config.h
    config.status: executing depfiles commands
    config.status: executing libtool commands
    
    Configuration for libimobiledevice 1.1.4:
    -------------------------------------------
    
      Install prefix: .........: /usr/local
      Debug code ..............: yes
      Dev tools ...............: no
      Python bindings .........: no
      SSL support .............: OpenSSL
    
      Now type 'make' to build libimobiledevice 1.1.4,
      and then 'make install' for installation.
    
  • Martin S.

    Martin S. March 19th, 2013 @ 05:10 PM

    • Assigned user set to “Martin S.”

    Ok, thanks a lot.

    Please try to change configure.ac line 59 from:

    if test "x$ac_cv_have_endian" = "xno"; then
    
    into
    if test "x$ac_cv_have_endian_h" = "xno"; then
    
    and don't forget to run autogen.sh again.

    This might fix this issue.

  • Martin S.

    Martin S. March 19th, 2013 @ 05:37 PM

    • State changed from “open” to “resolved”

    This typo prevented configure.ac from properly advancing to the manual byte order detection code.
    This should be fixed in git master now.

    Please still report if that fixes your issue. Thanks for reporting this!

  • chris

    chris March 20th, 2013 @ 04:38 AM

    I changed configure.ac with your suggestion, it's OK now. 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.

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

Tags

Referenced by

Pages