adb backup only creates 2GB file then hangs

Bug #1617905 reported by Tharrrk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
android-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

$ arch
i686

$ apt-cache policy android-tools-adb
android-tools-adb:
  Installed: 5.1.1r36+git20160322-0ubuntu3tharrrk1
  Candidate: 5.1.1r36+git20160322-0ubuntu3tharrrk1
  Version table:
 *** 5.1.1r36+git20160322-0ubuntu3tharrrk1 100
        100 /var/lib/dpkg/status
     5.1.1r36+git20160322-0ubuntu3 500
        500 http://mt.archive.ubuntu.com/ubuntu xenial/universe i386 Packages

BUG DESCRIPTION:
================
At least on i386 the files created by adb backup are limited to 2GB.
It seems adb is not built with -D_FILE_OFFSET_BITS=64.
This is basically a duplicate of bug in Debian # 700461 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700461) originally reported in ___2013___

FIX:
====
update makefile:

$ diff -Nurp android-tools-5.1.1r36+git20160322.orig android-tools-5.1.1r36+git20160322
diff -Nurp android-tools-5.1.1r36+git20160322.orig/debian/makefiles/adb.mk android-tools-5.1.1r36+git20160322/debian/makefiles/adb.mk
--- android-tools-5.1.1r36+git20160322.orig/debian/makefiles/adb.mk 2016-08-29 08:32:27.380451578 +0200
+++ android-tools-5.1.1r36+git20160322/debian/makefiles/adb.mk 2016-08-26 12:04:54.103221453 +0200
@@ -34,6 +34,9 @@ CPPFLAGS+= -I.
 CPPFLAGS+= -I../adb
 CPPFLAGS+= -I../include
 CPPFLAGS+= -I../../../external/zlib
+CPPFLAGS+= -D_FILE_OFFSET_BITS=64
+
+CFLAGS+= -D_FILE_OFFSET_BITS=64

 LIBS+= -lc -lpthread -lz -lcrypto

---
RESULT:
=======
After I rebuilt the package and installed local version (as shown above) the process works and my data are ALL backed up.
Anybody willing to go through the same process before the package is fixed in Ubuntu - good sources are:
- https://help.ubuntu.com/community/UpdatingADeb
- https://raphaelhertzog.com/2010/12/15/howto-to-rebuild-debian-packages/
My package:
https://tharrrk.net/stuff/ubuntu/android-tools-adb_5.1.1r36+git20160322-0ubuntu3tharrrk1_i386.deb

Tharrrk (tharrrk)
description: updated
Revision history for this message
Tom (tom-reportbug) wrote :

Your package also froze in the same spot (1.9G) for me.

Revision history for this message
Tharrrk (tharrrk) wrote :

@Tom can you confirm no other version of adb is installed?
You might need to uninstall adb (different package providing the same binary) package and/or system-wide version of android-tools-adb prior to running dpkg -i

$ which adb
$ readlink -f `which adb`

$ dpkg -l \*adb
$ apt-cache policy android-tools-adb
$ dpkg -L android-tools-adb

What OS version, arch and kernel are you using?

$ lsb_release -rd || cat /etc/*release
$ arch
$ uname -ovr

What filesystem are you backing up to?

It certainly works here and this is the way to confirm adb is using open64 calls:

# readelf -a `which adb`|grep open
08073040 00000e07 R_386_JUMP_SLOT 00000000 open64@GLIBC_2.1
08073090 00002407 R_386_JUMP_SLOT 00000000 fopen64@GLIBC_2.1
08073114 00004707 R_386_JUMP_SLOT 00000000 opendir@GLIBC_2.0
0807319c 00006907 R_386_JUMP_SLOT 00000000 __open64_2@GLIBC_2.7
    14: 00000000 0 FUNC GLOBAL DEFAULT UND open64@GLIBC_2.1 (3)
    36: 00000000 0 FUNC GLOBAL DEFAULT UND fopen64@GLIBC_2.1 (3)
    71: 00000000 0 FUNC GLOBAL DEFAULT UND opendir@GLIBC_2.0 (2)
   105: 00000000 0 FUNC GLOBAL DEFAULT UND __open64_2@GLIBC_2.7 (7)

Hope it helps.
Tharrrk

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.