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

Signal crashes few seconds after Launch. Cause corrupted signal-jobmanager.db #13762

Open
3 tasks done
tnixeu opened this issue Nov 1, 2024 · 5 comments · May be fixed by #13798
Open
3 tasks done

Signal crashes few seconds after Launch. Cause corrupted signal-jobmanager.db #13762

tnixeu opened this issue Nov 1, 2024 · 5 comments · May be fixed by #13798

Comments

@tnixeu
Copy link

tnixeu commented Nov 1, 2024

Guidelines

  • I have searched searched open and closed issues for duplicates
  • I am submitting a bug report for existing functionality that does not work as intended
  • This isn't a feature request or a discussion topic

Bug description

Since a recent Signal update, probably 7.17.4, Signal Crashes a few seconds after launch. Currently the phone runs 7.21.5. I have uploaded a log already in #13697, which shows that the signal-jobmanager.db is corrupted. I have uploaded the log again here:
log.txt. I am starting a new issue since is was stated that this is unrelated the bug in that issue.

Signal at first seems to start fine. It loads the full GUI and shows all recently received messages, even those received after Signals started crashing. However, few seconds later it crashes. New messages are also shown in the notifications bar, however, replying or "Mark as read" do not work. I was able to connect Signal to a PC, by being fast.

This leads me to believe that the database containing my messages is not affected. In #12435 it was stated, that the signal-jobmanager.db is used for pending message, which I now interpret as pending outgoing messages. As root it can be deleted, however, I am not root on this device.

I am looking for a way to fix the issue by deleting or recreating the affected database.

Screenshots

No response

Device

Samsung S7

Android version

8

Signal version

7.21.5

Link to debug log

https://github.com/user-attachments/files/17598807/log.txt

@rishabh-bhatia
Copy link

Hi there, sorry if this sounds obvious but have you tried to clear the cache? The logs seem to indicate that the issue is related to Encryption key/DB corruption. Clearing cache seems to be the only way you can safely force the app to reset tables without losing data. If you're looking to wipe signal-jobmanager.db without root access, you should be able to do that by modifying the code and compiling your own version of the app( If no official support is provided).

@tnixeu
Copy link
Author

tnixeu commented Nov 2, 2024

I have tried clearing the cache, however, it did not help. I just tired again.

I haven't tired something like this yet, because I think Android protectes against that.

@rishabh-bhatia
Copy link

Hey @greyson-signal is this a common occurrence? If so it could be affecting the UX on a larger scale. Quoting you from #12435 .

This is one of those cases where it's probably fine to delete it, but in general not-fine. It stores state about pending messages and such, and it could throw things out of whack.

Implies that in general we don't expect signal-jobmanager.db to be corrupted. So in the rare case where it does get corrupted, wouldn't it be a better option to delete it rather than getting the user to clear storage and lose all chats?

From what I could tell by looking at the code briefly, deleting this DB would not be "ideal"(Especially if it is deleted too often). However, in the rare case it does get corrupted then it needs to be deleted to protect everything else. In case signal-jobmanager.db is getting corrupted too often then this could indicate another bug.

@greyson-signal
Copy link
Contributor

It's definitely not great to lose that data, but I think you're right that it might be better here to reset that table. I'll make that change.

rishabh-bhatia added a commit to rishabh-bhatia/Signal-Android that referenced this issue Nov 19, 2024
…handling

Previously, JobDatabase used SqlCipherErrorHandler, which did not delete
corrupted `signal-jobmanager.db`. This fix ensures that SqlCipherDeletingErrorHandler
is used, which deletes the database upon corruption.

Closes signalapp#13762
@rishabh-bhatia
Copy link

Apologies for the direct PR. I spent some time on this issue sometime back and figured this might be a decent fix. Just added a couple of tests to my version of the fix i.e. delete the signal-jobmanager.db when corruption is detected through onCorruption. Corrupting the DB manually was not triggering a call to onCorruption in the error handlers which meant that the only way to verify that the solution works was by adding some Unit tests. Please feel free to take this change or propose any improvements whatsoever and I'll try to get back to you as soon as Possible.

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