otrv4 / pidgin-otrng

Fork of https://bugs.otr.im/plugins/pidgin-otr. This is a mirror of https://bugs.otr.im/otrv4/pidgin-otrng
GNU General Public License v2.0
16 stars 5 forks source link

Account not found #53

Closed claucece closed 5 years ago

claucece commented 6 years ago

Sometimes when the UI actions are too fast (you log in and not wait for the publication, and immediately start an OTR conversation), the account is not found and this happens:

No prekey client.

The printing of the account gives:

THE ACCOUNTz??? `

Sometimes as well, the protocol and account are not found for writing the persistent files and this gets writen:

@<b2><8a><dd><ce>!?:(null)
AAAABAABG4LpCAACABCzsG9HGCbEqD5hSHddu76Mu8Ol9NKhqAkXJyMoTVHFjLczxxcfaqUVRxknERlZK9VLwxlqLLVfoAAABAAAAAMzNAAABQAAAABbpUkLfLmvgcxJ16sRJYAOKWlpIgtLXpBEbFdi/YLAayijC269LAQXpEP23U4YPZdBky9CXDRRNeSwXkmA2SPnbokGoA4xhCiMsQRIoe6jQsxFblCC8vef+sGtzUrYWQC9fPlyIWucTz10QN5usCZhv3kchTUA

Can it be a threading error?

claucece commented 6 years ago

cc. @olabini

olabini commented 6 years ago

I'll look into this. Did you add any debug-printing to see those statements?

claucece commented 6 years ago

No, I just printed the account->username on several places to see if it was been found.

olabini commented 6 years ago

Any idea where the specific places were printed that you saw?

claucece commented 6 years ago

Yes, immediately as you send the storage status message, and you get back that they are too low, and you try to publish:

https://github.com/otrv4/pidgin-otrng/blob/master/prekey-plugin.c#L98

Then this func does not get a prekey client:

https://github.com/otrv4/pidgin-otrng/blob/master/prekey-plugin.c#L274

And it fails here:

https://github.com/otrv4/pidgin-otrng/blob/master/prekey-plugin.c#L85

Around being incorrectly written in the persistent file, Idk when it happen, it just popped out.

olabini commented 5 years ago

I have not been able to reproduce this - I've added a large amount of printings all over the place to check for it, but it never happens for me...

claucece commented 5 years ago

@olabini I'll recheck this.. maybe it is something solved.

claucece commented 5 years ago

I haven't seen this happening again but as we have some other weird bugs; it is worth keeping it open.

olabini commented 5 years ago

I just got a crash here:

                #4  0x00007fdd49b12654 get_domain_from_jid (pidgin-otrng.so)
                #5  0x00007fdd49b11c17 otrng_plugin_get_prekey_client (pidgin-otrng.so)

My guess is that this is from a missing PurpleAccount, so probably connected.

olabini commented 5 years ago

I've added some assertions to the pidgin-helpers file, to make sure all these invariants are always checked.

claucece commented 5 years ago

I'm quite uncomfortable on all of this refactorings, as it seems like a lot of functionality is getting broken. I'm unsure in which other places it is broken...

olabini commented 5 years ago

Sorry, not sure what you're talking about on this issue. I just added assertions to make it faster to see when something is broken.

claucece commented 5 years ago

Well, I'm talking in general. But let's talk about this on the call.

olabini commented 5 years ago

Have you seen this issue again?

olabini commented 5 years ago

OK, we haven't seen this issue for a long while. I'll close this issue now. In case it comes back we can reopen, but I don't think it will.