Signal-android: Signal crashes on selecting group image from gallery

Created on 7 Jul 2020  路  12Comments  路  Source: signalapp/Signal-Android


Bug description

Signal crashes on setting a photo for a group

Steps to reproduce

  • go to group setting
  • edit group
  • edit photo
  • choose from gallery

Boom

Actual result: Signal crashes
Expected result: Signal should not crash

Screenshots

Device info

Device: Huawei P30 Pro, VOG-L29
Android version: 10.1.0.123
Signal version: 4.65.2

Link to debug log

https://debuglogs.org/61484b394562b7a1bc6b5bf65e15f67df856fd2aef0dfc7521b89104b03a7132

Most helpful comment

This is caused by onSaveInstanceState method of EditProfileFragment. If image size exceeds 1MB it throws TransactionTooLargeException and causes crash. Comment outing this method solves the problem.

All 12 comments

Crash happens around 22:35:12.

Can confirm same issue on:

Google Pixel 3a
Android 10
Signal 4.67.1

Same here

Samsung Galaxy S10e
Android 10
Signal 4.68.4

Same

Google Pixel 3a
Android 11
Signal 4.70.5

@phraemer could you provide a debug log with the crash?

Looking for some help in reproducing this issue, as I'm unable to, so I'm guessing there's something unique/different y'all are doing that I'm not. Some quick questions:

  1. Does it always crash?
  2. Does it crash for every image you pick? Can you try small and large images.
  3. Does it crash when taking a picture?

Thanks!

Hi @cody-signal

  1. I think so yes. It may have on some occasions just gone back one screen but I'm not sure.
  2. It crashed when opening the gallery before any image can be selected
  3. Yep. Again, while opening the camera.

https://debuglogs.org/3bd57e7b74ea2783254e7a9e08c0ba5becc87b7163175b13ff1a6aaf4c10a5f7

This is caused by onSaveInstanceState method of EditProfileFragment. If image size exceeds 1MB it throws TransactionTooLargeException and causes crash. Comment outing this method solves the problem.

If image size exceeds 1MB it throws

It crashes before an image is even selected from the gallery or a photo taken.
Is it using the current image and that is > 1MB?

@phraemer It is not about the gallery or photo taken. It is about existing avatar.

Following converts existing avatar to byte array, and buffer has 1Mb limit, so it throws an exception.

outState.putByteArray(AVATAR_STATE, viewModel.getAvatarSnapshot());

To find root cause, I used TooLarge tool mentioned on https://stackoverflow.com/a/50162810/1648708

I found a 100 % reproducible scenario:

  1. (crucial point) create a group WITH large photo
  2. go to group settings
  3. edit photo
  4. choose from gallery
    ...
    crash

This is fixed in the upcoming 4.72 release, thanks!

Was this page helpful?
0 / 5 - 0 ratings