Pablito2020 / android_device_bq_krillin

🌲 device tree for the bq E4.5
11 stars 6 forks source link

some recent applications cause never-ending boot loop #13

Open tc-gd opened 6 years ago

tc-gd commented 6 years ago

Installation of some applications from F-Droid repository exposes system bug.

Symptoms are: In installation wizard, moment after pressing 'Install' button, message appears about 'Play Store' to unexpectedly end and reboot loop starts then.

Revert: Press volume up&down at the same time to get to Safe Mode, where you can uninstall problematic applications from Settings/Applications. After reboot all works again.

Workaround: Use some other version.

Affected applications I identified so far: Telegram, Orgzly

crash:

2-20 11:39:59.879   447   479 I DisplayPowerController: Unblocked screen on after 650 ms
12-20 11:40:02.233   447  1195 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@211145d attribute=android.view.inputmethod.EditorInfo@26831d2, token = android.os.BinderProxy@12ea6de
12-20 11:40:11.364   447   682 D ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 100]
12-20 11:40:16.348   447  1438 I ActivityManager: START u0 {act=org.fdroid.fdroid.installer.DefaultInstaller.action.INSTALL_PACKAGE dat=file:///data/user/0/org.fdroid.fdroid/files/Orgzly-1.6.apk cmp=org.fdroid.fdroid/.installer.DefaultInstallerActivity (has extras)} from uid 10077 on display 0
12-20 11:40:16.348   447  1438 W ActivityManager: startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=org.fdroid.fdroid.installer.DefaultInstaller.action.INSTALL_PACKAGE dat=file:///data/user/0/org.fdroid.fdroid/files/Orgzly-1.6.apk cmp=org.fdroid.fdroid/.installer.DefaultInstallerActivity (has extras) }
12-20 11:40:16.377   447  1203 I ActivityManager: Killing 3968:com.google.android.gms.unstable/u0a27 (adj 15): empty #17
12-20 11:40:16.431   447   812 D ActivityManager: cleanUpApplicationRecord -- 3968
12-20 11:40:16.437   447   782 I ActivityManager: START u0 {act=android.intent.action.INSTALL_PACKAGE dat=file:///data/user/0/org.fdroid.fdroid/files/Orgzly-1.6.apk cmp=com.android.packageinstaller/.PackageInstallerActivity (has extras)} from uid 10077 on display 0
12-20 11:40:18.320   447  1485 I ActivityManager: START u0 {dat=file:///data/user/0/org.fdroid.fdroid/files/Orgzly-1.6.apk flg=0x2000000 cmp=com.android.packageinstaller/.InstallAppProgress (has extras)} from uid 10017 on display 0
--------- beginning of crash
12-20 11:40:19.802  1759  1842 F libc    : invalid address or address of corrupt block 0x178 passed to dlfree
12-20 11:40:19.803  1759  1842 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadbaad in tid 1842 (AsyncTask #3)
12-20 11:40:19.911   160   160 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-20 11:40:19.911   160   160 F DEBUG   : LineageOS Version: '13.0-20170521-UNOFFICIAL-krillin'
12-20 11:40:19.911   160   160 F DEBUG   : Build fingerprint: '6.0.1/MMB29M/2419427:user/release-keys'
12-20 11:40:19.911   160   160 F DEBUG   : Revision: '0'
12-20 11:40:19.911   160   160 F DEBUG   : ABI: 'arm'
12-20 11:40:19.912   160   160 F DEBUG   : pid: 1759, tid: 1842, name: AsyncTask #3  >>> com.android.vending <<<
12-20 11:40:19.912   160   160 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xdeadbaad
12-20 11:40:19.959   160   160 F DEBUG   : Abort message: 'invalid address or address of corrupt block 0x178 passed to dlfree'
12-20 11:40:19.960   160   160 F DEBUG   :     r0 00000000  r1 00000000  r2 00000000  r3 00000002
12-20 11:40:19.960   160   160 F DEBUG   :     r4 00000178  r5 deadbaad  r6 b6d55f38  r7 9e604000
12-20 11:40:19.960   160   160 F DEBUG   :     r8 00000180  r9 9ebf2fbc  sl b6cb68db  fp b6cb68e4
12-20 11:40:19.960   160   160 F DEBUG   :     ip b6d505d8  sp 9ebf2ea8  lr b6d21075  pc b6d21074  cpsr 600f0030
12-20 11:40:19.977   160   160 F DEBUG   :
12-20 11:40:19.977   160   160 F DEBUG   : backtrace:
12-20 11:40:19.977   160   160 F DEBUG   :     #00 pc 00031074  /system/lib/libc.so (dlfree+1287)
12-20 11:40:19.978   160   160 F DEBUG   :     #01 pc 000157cd  /system/lib/libandroidfw.so (_ZN7android13ResStringPool6uninitEv+38)
12-20 11:40:19.978   160   160 F DEBUG   :     #02 pc 0001651d  /system/lib/libandroidfw.so (_ZN7android10ResXMLTree6uninitEv+14)
12-20 11:40:19.978   160   160 F DEBUG   :     #03 pc 0001653b  /system/lib/libandroidfw.so (_ZN7android10ResXMLTreeD1Ev+4)
12-20 11:40:19.978   160   160 F DEBUG   :     #04 pc 00013267  /system/lib/libandroidfw.so (_ZN7android12AssetManager10getPkgNameEPKc+258)
12-20 11:40:19.978   160   160 F DEBUG   :     #05 pc 000132c3  /system/lib/libandroidfw.so (_ZN7android12AssetManager18getBasePackageNameEj+62)
12-20 11:40:19.978   160   160 F DEBUG   :     #06 pc 00088943  /system/lib/libandroid_runtime.so
12-20 11:40:19.978   160   160 F DEBUG   :     #07 pc 71ec5c89  /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1f78000)
12-20 11:40:22.400   160   160 F DEBUG   :
12-20 11:40:22.400   160   160 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_03
12-20 11:40:22.406   447   475 I BootReceiver: Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)

tombstone_04.txt

tc-gd commented 6 years ago

It seems to be to this known issue: https://gitlab.com/fdroid/fdroiddata/issues/979

tc-gd commented 6 years ago

this could be required fix: https://git.replicant.us/replicant/frameworks_base/commit/?id=953d2a3493aaceb3209afc7eef1ff1e7f7242908

MagnusAlm commented 6 years ago

Thanks for pointing to this fix/workaround, I can now use Spotify with my Aquaris E4.5 and Lineage 13.0 and a couple other apps that sent my phone into a bootloop.

tc-gd commented 6 years ago

You're welcome. Problem is that I am still fighting with ROM compilation myself and build instructions are not much clear on this. Could you please help me with https://github.com/Pablito2020/android_device_bq_krillin/issues/14 in return?

Thanks in advance.

MagnusAlm commented 6 years ago

'#' Updated* (instructions taken from https://github.com/Pablito2020/pablito-scripts mm.sh and install-everything.sh the guide was there all along ;-))

'#' For building 13.0 on Ubuntu 17.10 '#' For building 14.1 replace 13.0 with 14.1 '#' Install libraries needed for compiling

sudo apt-get install -y git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven

sudo apt update sudo apt upgrade -y sudo apt-get install -y openjdk-8-jdk

mkdir lineage13.0 cd lineage13.0

# Check if the repo tool is installed, if it isn't installed then install it. if ! [ -f /bin/repo ]; then mkdir ~/bin PATH=~/bin:$PATH curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod 760 ~/bin/repo fi

'#' if building 14.1 you must add a user name and email berfore "repo init", not needed on 13.0. git config --global user.email "Your email @ here" git config --global user.name "Your name here"

repo init -u git://github.com/LineageOS/android.git -b cm-13.0 repo sync --force-sync

git clone https://github.com/Pablito2020/android_device_bq_krillin.git -b cm-13.0 device/bq/krillin git clone https://github.com/Pablito2020/android_kernel_bq_krillin.git -b cm-13.0 kernel/bq/krillin git clone https://github.com/Pablito2020/android_vendor_bq_krillin.git -b cm-13.0 vendor/bq/krillin git clone https://github.com/LineageOS/android_external_stlport.git -b cm-13.0 external/stlport

'#' I you need "su" on 13.0, edit "device/bq/krillin/device.mk" and add at the end:

# Superuser WITH_SU := true

'#' The minimum change to make 14.1 build, is to remove the following line from "device/bq/krillin/Boardconfig.mk"

BOARD_WLAN_DEVICE := MediaTek

'#' Start build

. build/envsetup.sh brunch lineage_krillin-userdebug

MagnusAlm commented 6 years ago

As for building 14.1, compile completes but after flashing it nothing happens after reboot. It won't even show the battery charging animation in off mode.

tc-gd commented 6 years ago

Thanks! This was exactly the piece of information I was missing!

sleep-walker commented 6 years ago

It got me further, but I ended soon with:

cts/tests/core/runner/Android.mk:18: *** BUILD_CTSCORE_PACKAGE must be defined.  Stop.
make: Leaving directory '/Devel/krillin/custom_rom'

#### make failed to build some targets (5 seconds) ####
MagnusAlm commented 6 years ago

@sleep-walker You get this error when building krillin for lineage 13 or 14.1?

sleep-walker commented 6 years ago

This was from 13 - following your guide literally.

MagnusAlm commented 6 years ago

I might have missed something essential then, I'll test it on another machine tonite.

sleep-walker commented 6 years ago

Thank you! I'll try to fix README after.

MagnusAlm commented 6 years ago

These seems to be missing from the guide I made:

I think those make it worse, I removed that ........

(I've not tested if this is the cause of Sleep-Walkers compiling problem.)

MagnusAlm commented 6 years ago

I haven't managed to reproduce Sleep-Walkers error but got some random crashes and lockups in a virtualbox machine I've setup tonite, probably because I forgot to install VBoxLinuxAdditions.run.

I'll know in the morning if that helped.

(It didn't, note to my self, don't use hard drives with faulty sectors...)

sleep-walker commented 6 years ago

Well, thanks that you have tried. I'm afraid that this is still something stupid but unrelated to system or installed build time dependencies.

$ cat .repo/local_manifests/bq_krillin.xml
<manifest>
    <!-- Device -->
    <!-- 13.0 -->
    <project path="device/bq/krillin" name="Pablito2020/android_device_bq_krillin" remote="github" revision="cm-13.0"/>
    <project path="kernel/bq/krillin" name="Pablito2020/android_kernel_bq_krillin" remote="github" revision="cm-13.0"/>
    <project path="vendor/bq/krillin" name="Pablito2020/android_vendor_bq_krillin" remote="github" revision="cm-13.0"/>

    <!-- 14.0
    <project path="device/bq/krillin" name="Pablito2020/android_device_bq_krillin" remote="github" revision="cm-14.0"/>
    <project path="kernel/bq/krillin" name="Pablito2020/android_kernel_bq_krillin" remote="github" revision="cm-14.1"/>
    <project path="vendor/bq/krillin" name="Pablito2020/android_vendor_bq_krillin" remote="github" revision="cm-14.1"/>
     -->
</manifest>

It leads to this output.txt.

This string is present only in:

Googling doesn't help. I'll try to install Ubuntu in container to build it but I'm afraid this is something implicit I miss.

MagnusAlm commented 6 years ago

@sleep-walker From your output.txt this doesn't look like standard Ubuntu 16.04: HOST_OS_EXTRA=Linux-4.13.12-1-default-x86_64-with-glibc2.2.5

Had a second try with a fresh virtualbox installation with Ubuntu 16.04, it worked.

sleep-walker commented 6 years ago

I am preparing my Ubuntu 16.04 chroot for try right now. My distro is openSUSE Tumbleweed, I installed matching packages. The build shouldn't be distribution specific...

MagnusAlm commented 6 years ago

No it shouldn't but what libraries that works changes sometimes.

If you whan't to use a rom that I built, you can find it here:

https://drive.google.com/file/d/1tcz2pE_vM-CW5hxH5jTB0ul60_l7OYiB/view?usp=sharing

tc-gd commented 6 years ago

It seems that building in Ubuntu chroot works. I can't identify the difference to my environment. Thanks for your patience.

There was also missing rsync and maybe others but I am building.

Thanks for your build - it will be useful for others for sure but I'd like to play more.

It seems that there are still power users of this phone but noone is maintaining any ROM from security perspective or other known problems.

I'd like to add also blueborne fix (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3), adjust speaker volume, etc.

(@tc-gd == @sleep-walker)

MagnusAlm commented 6 years ago

@sleep-walker Had any luck with building the rom?

I've made a blueborne patch for krillin kernel 13.0, it's on the google drive link a few post up, the file "bb_patch" if you'ld like to test it.

Used this as a template: https://github.com/KonstaT/android_kernel_huawei_msm8909/commit/c779e2e5095435970bdf1090b74e1d4877a3dc66

I'm building with it now, so I don't know yet if it works.

Update: It doesn't seem to break anything ;-p

sleep-walker commented 6 years ago

I finished the build of CM13 but my ROM build has problem with ADB (cannot authenticate fingerprint), cannot format SD card as internal and for some reason cannot install SuperSU for LineageOS. Besides that it is working well and seems to be faster.

MagnusAlm commented 6 years ago

Congratulations :-D

I've so far not used ADB, SuperSU or tried to use SD card as internal, but I could look into it if you could provide some more details. I have two of these phones, got the second one for testing stuff.

sleep-walker commented 6 years ago

Thanks!

I compared your ROM with mine and at least we have the same list of files - that is good start.

BTW. do you know what is status of CM14?

MagnusAlm commented 6 years ago

I've actually just a few minutes ago managed to boot a Frankenstein build, with some QnD patches to overcome the miss match of vendor 14.1 and device 14.1:

Pablito2020/android_device_bq_krillin cm-14.1 Pablito2020/android_kernel_bq_krillin cm-14.1 Pablito2020/android_vendor_bq_krillin cm-14.1

Buggy as hell tho, but you can make phone calls, send SMS, surf with wifi.

Not tested the install with gapps.

Sim data is of cource broken since vendor cm14.1 is missing bits and pieces for that with device 14.1. It reboots when you connect it to a pc with usb cable, but it pops up as a device in explorer after reboot.. No off mode battery animation, instead it boots up after charger is inserted.

Was built on a fresh Xubuntu 17.10 install with just the stuff from "pablito-scripts/install-everything.sh". The script in it self didn't work but I installed what it was supposed to install manually.

MagnusAlm commented 6 years ago

There was a patch for bootlooping apps added to cm-13.0 the twelfth of December last year.

https://review.lineageos.org/#/c/197386/

MagnusAlm commented 6 years ago

And I think I found the cause to the "off mode charging" bug on kernel cm-14.1.

https://github.com/Pablito2020/android_kernel_bq_krillin/issues/2

tc-gd commented 6 years ago

WITH_SU fixes me both ADB access and gaining root right.