Bug 1086826 - Meanwhile protocol (libmeanwhile1) - "Login verification down or unavailable"
Meanwhile protocol (libmeanwhile1) - "Login verification down or unavailable"
Status: CONFIRMED
: 1087888 1100889 (view as bug list)
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
x86-64 SUSE Other
: P5 - None : Normal (vote)
: ---
Assigned To: Will Stephenson
maint:planned:update
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-26 10:07 UTC by Darko Cabro
Modified: 2020-06-04 13:05 UTC (History)
5 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darko Cabro 2018-03-26 10:07:37 UTC
Installed protocols:

libmeanwhile1 - Lotus Sametime Community Client Library 
Version: 1.0.2-137.9

libpurple-plugin-sametime - Sametime Plugin for Pidgin using the Meanwhile Library
Version: 2.13.0-1.1

Pidgin
Version:
2.13.0-1.1

Adding the Sametime account without problems but connection errors. 


11:28:25) account: Connecting to account REDACTED
(11:28:25) connection: Connecting. gc = 0x55a16615fe70
(11:28:25) meanwhile: adding cipher RC2/40 Cipher
(11:28:25) meanwhile: adding cipher RC2/128 Cipher
(11:28:25) sametime: user: 'REDACTED'
(11:28:25) sametime: host: 'REDACTED'
(11:28:25) sametime: port: 80
(11:28:25) dnsquery: Performing DNS lookup for REDACTED
(11:28:25) dns: Wait for DNS child 20717 failed: No child processes
(11:28:25) dns: Created new DNS child 20894, there are now 1 children.
(11:28:25) dns: Successfully sent DNS request to child 20894
(11:28:25) dns: Got response for 'REDACTED'
(11:28:25) dnsquery: IP resolved for REDACTED
(11:28:25) proxy: Attempting connection to REDACTED
(11:28:25) proxy: Connecting to REDACTED:80 with no proxy
(11:28:25) proxy: Connection in progress
(11:28:25) proxy: Connecting to REDACTED:80.
(11:28:25) proxy: Connected to REDACTED:80.
(11:28:25) meanwhile: session state: starting
(11:28:25) meanwhile: session state: handshake sent
(11:28:26) meanwhile: session state: handshake acknowledged
(11:28:26) meanwhile: session state: login sent
(11:28:26) meanwhile: session state: stopping (0x80000214)
(11:28:26) connection: Connection error on 0x55a16615fe70 (reason: 3 description: Login verification down or unavailable)
(11:28:26) jabber: jabber_actions: have pep: NO
(11:28:26) meanwhile: session state: stopped (0x80000214)
(11:28:26) account: Disconnecting account REDACTED (0x55a165a1d110)
Comment 1 Christopher O'Brien 2018-03-26 16:00:14 UTC
Hello, I'm the original developer of Meanwhile. This issue has sprung up before, and in the past is has been due to compiler optimizations used in the meanwhile library's build.

See for example:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815045#10

using -O2 may cause it to break.
using -fno-tree-vrp appears to fix it.
Comment 2 Christopher O'Brien 2018-03-26 16:01:44 UTC
Maintainer appears to be
Comment 3 Jimmy Berry 2018-03-27 02:47:41 UTC
(In reply to Christopher O'Brien from comment #2)
> Maintainer appears to be

What was the reason I was cc'd? Or was that unintentional?
Comment 4 Will Stephenson 2018-03-27 07:36:52 UTC
I'm trying to find a replacement maintainer for this package. I am no longer involved with desktop at SUSE and have no SameTime server to test this against.
Comment 5 Christopher O'Brien 2018-03-27 12:56:15 UTC
Jim Berry, sorry I saw you listed as maintainer in the build service.

Will Stephenson, I understand your plight. I'm the author and I'm in the same boat, no longer having ready access to a Sametime server (for 10 years now). I do genuinely believe that the CFLAGS change will fix it, and I think Darko Cabro would probably be willing (and I'm sorry to volunteer you, Darko) to try out a build to verify functionality.
Comment 6 Darko Cabro 2018-03-27 13:38:48 UTC
No worries Christopher. Once you pointed me in the right direction, I was able to successfully compile and connect. 

Two things need to be done to be able to compile it from source and make it work:

1. Change source files to only include the top-level glib header. Otherwise compilation will fail with "error: #error "Only <glib.h> can be included directly". The recommended way of using GLib is to include the toplevel headers glib.h, glib-object.h, gio.h. Starting with 2.32, GLib enforces this by generating an error when individual headers are directly included. 

2. Compile with CFLAGS="$(CFLAGS) -fno-tree-vrp" 

Resulting library works like a charm!
Comment 7 Will Stephenson 2018-03-28 07:05:28 UTC
Could you send me a patch and I'll integrate it? Thanks!
Comment 8 Darko Cabro 2018-03-28 11:12:04 UTC
No, sorry, not familiar with creating patches.  

(In reply to Will Stephenson from comment #7)
> Could you send me a patch and I'll integrate it? Thanks!
Comment 9 Alberto Maikuma 2018-03-31 23:22:41 UTC
Same thing is happening on openSUSE Leap 15 Beta. Should I open a new bug or fixing here will also fix the Leap package?
Comment 10 Ludwig Nussel 2018-04-04 12:15:12 UTC
*** Bug 1087888 has been marked as a duplicate of this bug. ***
Comment 11 Alexei Sorokin 2018-07-15 16:26:23 UTC
*** Bug 1100889 has been marked as a duplicate of this bug. ***
Comment 12 Felix Zhang 2018-07-16 06:53:33 UTC
Thanks to Christopher's hint. I've made a small patch adding -fno-tree-vrp to CPP_FLAGS for sametime, and made a test package at https://download.opensuse.org/repositories/home:/zhangxiaofei:/branches:/openSUSE:/Leap:/15.0:/Update/standard/x86_64/libpurple-plugin-sametime-2.13.0-lp150.7.1.x86_64.rpm

Unfortunately I don't have a sametime server to test it myself. Would appreciate if someone helps on that, so that I can merge it to SLE/Leap 15 if it works.
Comment 13 Felix Zhang 2018-07-16 06:59:33 UTC
Sorry, I may have misread the solution and it appears the compiler flag should rather be added to meanwhile. Please ignore the noise in comment 12.
Comment 14 Felix Zhang 2018-07-16 10:51:59 UTC
Added -fno-tree-vrp to libmeanwhile in my branch, please test, thanks.
https://download.opensuse.org/repositories/home:/zhangxiaofei:/branches:/devel:/libraries:/c_c++/
Comment 15 Alexei Sorokin 2018-07-16 12:45:58 UTC
https://build.opensuse.org/request/show/623126
This should fix the issue by utilising LibTomMath instead of the bundled MPI code.
Took a while to figure out. Kudos to Robert Koktan for trying my attempts out :-).
In the process I've found some other things, it is all in the Submit Request.
Comment 16 Alexei Sorokin 2018-07-16 20:58:55 UTC
I found https://numbersandshapes.net/2012/06/number-theoretic-computations-in-c and the follow-up https://numbersandshapes.net/2012/06/speeds-of-c-libraries-for-number-theory, where the author compares various multi-precision integer libraries in how they perform mp_exptmod / mpz_powm, which appears to be exactly what libmeanwhile is using an MPI for.
What the author finds is that GMP and MPIR both perform pretty well whilst LibTomMath is way-way slower.
So I tried myself, and after adapting the original code to LibTomMath, 6 years later, I confirm the same finding – LibTomMath is very much slower at this operation than GMP and MPIR.

But the bundled with libmeanwhile src/mpi/ is more than twice slower than even LibTomMath.
So there's that. The choice of LibTomMath has been made for the patch just because it's API-compatible with src/mpi/, making the conversion safer and much easier, and because apparently GMP will force libmeanwhile to be LGPLv3+…

Christopher O'Brien, I wonder why haven't you used GMP back then, as GMP seems to be just better for the job, and it used to be licensed like meanwhile does :-).
Comment 17 Christopher O'Brien 2018-07-16 21:04:25 UTC
There's flags to allow either GMP or lib_mpi, with some macros to pick one at compile time. At the time, I found certain distributions weren't bundling a working gmp, so I provided a simple fall-back implementation instead. These days it's certainly best to just use whatever is bundled.

Unless you're using meanwhile as a message bot, speed is a non-issue.
Comment 18 Alexei Sorokin 2018-07-16 21:28:21 UTC
> There's flags to allow either GMP or lib_mpi, with some macros to pick one at compile time. At the time, I found certain distributions weren't bundling a working gmp, so I provided a simple fall-back implementation instead.

Christopher O'Brien, There's definitely no GMP around in 1.0.2 so I was not aware that it was ever there O_o.

> These days it's certainly best to just use whatever is bundled.

Not sure what you mean by that… After all, the bundled code is exactly what broke :-).

I guess LibTomMath is the safest bet though, as it's the one that was confirmed to properly work by someone who has a Sametime server around. The least risky solution.
Comment 19 Christopher O'Brien 2018-07-16 22:26:00 UTC
Great, sounds good.
Comment 20 Andreas Stieger 2018-08-04 20:33:39 UTC
https://build.opensuse.org/request/show/627470
Assigning to SLE bugowner, please fix via SLE maintenance
Comment 21 Alexei Sorokin 2019-03-08 17:30:07 UTC
This still needs fixing.

https://build.opensuse.org/request/show/681098 has been accepted to openSUSE:Factory, which contains the newer release (meanwhile 1.1.1).