signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.33k stars 6.08k forks source link

App hangs (in infinite loop?) on startup #13487

Open jethrogb opened 5 months ago

jethrogb commented 5 months ago

Bug description

After upgrading to Signal Android 7.1.3 (which happened overnight according to the Play Store), I'm no longer able to successfully launch the Signal app. It hangs indefinitely on startup. Also, if there is a "Checking for incoming messages" notification, it never goes away. The phone gets quite warm as well.

Steps to reproduce

Actual result: Black screen with white Signal logo shows, indefinitely Expected result: The app launches

Screenshots

screenshot

Device info

Device: Asus Zenfone 10 Android version: 14 Signal version: 7.1.3

Link to debug log

I'm not able to get to the debug log in Signal settings. Here is the logcat output for the Signal process signal.log

I see a lot of messages from AnrDetector, not sure if those are related.

I have tried the following things to no avail:

jethrogb commented 5 months ago

Ok I know understand that the AnrDetector just detects hangs and outputs some stack traces. The top of stack is net.zetetic.database.sqlcipher.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:301) which is https://github.com/signalapp/sqlcipher-android/blob/74f27c3bc58a720446818b469da22ed58c73d72f/sqlcipher/src/main/java/net/zetetic/database/sqlcipher/SQLiteOpenHelper.java#L301, so it does indeed appear to be some kind of deadlock.

nicholas-signal commented 5 months ago

Does it still occur if you disconnect from the internet completely (enable airplane mode)?

jethrogb commented 5 months ago

@nicholas-signal Indeed so, and you can also see a lot of Websocket exceptions in the log.

nicholas-signal commented 5 months ago

@nicholas-signal Indeed so, and you can also see a lot of Websocket exceptions in the log.

Thanks for confirming. We're on it!

jethrogb commented 4 months ago

@nicholas-signal Could you re-sign 7.0.2 with a higher version number so I can upgrade to it?

greyson-signal commented 4 months ago

I don't intend on re-releasing an older version, sorry. From your logs though, I think I see the root of the issue, and I'm putting a fix into 7.2.3, which will be rolling out to production over the next few days. Apologies, and thank you!

jethrogb commented 4 months ago

@greyson-signal I just updated to 7.2.3 but unfortunately things are still not working. The first time I launched the new version, I got the prompt "Signal encountered an error, would you like to submit debug logs?" I clicked submit but the app crashed shortly thereafter so I'm not sure if that worked.

Now I get to the Signal main UI, but the chat list is completely empty. The 3 dots menu works, as do the following commands:

Screenshot

signal2.log

jethrogb commented 4 months ago

Any chance of enabling a rollback to a pre-regression version? How long will my desktop app keep working without the Android app?

jethrogb commented 4 months ago

@greyson-signal @nicholas-signal Any update on this issue?

clark-signal commented 4 months ago

I took a quick look at your logs, looks like it's still in the migration. What happens if you leave your phone open for a while? Make sure it stays in the foreground

jethrogb commented 4 months ago

@clark-signal I was able to log a crash after waiting for a bit signal3.log

jethrogb commented 4 months ago

And here's another log with the OOM happening with the migration still ongoing signal4.log

jethrogb commented 4 months ago

And another in airplane mode with display timeout set to 10 mins. This has an interesting log item during OOM:

04-22 17:10:09.388 19883 19918 E SQLiteLog: (3082) statement aborts at 11: [DROP TABLE kyber_prekey] 

signal6.log

jethrogb commented 4 months ago

So I'm sure you've already reached this conclusion, but I'm guessing (due to the amount of time the migration takes and the fact that it OOMs there) that my kyber_prekey table is much larger than assumed by the code.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jethrogb commented 2 months ago

Triage: problem remains in 7.9.6 signal7.log

jethrogb commented 1 week ago

I was able to use CVE-2024-31317 to export the Signal files from my phone. I can share them if you tell me how I can appropriately redact personal information from them.

I did already see this:

sqlite> SELECT COUNT(*),SUM(LENGTH(serialized)) FROM kyber_prekey;
332990|1606343466

Is it normal that I have 300k keys totalling 1.6GB?

jethrogb commented 1 week ago

From the timestamps, I can see that 99% of those keys were created around the time of https://github.com/signalapp/Signal-Android/issues/13434

cody-signal commented 1 week ago

Whoa....just whoa...

Thanks for the extra details and sticking with it. Gives us a new place to jump off from and investigate.