qxmpp-project / qxmpp

Cross-platform C++ XMPP client and server library
412 stars 196 forks source link

Run time issue with queued argument of type uint32_t #660

Open pasnox opened 1 week ago

pasnox commented 1 week ago

The omemo stack use that in signals connection, unfortunately it's not registered via qRegisterMetatype and cause run time issue in xmpp, which break kaidan omemo support. This would lead to have some contact for which I can speak omemo, and some not. Kaidan tried to fix it, but it seems not enough and needs to be fixed in xmpp itself as it's there the queued connectons are done.

lnjX commented 1 week ago

Where are queued connections done in QXmpp?

melvo commented 1 week ago

There are several signals emitted in the OMEMO manager such as https://github.com/qxmpp-project/qxmpp/blob/85420824ab96922647c98a2cc2d0fe97a4f56183/src/omemo/QXmppOmemoManager_p.cpp#L2546 having parameters of type uint32_t. Could that be the problem?

lnjX commented 1 week ago

Those signals don't use queued connections, because both OmemoManager and OmemoManagerPrivate are always on the same thread.

lnjX commented 1 week ago

And the other (easier) option to solve this issue is probably to use quint32 instead of uint32_t, I guess?

pasnox commented 1 week ago

I did not check the code, I just saw Qt throwing the usual warning about queued arguments type not registered, so somewhere in QXmpp or kaidan there is an issue. And yes moving to quint32 is probably a better change.