Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Intolerance against crashed services

Open lablans opened this issue 12 years ago • 6 comments

TextSecure is not robust if its services are crashed/quitted. This may cause all kinds of bugs.

For example, follow the following steps to reproduce two problems.

  1. Bob: Kill service "KeyCachingService", but leave the "SendReceiveService" running
  2. Alice: Send message to Bob.
  3. Bob doesn't receive the message (delayed, issue #970)
  4. Bob: Restart phone.
  5. Bob: Receives bad encrypted messages (issue #763, a combination of cases 3 and 4).

I've also pulled a debug log: http://hastebin.com/xiniduluya (taken by Bob after step 5)

Finally - this reliably reproduces delayed as well as bad encrypted messages. Really hope it helps!

lablans avatar Mar 16 '14 14:03 lablans

I would like to try reproducing this behaviour; how can I kill single services on Android?

It sounds very plausible to me that this is the source of #970 and #763 case 3+4. It would explain why I never receive "bad encrypted messages": I have a much more powerful phone (Nexus 4) than the contacts that I am messaging, and who get "bad encrypted messages" from me. So probably, Android never kills those services for me, but does so on less powerful devices.

Natanji avatar Mar 16 '14 15:03 Natanji

@Natanji go into Settings -> Apps -> Active (Tab) -> TextSecure. There you can kill services by hitting the left button ("Beenden" on my screenshot).

screenshot_2014-03-16-17-24-19

lablans avatar Mar 16 '14 16:03 lablans

I killed the service KeyCachingService and I received immediately a new message (No delayed messages, no bad encrypted messages). Only thing was: I had to reenter my password for TextSecure. Everything else is OK so far.

Edit: There was no need to reboot to receive the message.

MPSMPS avatar Mar 17 '14 17:03 MPSMPS

@MPSMPS That's good to know. In my setup, there is no passphrase configured. Could you try again to reproduce without a passphrase? Thanks

lablans avatar Mar 17 '14 17:03 lablans

@vascorppor I removed the passphrase but I also got the message almost immediately (no reboot necessary). But this time the message (only 1 was sent) was bad encrypted and shows up two times (with the same SENT timestamp) in the chat window. But I observed a really strange thing: In the chat window the message was marked as bad encrypted but in the "system tray (I don't know the correct name on android systems)" it was shown for a period of a few hundreds milliseconds (with decrypted content). So TextSecure was at least able to decode this message and show it in the system tray.

In my opinion a really strange behaviour...

HTH

EDIT: Even more strange behaviour: I set my old password for the DB (I don't know if it matters if it is different to the original one) and now I got a "new" message with the correct decrypted content from the bad encrypted message. SENT timestamp is the same as for the two bad encrypted messages.

I did the following steps:

  1. remove password for DB
  2. kill KeyCachingService
  3. receive Message A
  4. receive Message B
  5. set old password for DB
  6. receive new old Message A

Chat history is something like that: A (bad encrypted) but shown for a short time in the systray. A (bad encrypted) B (correct encrypted and decrypted) A (correct encrypted and decrypted, that content was also displayed in the systray), same SEND timestamp as first message A.

Possibly this was just a bad timing and GCM resent that message!?

MPSMPS avatar Mar 17 '14 20:03 MPSMPS

GitHub Issue Cleanup: See #7598 for more information.

automated-signal avatar Apr 02 '18 21:04 automated-signal