Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 493738 - net-misc/x2goclient with net-libs/libssh-0.6.0_rc{2,3} - segmentation fault in ssh_poll_set_events (events=events@entry=1, p=p@entry=0x7fffe4011090) at /usr/src/debug/net-libs/libssh-0.6.0_rc3/libssh-0.6.0rc3/src/poll.c:344
Summary: net-misc/x2goclient with net-libs/libssh-0.6.0_rc{2,3} - segmentation fault i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL: https://red.libssh.org/issues/132
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-09 09:26 UTC by Bernd Feige
Modified: 2014-03-02 15:19 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Feige 2013-12-09 09:26:27 UTC
On two ~amd64 systems, I get segfaults in x2goclient immediately when trying to connect. I have net-misc/openssh-6.4_p1-r1 with hpn disabled. Here's the gdb session:

gdb /usr/bin/x2goclient 
GNU gdb (Gentoo 7.6.1 p1) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/x2goclient...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/x2goclient 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
x2go-INFO-1> "Starting x2goclient..."
x2go-INFO-4> "Übersetzung: :/x2goclient_de_de installiert."
x2go-INFO-5> "Übersetzung: :/qt_de_DE installiert."
x2go-INFO-3> "X2Go Client ist gestartet."
x2go-INFO-8> "Verbindung mit Server wird gestartet: pst15:22"
[New Thread 0x7fffeaf7b700 (LWP 24289)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeaf7b700 (LWP 24289)]
0x00007ffff7bbc64f in ?? () from /usr/lib64/libssh.so.4
(gdb) where
#0  0x00007ffff7bbc64f in ?? () from /usr/lib64/libssh.so.4
#1  0x00007ffff7bbd5ba in ?? () from /usr/lib64/libssh.so.4
#2  0x00007ffff7bad9e3 in ssh_channel_poll () from /usr/lib64/libssh.so.4
#3  0x00000000004a843e in ?? ()
#4  0x00000000004ab4a2 in ?? ()
#5  0x00007ffff5afb16f in ?? () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ffff5865d63 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ffff5079a3d in clone () from /lib64/libc.so.6
(gdb) quit


Reproducible: Always
Comment 1 Bernd Feige 2013-12-09 09:28:16 UTC
ps. Downgrading to net-libs/libssh-0.6.0_rc1 fixes the issue...
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-09 10:47:32 UTC
Upstream bug available
Comment 3 barrie backhurst 2013-12-09 12:43:09 UTC
I am seeing this as well, but I was also previously seeing a problem with x2goclient since installing net-libs/libssh-0.6.0_rc1. When running a session the local desktop(kde4) would gradually freeze until x2goclient crashed and top would show x2goclient using over 100% cpu(?). I know I should have filed a bug, but I have nxclient installed as well and unfortunately life has been extremely busy recently.
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-09 17:30:01 UTC
(In reply to barrie backhurst from comment #3)
> I am seeing this as well, but I was also previously seeing a problem with
> x2goclient since installing net-libs/libssh-0.6.0_rc1. When running a
> session the local desktop(kde4) would gradually freeze until x2goclient
> crashed and top would show x2goclient using over 100% cpu(?). I know I
> should have filed a bug, but I have nxclient installed as well and
> unfortunately life has been extremely busy recently.

Yeah. That's most likely the same memory leak I also had with libssh-0.6.0_rc1 and x2goclient.
Let's wait for rc3 and see if that behaves better.
Comment 5 Sven 2013-12-22 21:12:35 UTC
Right now, x2goclient with rc3 just crashes. But even with rc1 there is a scenario where x2goclient crashes: namely if you try to use an ecdsa key. Not sure who is to blame (x2goclient or libssh).
Comment 6 Nico R. 2013-12-23 17:28:40 UTC
Full backtrace from running x2goclient in GDB, just in case someone is
interested:

Reading symbols from /usr/bin/x2goclient...Reading symbols from /usr/lib64/debug/usr/bin/x2goclient.debug...done.
done.
Starting program: /usr/bin/x2goclient --debug
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
x2go-INFO-1> "Starting x2goclient..."
x2go-WARNING-1> "Can't load translator: :/x2goclient_c"
x2go-WARNING-2> "Can't load translator: :/qt_C"
x2go-INFO-3> "Started  x2goclient."
x2go-DEBUG-onmainwindow.cpp:464> "$HOME=/home/nico"
x2go-DEBUG-onmainwindow.cpp:2160> Reading 3 sessions from config file.
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
x2go-DEBUG-onmainwindow.cpp:2762> Starting session via smartcard, ssh-agent or kerberos token.
x2go-INFO-8> "Starting connection to server: july.ulrichsminis.dyndns.org:22"
x2go-DEBUG-onmainwindow.cpp:2796> Start new ssh connection to server:"july.ulrichsminis.dyndns.org":"22" krbLogin: false
[New Thread 0x7fffe952b700 (LWP 2958)]
x2go-DEBUG-onmainwindow.cpp:2891> SSH connection established.
x2go-DEBUG-onmainwindow.cpp:3117> Continue normal x2go session

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe952b700 (LWP 2958)]
0x00007ffff7bbcb6f in ssh_poll_set_events (events=events@entry=1, p=p@entry=0x7fffe4011090) at /usr/src/debug/net-libs/libssh-0.6.0_rc3/libssh-0.6.0rc3/src/poll.c:344
344         p->ctx->pollfds[p->x.idx].events = events;
(gdb) bt
#0  0x00007ffff7bbcb6f in ssh_poll_set_events (events=events@entry=1, p=p@entry=0x7fffe4011090) at /usr/src/debug/net-libs/libssh-0.6.0_rc3/libssh-0.6.0rc3/src/poll.c:344
#1  ssh_poll_add_events (p=p@entry=0x7fffe4011090, events=events@entry=1) at /usr/src/debug/net-libs/libssh-0.6.0_rc3/libssh-0.6.0rc3/src/poll.c:371
#2  0x00007ffff7bbdafa in ssh_handle_packets (session=0x7fffe40078b0, timeout=timeout@entry=0) at /usr/src/debug/net-libs/libssh-0.6.0_rc3/libssh-0.6.0rc3/src/session.c:496
#3  0x00007ffff7badd93 in ssh_channel_poll (channel=0x7fffe4012550, is_stderr=<optimized out>) at /usr/src/debug/net-libs/libssh-0.6.0_rc3/libssh-0.6.0rc3/src/channels.c:2877
#4  0x000000000049da24 in SshMasterConnection::channelLoop (this=this@entry=0xa4ece0) at sshmasterconnection.cpp:1256
#5  0x00000000004a0a72 in SshMasterConnection::run (this=0xa4ece0) at sshmasterconnection.cpp:551
#6  0x00007ffff5d257cf in QThreadPrivate::start (arg=0xa4ece0) at thread/qthread_unix.cpp:338
#7  0x00007ffff5a8ff3b in start_thread (arg=0x7fffe952b700) at pthread_create.c:308
#8  0x00007ffff52ac26d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
(gdb) list
339      * @param  events       Poll events.
340      */
341     void ssh_poll_set_events(ssh_poll_handle p, short events) {
342       p->events = events;
343       if (p->ctx != NULL && !p->lock) {
344         p->ctx->pollfds[p->x.idx].events = events;
345       }
346     }
347
348     /**
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-06 13:35:13 UTC
+*libssh-0.6.0_rc3-r1 (06 Jan 2014)
+
+  06 Jan 2014; Lars Wendler <polynomial-c@gentoo.org> -libssh-0.6.0_rc1.ebuild,
+  -libssh-0.6.0_rc2.ebuild, -libssh-0.6.0_rc3.ebuild,
+  +libssh-0.6.0_rc3-r1.ebuild, +files/libssh-0.6.0_rc3-memleak_fix.patch,
+  +files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch,
+  +files/libssh-0.6.0_rc3-x2goclient_crash_fix-2.patch:
+  Revbump to address a memleak bug and crashes seen with x2goclient (bug
+  #493738). Removed old (broken) rc versions.
+
Comment 8 Lukas Elsner 2014-03-02 10:23:39 UTC
I am still getting a segmentation fault with libssh 0.6.1. Should I open a new bug? It could be the same problem. But I am not really sure.


(gdb) backtrace 
#0  0x00007ffff4a7dd7c in EC_GROUP_free () from /usr/lib64/libcrypto.so.1.0.0
#1  0x00007ffff4a868ce in EC_KEY_free () from /usr/lib64/libcrypto.so.1.0.0
#2  0x00007ffff7bbd113 in ssh_key_clean () from /usr/lib64/libssh.so.4
#3  0x00007ffff7bbd15e in ssh_key_free () from /usr/lib64/libssh.so.4
#4  0x00007ffff7bb6c01 in privatekey_from_file () from /usr/lib64/libssh.so.4
#5  0x00000000004b1bad in SshMasterConnection::userAuthWithKey() ()
#6  0x00000000004b3448 in SshMasterConnection::userAuth() ()
#7  0x00000000004b6d24 in SshMasterConnection::run() ()
#8  0x00007ffff5af948c in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007ffff5869073 in start_thread () from /lib64/libpthread.so.0
#10 0x00007ffff508c44d in clone () from /lib64/libc.so.6
Comment 9 Lukas Elsner 2014-03-02 10:33:59 UTC
I just recognized, that this message just means: "your key does not exist". So this is another bug. :)