AnsweredAssumed Answered

Smack omemo 4.2.1-beta2-SNAPSHOT enters endless loop in "Send RatchetUpdateMessage" on received message with invalid session

Question asked by cmeng on Jul 20, 2017
Latest reply on Aug 17, 2017 by cmeng

During aTalk source updates to work with smack 4.2.1-beta2 snapshot, when testing is conducted between the following two clients 1 & 2; at one point I try to enable Omemo encryption chat on NA36, the smack omemo enters into an endless loop trying to "Send RatchetUpdateMessage" as captured in the log below. I am not sure the invalid sessions got created because I prematurely terminated NA36 and reinstalled apk with new source compiled multiple times. Eventually I have to end SC37 and start SA35 to get omemo session working again with NA36.

 

1. NA36: aTalk (leopard@atalk.org) installed on Note3; omemoDevice (leopard@atalk.org, 1011347036)

2. SC37: conversions (swan@atalk.org) installed on S3; omemoDevice (swan@atalk.org, 816614937)

3. SA35: aTalk (swan@atalk.org) installed on S3; omemoDevice (swan@atalk.org, 1711246335)

 

============== aTalk log on Send RatchetUpdateMessage ===============

07-21 12:11:26.555 I/αTalk: [43] org.jivesoftware.smackx.omemo.OmemoService.processStanza() Received message with invalid session from swan@atalk.org:816614937. Send RatchetUpdateMessage.

07-21 12:11:26.615 D/SMACK: SENT (0): <iq to='swan@atalk.org' id='E0R2m-202' type='get'><pubsub xmlns='http://jabber.org/protocol/pubsub'><items node='eu.siacs.conversations.axolotl.bundles:816614937'/></pubsub></iq>

07-21 12:11:26.635 D/SMACK: RECV (0): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='swan@atalk.org' type='result' id='E0R2m-202'><pubsub xmlns='http://jabber.org/protocol/pubsub'><set xmlns='http://jabber.org/protocol/rsm'><index>0</index><count>1</count><first index='0'>creation@001500:608047:957981</first><last>creation@001500:608047:957 981</last></set><items node='eu.siacs.conversations.axolotl.bundles:816614937'><item id='5DC9472FE968E'><bundle xmlns='eu.siacs.conversations.axolotl'><signedPreKeyPublic signedPreKeyId='3'>BbhtJfCb/H+0xTS6bOfAzx+6tvrT6B4GmZf3epT8be8h

                            </signedPreKeyPublic><signedPreKeySignature>4L71qLx6RtXtxmFe1pYDOMrZFyDd4XdHw+e K++7e/OGHs1kv/tEBQb85wMAlzEXY5Ohn4Z5PAwRt

                            ypsT+0Ffiw==

                            </signedPreKeySignature><identityKey>BRRXkCk6JCc1wQKxO8pYIfzAMytB7he0VNzF/zxODr Vh

                            </identityKey><prekeys><preKeyPublic preKeyId='164'>BScm4J5Fwj8GNeyAeIUGaV9fEn3ObhKmKY+rbdr/YGIS

                            </preKeyPublic><preKeyPublic preKeyId='132'>BXXKL5pjBCKm0Ltr6lDCBndZxF6evtZiD72ex7rZ+C45

.....

                            </preKeyPublic><preKeyPublic preKeyId='188'>BcQ+zZrqff/Uae5vM6zD5c7MlM9SvpKgyUyXqVLnfSJh

                            </preKeyPublic><preKeyPublic preKeyId='172'>BcZZOBXyD0EoRfdEBw466Ge1hzbebgo2waETLknGWbh1

                            </preKeyPublic></prekeys></bundle></item></items></pubsub></iq>

07-21 12:11:27.225 D/SMACK: RECV (0): <r xmlns='urn:xmpp:sm:3'/>

07-21 12:11:27.235 D/SMACK: SENT (0): <a xmlns='urn:xmpp:sm:3' h='85'/>

07-21 12:11:57.295 I/art: Thread[2,tid=17475,WaitingInMainSignalCatcherLoop,Thread*=0xafd0e400,peer=0x12c 31080,"Signal Catcher"]: reacting to signal 3

07-21 12:11:57.665 I/art: Wrote stack traces to '/data/anr/traces.txt'

07-21 12:11:59.285 I/αTalk: [44] org.jivesoftware.smackx.omemo.OmemoService.processStanza() Received message with invalid session from swan@atalk.org:816614937. Send RatchetUpdateMessage.

07-21 12:11:59.325 D/SMACK: SENT (0): <iq to='swan@atalk.org' id='E0R2m-204' type='get'><pubsub xmlns='http://jabber.org/protocol/pubsub'><items node='eu.siacs.conversations.axolotl.bundles:816614937'/></pubsub></iq>

07-21 12:11:59.345 D/SMACK: RECV (0): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='swan@atalk.org' type='result' id='E0R2m-204'><pubsub xmlns='http://jabber.org/protocol/pubsub'><set xmlns='http://jabber.org/protocol/rsm'><index>0</index><count>1</count><first index='0'>creation@001500:608047:957981</first><last>creation@001500:608047:957 981</last></set><items node='eu.siacs.conversations.axolotl.bundles:816614937'><item id='5DC9472FE968E'><bundle xmlns='eu.siacs.conversations.axolotl'><signedPreKeyPublic signedPreKeyId='3'>BbhtJfCb/H+0xTS6bOfAzx+6tvrT6B4GmZf3epT8be8h

                            </signedPreKeyPublic><signedPreKeySignature>4L71qLx6RtXtxmFe1pYDOMrZFyDd4XdHw+e K++7e/OGHs1kv/tEBQb85wMAlzEXY5Ohn4Z5PAwRt

                            ypsT+0Ffiw==

                            </signedPreKeySignature><identityKey>BRRXkCk6JCc1wQKxO8pYIfzAMytB7he0VNzF/zxODr Vh

                            </identityKey><prekeys><preKeyPublic preKeyId='164'>BScm4J5Fwj8GNeyAeIUGaV9fEn3ObhKmKY+rbdr/YGIS

                            </preKeyPublic><preKeyPublic preKeyId='132'>BXXKL5pjBCKm0Ltr6lDCBndZxF6evtZiD72ex7rZ+C45

                            </preKeyPublic><preKeyPublic preKeyId='198'>BXSsGQ+Q399NAGsxT2wqfUVQX2qzverbnmaKPMZS5Bs+

                            </preKeyPublic><preKeyPublic preKeyId='143'>BRHWBB6Z8s+7rsLiWeZbDF9LnhyIOa+U2VffZbT6b144

....

                            </preKeyPublic><preKeyPublic preKeyId='185'>BS6bEB0A+BiU0T5JxwDghUf0iIT6pUytDD2M10BCdHEk

                            </preKeyPublic><preKeyPublic preKeyId='148'>BVSBGRu20LZT9bYHV1gCdp5gdwlHYiNEEbMMy0j64h4b

                            </preKeyPublic><preKeyPublic preKeyId='22

07-21 12:11:59.875 D/SMACK: RECV (0): <r xmlns='urn:xmpp:sm:3'/>

07-21 12:11:59.885 D/SMACK: SENT (0): <a xmlns='urn:xmpp:sm:3' h='86'/>

.....

Outcomes