Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to/ Installation of newest version breaks system #7171

Closed
2 tasks done
demaddis opened this issue Nov 10, 2017 · 26 comments
Closed
2 tasks done

Update to/ Installation of newest version breaks system #7171

demaddis opened this issue Nov 10, 2017 · 26 comments

Comments

@demaddis
Copy link

demaddis commented Nov 10, 2017

I have:


Bug description

I updated some apps from the Play Store yesterday, shortly after the Signal update started, the Cyanogenmod boot animation was displayed (notification bar and on-screen buttons on top, but unresponsive). I waited a few minutes until I hard rebooted the phone. After booting, the regular "Enter PIN" screen + background was displayed shortly, then again the background changed to the boot animation and the device became unresponsive to touchscreen input. A few seconds later the background changed to black. I rebooted several times, wiped cache and Dalvik cache from CWM, but to no avail.
I finally did a factory reset, after which the phone worked normally again. Assuming the issue wasn't due to this specific update, I later reinstalled Signal from the Play Store, which resulted in a broken system all over again.

Steps to reproduce

  • Update or install current Signal version (on CM11)

Actual result: Boot animation is displayed and system becomes unresponsive
Expected result: Signal is updated/installed

Device info

Device: Sony Xperia Z1 Compact
Android version: 4.4.4 (CM 11-20141112-SNAPSHOT-M12-amami)
Signal version: 4.11.5

Link to debug log

NA

@kepler2
Copy link

kepler2 commented Nov 11, 2017

Hello!

+1 here, i suspect the latest version just breaks the system. Please read below!

Steps to reproduce

Update / install current Signal version (on CM 12.1)

Actual result: While installing, or right after installing, the device power-cycles. Note that after rebooting, the system is unresponsive and restarts randomly (after reaching home screen)

Expected result: Signal installs and doesn't cause any stability issue.

NOTES:

  1. I had Signal already installed on the SD card, updated it from the Play Store, then the phone rebooted by itself.
  2. I tried to remove Signal but can't, as the system is unresponsive after reboot and there is no time to uninstall it.
  3. I managed to make the device working by deleting the Signal ASEC file from the SD card.
  4. Re-installed Signal from Play Store (on the internal storage)
  5. After installing it (note that the smartphone was stable before re-installing), the device reboots.
  6. The smartphone boots very very slowly, in case it reaches the Home screen it reboots. Basically power-cycles every time...
  7. I tried to wipe Cache / Dalvik cache - no change...
  8. Phone can't be used anymore :).

The only update I did on is Signal, so i suspect this is the problem.

Is there a way to remove Signal from the internal storage?

Guys, thanks, you are doing wonderful work, but the latest version just broke my phone :(.

Please help!

Thanks!

Device info

Device: HTC Sensation
Android version: 5.1.1 (CyanogenMod 12.1)
Signal version: Latest (from Play Store)

Debug Log
I cannot provide a debug log as the device power-cycles after reaching home screen, with Signal installed.

@mlsxlist
Copy link

See the same issue on a Samsung Galaxy SII GT-I9100 with cyanogenmod 11.0 aka Android 4.4.4. After the installation of signal 4.12.3 the device was in a boot loop that ended at some point. Now when I start Signal the phone again reboots many times.

@kepler2
Copy link

kepler2 commented Nov 12, 2017

I think this issue should be investigated, basically I can't use my CM 12.1 smartphone now, it reboot every time. I had to factory reset the device from TWRP in order to get things going.
Note that the previous version was OK.

I think this issue affects many users with Cyanogenmod.

Thanks guys

@slio
Copy link

slio commented Nov 12, 2017

Just find out the related bug report: https://issuetracker.google.com/issues/64434571

Workaround:

If you need to build with 3.0 but are running into this bug you can disable aapt2 using -Pandroid.enableAapt2=false on the command line when doing your build.

Explanation:

CyanogenMod has this function getPkgName (https://github.com/CyanogenMod/android_frameworks_base/blob/cm-13.0/libs/androidfw/AssetManager.cpp). It creates a ResXMLTree on the stack and points it at a buffer from an asset without making a copy. Then it closes the asset before the ResXMLTree is destroyed.

For apps built by aapt, this is benign. However, aapt2 produces UTF-8 string pools, which cause the ResXMLTree's ResStringPool(mStrings)'s mCache to become non-null in ResStringPool::stringAt (https://github.com/CyanogenMod/android_frameworks_base/blob/cm-13.0/libs/androidfw/ResourceTypes.cpp). Then ResStringPool::uninit dereferences mHeader (which is now dangling), and a crash ensues.

This crash shows up in different ways. On one Cyanogen OS device, the launcher crashes when an app built with aapt2 has been installed, but only if the manifest is large (probably due to how deallocation happens for small vs large blobs). On another device, system_server crashes at boot if an aapt2-built app is installed.

Credits to @pihug12

Maybe this should help.
See here Haptic-Apps/Slide#2563

@code-spotting
Copy link

Same issue here.

@moxie0
Copy link
Contributor

moxie0 commented Nov 12, 2017

Looks like this is a CM memory corruption bug that is triggered by any APK built with the current Android developer tools. It looks like the Cyanogen people are working on a fix, but it appears that they've known about this since late September.

@kepler2
Copy link

kepler2 commented Nov 13, 2017

Nice that you guys found the reason behind this. My question is now, how can i install an older working apk? I need this app :).

Thanks!

@patzi
Copy link

patzi commented Nov 13, 2017

This bug hit me as well, It hit me with other app updates already:
Twidere
DAVdroid

I had to downgrade my Signal and wanted to keep my data. This is what I did:

  1. boot into TWRP, and mount /data partition
  2. in TWRP under Advanced > Filemanager go to folder /data/app/org.thoughtcrime.securesms and delete that folder. Do not delete /data/data/org.thought... that would delete your data.
  3. Reebot into system and install old version (4.11.5) via adb
    adb install -r Signal-website-release-4.11.5.apk

Now old Singal version is there but the data doesn't belong to the signal-app-android-user

  1. use https://github.com/jensstein/oandbackup the backup signal data
  2. restore signal data with oandbackup

This is how I downgraded my signal and kept data
I could not just downgrade via adb like described here in the first 4 steps because my phone was stuck in a bootloop.
Sadly this works only with root, because of oandbackup.

@kepler2
Copy link

kepler2 commented Nov 13, 2017

Guys, only version 4.12.3 causing issues? I want to install an older version now. Is 4.11.5 or 4.11.3 ok?

Can you please provide a link to the correct APK so i can install it?

Thanks a lot!

@patzi
Copy link

patzi commented Nov 13, 2017

For me 4.11.5 was the last working version before 4.12.3. You can get in via signal page: https://updates.signal.org/android/Signal-website-release-4.11.5.apk

@demaddis
Copy link
Author

I just reverted to 4.11.5, can confirm this version works without causing the issue.

@haffenloher
Copy link
Contributor

It looks like the Cyanogen people are working on a fix, but it appears that they've known about this since late September.

According to the link to Google's issue tracker posted by @slio, Google seems to have added a workaround in version 27 of the build tools.

@kepler2
Copy link

kepler2 commented Nov 14, 2017

@patzi Thanks, I managed to install the version from your comment, all OK now. So, is there a fix for this in the next versions, or something like that?

Guys, thanks again for your work.

@motatuc
Copy link

motatuc commented Nov 15, 2017

Yeah, seems to work with build-tools 27.0.1. No problems with the app so far.

One thing though. The build process for signal changed, right? For me the build process never gets more then 85% and then displays: Lint and IDLE and runs forever. Is this a problem with my setup?

@kepler2
Copy link

kepler2 commented Nov 30, 2017

Hello guys. Do you know if updating to the latest version: 4.13.16 still causes this issue? Thanks!

@H5chnier
Copy link

thanks for your comments on this issue. I'd like to update my android with the build-tools 27.0.1. but I have no idea how to do it. Could you help me?

@tezeb
Copy link

tezeb commented Dec 6, 2017

Just tried with version: 4.13.6 and unfortunately it still crashes the same way.

It is Android 5.1.1(CM12.1).

@moxie0
Copy link
Contributor

moxie0 commented Dec 6, 2017

This is a bug in Cyanogen. Please contact them for help with a resolution.

@moxie0 moxie0 closed this as completed Dec 6, 2017
@patzi
Copy link

patzi commented Dec 8, 2017

As far as I know this bug should not be triggered any more with build-tools version >= 27.0.1 see i.e. comments @ DAVdroid.
So maybe with 2b80e98 this is fixed and signal versions >= 4.14.0 are good to use.
But I haven't tried so far.

@H5chnier
Copy link

H5chnier commented Dec 9, 2017

@patzi: I tried today again to update signal and it crashed again

@patzi
Copy link

patzi commented Dec 9, 2017

@H5chnier how did you try to update and to which version? As I can see it 4.13.6 is the latest version available from playstore, at least for me. So if you updated via playstore you most probably didn't get a version greater than 4.14.0 and that is the lowest possible version with 2b80e98 included. I think its still a beta release.

@H5chnier
Copy link

@patzi: You're right. I am sorry, it was my fault. Indeed I tried to update 4.13.6 and not 4.14.0 via Playstore.

@kepler2
Copy link

kepler2 commented Dec 15, 2017

Hello guys. @patzi @H5chnier Guys can you confirm if the latest version is no longer creating issues on Cyanogenmod? :) Thanks a lot!l (Version 4.14.7 seems to be the latest version in Google Play)

@H5chnier
Copy link

H5chnier commented Dec 15, 2017

@kepler2 in my playstore 4.13.6 is still the most recent update. that does definitely not work. I haven't tried 4.13.7, which I suppose you were talking about!? You can download 4.11.5 from patzis post above, which works for me right now. Backup your data before trying anything

@kepler2
Copy link

kepler2 commented Dec 19, 2017

@H5chnier The latest version is 4.14.8. Indeed, 4.11.5 works fine on Cyanogenmod. But i think updates, especially on a secure messaging app is important, right? :) Please let me know if you risk your phone to see if the latest version works :> Thanks

@kepler2
Copy link

kepler2 commented Jan 16, 2018

Hello all. @H5chnier @patzi and whoever uses Cyanogenmod :). Latest version (4.14.10) works fine on CM 12 (5.1.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests