Summary | Small C++ bug preventing succesful logins |
Queue | gloox |
Queue Version | 1.0 |
Type | Bug |
State | Resolved |
Priority | 3. High |
Owners | js (at) camaya (dot) net |
Requester | sqrt (at) entless (dot) org |
Created | 09/27/2012 (4024 days ago) |
Due | |
Updated | 07/05/2013 (3743 days ago) |
Assigned | |
Resolved | 07/05/2013 (3743 days ago) |
State ⇒ Resolved
https://bugzilla.redhat.com/show_bug.cgi?id=909859
For me it helped to move the implementation from util.h to util.cpp.
Assigned to Jakob Schröter
Could you please test with util.h from svn, gloox 1.0 branch? That one
is more recent (unfortunately) and doesn't use log().
New Attachment: util.h.patch
not need floating point operations.
The assignment of a temporary return value to a reference is not
undefined behavior, the reference should persist as long as the
temporary, and it was not the problem in this case.
with both the libgloox that comes with ubuntu as well as a self
compiled gloox 1.0. After receiving the bind result stanza from the
server the login handshake stops and the connection times out after
half a minute. Interestingly recompiling the lilbrary with either -O0
or with -fno-strict-aliasing fixes the problem, but this could be just
an coincidence in the case of undefined behaviour. But there is
something wrong for sure. I saw other reports on the net of the same
problem.
ubuntu, util::long2string(10, 10) returns "0" because the
floating-point log function does not (and can not) handle integers
with 100% precision: The computed string length (log_10(10) + 1) is
just a tiny bit smaller than 1.0, but when converted to integer, it
becomes 1;
This results in XTAttribute (which has the value 10), when converted
into a tag attribute, being type="0" instead of type="10", and
therefore the resource bind xmlns will not be recognized by the xpath.
State ⇒ Unconfirmed
New Attachment: fix.patch
Queue ⇒ gloox
Summary ⇒ Small C++ bug preventing succesful logins
Type ⇒ Bug
Priority ⇒ 3. High
stanzaextensionfactory.cpp:81 (trunk line number), its return value is
assigned to "const ConstTagList& match"; This is undefined behaviour
and has, on at least 2 installations of 32bit Ubuntu, prevented
successul login, because resource bind stanza extensions were not
detected.
Fixing the bug is trivial and a patch file has been attached.