Bug 1615060 - libssh upgrade 0.8.0-1 causes dnf to issue warning that ssh is still initialized after each application
Summary: libssh upgrade 0.8.0-1 causes dnf to issue warning that ssh is still initiali...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libssh
Version: 29
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Anderson Sasaki
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1615069 1615975 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-12 00:06 UTC by George R. Goffe
Modified: 2018-08-22 19:41 UTC (History)
25 users (show)

Fixed In Version: libssh-0.8.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-16 08:08:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description George R. Goffe 2018-08-12 00:06:35 UTC
Description of problem:

Updated this system today and started getting these warnings from dnf (I guess):


Warning: ssh still initialized; probably ssh_init() was called more than once (init count: 1)

Version-Release number of selected component (if applicable):
dnf-3.2.0-2.fc29.noarch

How reproducible:
always

Steps to Reproduce:
1.just use the dnf command
2.
3.

Actual results:
see below

Expected results:


Additional info:

dnf downgrade libglvnd'*'
Last metadata expiration check: 0:26:22 ago on Sat 11 Aug 2018 04:36:24 PM PDT.
Package libglvnd-opengl of lowest version already installed, cannot downgrade it.
Package libglvnd of lowest version already installed, cannot downgrade it.
Package libglvnd-core-devel of lowest version already installed, cannot downgrade it.
Package libglvnd-glx of lowest version already installed, cannot downgrade it.
Package libglvnd-devel of lowest version already installed, cannot downgrade it.
Package libglvnd-egl of lowest version already installed, cannot downgrade it.
Package libglvnd-gles of lowest version already installed, cannot downgrade it.
Error: No packages marked for downgrade.
Warning: ssh still initialized; probably ssh_init() was called more than once (init count: 1)

Comment 1 Gerald Cox 2018-08-12 03:46:25 UTC
*** Bug 1615069 has been marked as a duplicate of this bug. ***

Comment 2 Gerald Cox 2018-08-12 03:49:02 UTC
I also started getting this error.  It is displayed at the end of every dnf command I enter - regardless of the syntax.

Comment 3 Gerald Cox 2018-08-12 04:01:40 UTC
Problem appears to be caused by upgrade of libssh-0.7.5-7 to 0.8.0-1

I backed out:
Packages Altered:
    Downgrade  libssh-0.7.5-7.fc28.x86_64 @fedora
    Downgraded        0.8.0-1.fc28.x86_64 @updates-testing

and problem was circumvented - so I'm assigning this to libssh to resolve.

Changing bug summary.

Comment 4 George R. Goffe 2018-08-12 04:16:19 UTC
Gerald,

Thanks for your help.

George...

Comment 5 Andreas Schneider 2018-08-13 08:37:16 UTC
This is printed because of libcurl calling ssh_init() but not ssh_finalize().

Comment 6 Kamil Dudka 2018-08-13 15:09:55 UTC
libcurl calls ssh_finalize() if curl_global_cleanup() is called, which librepo does not do:

https://github.com/rpm-software-management/librepo/blob/27211463/librepo/util.c#L89


Minimal example:

# python -c 'import librepo'
Warning: ssh still initialized; probably ssh_init() was called more than once (init count: 1)

Comment 7 Daniel Berrangé 2018-08-13 16:40:20 UTC
Explicitly *not* calling finalize/cleanup functions is a normal/desirable thing to do, because it is very difficult to decide when it is safe to invoke global cleanup code.  This is particularly true of libssh, since the calls to ssh_init/ssh_finalize are not counted historically, so you can never safely call ssh_finalize as you've no idea what other libraries might still be using it.
Any app that follows the suggestion to add matching calls to ssh_finalize will be broken if ever built against libssh < 0.8.0, so is pretty undesirable.

Allowing the OS to cleanup on normal process exit/execve is simpler & safer. 

Printing these warnings to stderr has impacted the libvirt build, as our test suite is validating messages that appear on stderr and these are unexpected.

IMHO these warnings messages on stderr should just be removed.

Comment 8 Anderson Sasaki 2018-08-13 19:03:07 UTC
One of the changes brought in libssh-0.8.0 is exactly to address the need of explicitly call ssh_init()/ssh_finalize(): now both are unnecessary if the library is dynamic linked, since such calls are made on the constructor/destructor.

The warning would not show up if the applications were calling the same amount of inits/finalizes. Anyway, the warning has been removed in current upstream master and will be in Fedora as soon as possible.

Comment 9 Lokesh Mandvekar 2018-08-13 23:00:45 UTC
0.8.1-1 LGTM on f28. Thanks

Comment 10 Jan Kurik 2018-08-14 11:21:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 11 Stephen Gallagher 2018-08-14 16:08:13 UTC
(In reply to Lokesh Mandvekar from comment #9)
> 0.8.1-1 LGTM on f28. Thanks

I can confirm this as well.

Comment 12 Stephen Gallagher 2018-08-14 16:08:14 UTC
(In reply to Lokesh Mandvekar from comment #9)
> 0.8.1-1 LGTM on f28. Thanks

I can confirm this as well.

Comment 13 Panu Matilainen 2018-08-15 06:21:15 UTC
*** Bug 1615975 has been marked as a duplicate of this bug. ***

Comment 14 David Hill 2018-08-15 19:48:15 UTC
ditto

Comment 15 George R. Goffe 2018-08-22 19:41:59 UTC
Hi,

I'm not sure that the "fix" has propagated. I found a f30 version of libssh and installed it. This resolved the message problem but I'm not sure it didn't cause another problem. When I run "dnf remove --duplicates" I get these messages... Is this part of the same bug or do I need to make a new bug report?

I could try to fix this by using rpm:

rpm --nodeps -e libssh-0.8.0-1.fc29.x86_64 but this may break dnf since I believe that dnf relies on the ssh library. Yes? No?

George...


Error: Transaction check error:
  file /usr/lib64/libssh.so.4 from install of libssh-0.8.1-4.fc30.x86_64 conflicts with file from package libssh-0.8.0-1.fc29.x86_64
  file /usr/share/doc/libssh/ChangeLog from install of libssh-0.8.1-4.fc30.x86_64 conflicts with file from package libssh-0.8.0-1.fc29.x86_64


Note You need to log in before you can comment on or make changes to this bug.