From mathew.j.martineau@linux.intel.com Wed Feb 17 18:10:59 2016 Received: (at 759) by bugs.x2go.org; 17 Feb 2016 17:11:01 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,RCVD_IN_DNSWL_BLOCKED autolearn=ham version=3.3.2 Received: from localhost (localhost [127.0.0.1]) by ymir.das-netzwerkteam.de (Postfix) with ESMTP id BC7975DA97 for <759@bugs.x2go.org>; Wed, 17 Feb 2016 18:10:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ymir.das-netzwerkteam.de Received: from ymir.das-netzwerkteam.de ([127.0.0.1]) by localhost (ymir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dvsnwHWzpnxu for <759@bugs.x2go.org>; Wed, 17 Feb 2016 18:10:58 +0100 (CET) X-Greylist: delayed 611 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Wed, 17 Feb 2016 18:10:57 CET Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ymir.das-netzwerkteam.de (Postfix) with ESMTP id E270B5DA95 for <759@bugs.x2go.org>; Wed, 17 Feb 2016 18:10:57 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 17 Feb 2016 09:00:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,461,1449561600"; d="scan'208";a="654275281" Received: from mjmartin-mac01.wa.intel.com ([10.232.97.131]) by FMSMGA003.fm.intel.com with ESMTP; 17 Feb 2016 09:00:45 -0800 Date: Wed, 17 Feb 2016 09:00:44 -0800 (PST) From: Mat Martineau X-X-Sender: mjmartin@mjmartin-mac01.local To: 759@bugs.x2go.org Subject: x2goclient 4.0.5.0 (and 4.0.5.1 preview) frequent ssh commands don't free resources Message-ID: User-Agent: Alpine 2.20 (OSX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII I've run in to this problem as well, with these x2go versions: Client (Mac) * x2goclient 4.0.5.0 (OS X 10.9+ build) or 4.0.5.1 preview (December 2015 build) * OS X 10.11.3 * XQuartz 2.7.8 Server (Linux) * x2goagent: 3.5.0.32 * x2goserver: 4.0.1.19 * x2goserver-extensions: 4.0.1.19 * Fedora 23 (with updates as of 2016-02-17) Steps to reproduce: 1. Run 'x2goclient --debug' and open a session 2. Observe frequent xmodmap commands while session is active 3. Quit session to see a large number of SshProcess objects freed This came to my attention because the default SELinux/audit settings on Fedora 23 log five events for each xmodmap ssh command executed on the server by the client. That's 1800 events per hour when an x2go session is active. Judging from ONMainWindow::slotSetModMap() in onmainwindow.cpp, it looks like the intent is to only run the xmodmap command if kbMap is empty (maybe there's an expected way for kbMap to get cleared so it has to be periodically checked?). However, slotSetModMap() runs every 10 seconds and executes a command every time. It's not clear to me how kbMap becomes empty. Furthermore, the SshProcess objects are not cleaned up until the session is exited. The 'processes' QList in SshMasterConnection grows without bound. Logs from x2goclient --debug: """ x2go-DEBUG-../src/sshprocess.cpp:199> Executing remote command via SshProcess object 6: "export DISPLAY=":50"; echo "keycode 8 = a A aring Aring " x2go-DEBUG-../src/sshprocess.cpp:204> Running masterCon->addChannelConnection(this, '"d93c9f1a-2d4d-42fb-92a9-5373621768f6"', '"bash -c 'echo "X2GODATABEGIN:d93c9f1a-2d4d-42fb-92a9-5373621768f6"; export PATH="/usr/local/bin:/usr/bin:/bin"; export DISPLAY=":50"; echo "keycode 8 = a A aring Aring keycode 9 = s S ssharp Iacut"'); x2go-DEBUG-../src/sshmasterconnection.cpp:1284> Locking SSH channel connection MUTEX. x2go-DEBUG-../src/sshmasterconnection.cpp:1286> Passing new channel conenction object to channelConnections. x2go-DEBUG-../src/sshmasterconnection.cpp:1288> Unlocking SSH channel connection MUTEX. x2go-DEBUG-../src/sshmasterconnection.cpp:1476> Creating new channel. x2go-DEBUG-../src/sshmasterconnection.cpp:1480> New channel:0x7fcb9a7af450 x2go-DEBUG-../src/sshmasterconnection.cpp:1511> Executing remote: "bash -c 'echo "X2GODATABEGIN:d93c9f1a-2d4d-42fb-92a9-5373621768f6"; export PATH="/usr/local/bin:/usr/bin:/bin"; export DISPLAY=":50"; echo "keycode 8 = a A aring Aring " x2go-DEBUG-../src/sshmasterconnection.cpp:1534> New exec channel created. x2go-DEBUG-../src/sshmasterconnection.cpp:1638> EOF on channel 0x7fcb9a7af450; SshProcess object: 6 x2go-DEBUG-../src/sshmasterconnection.cpp:1706> EOF sent. x2go-DEBUG-../src/sshmasterconnection.cpp:1710> Channel closed. x2go-DEBUG-../src/sshprocess.cpp:517> SSH finished: raw output (stdout): "X2GODATABEGIN:d93c9f1a-2d4d-42fb-92a9-5373621768f6 X2GODATAEND:d93c9f1a-2d4d-42fb-92a9-5373621768f6 " x2go-DEBUG-../src/sshprocess.cpp:528> SSH finished: true - "" (6). """ And the log of SshProcess cleanup when the session is disconnected after a little over one minute: """ x2go-DEBUG-../src/sshmasterconnection.cpp:715> SshMasterConnection, instance SshMasterConnection(0x7fcb9cc51a90) thread finished. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshprocess.cpp:52> SshProcess destructor called. x2go-DEBUG-../src/sshmasterconnection.cpp:722> SshMasterConnection, instance SshMasterConnection(0x7fcb9cc51a90) finished destructor. """ -- Mat Martineau Intel OTC