Re: Reading multiple channels under the same session

2019-01-30 Thread Andreas Schneider
On Wednesday, 30 January 2019 23:34:32 CET g4-l...@tonarchiv.ch wrote: > On 30.01.19 22:50, Alberto Garcia wrote: > > Hi, > > > > what about waiting to call ssh_event_remove_fd() > > until my_channel_close_function() is reached? > > We have to remove the socket fd from the poll event in the same

Re: Reading multiple channels under the same session

2019-01-30 Thread Alberto Garcia
That's probably happening because the python code is creating too many connections at the same time right? But, yes, as you said that looks like somewhere in your code you are forgetting to close the fd of the sockets that already did his job. On Wed, Jan 30, 2019 at 3:29 PM wrote: >

Re: Reading multiple channels under the same session

2019-01-30 Thread g4-lisz
till@elite:~/libssh$ ssh user@localhost -p2022 -D 11223 -N user@localhost's password: accept: Too many open files accept: Too many open files accept: Too many open files I call this a success... Don't ask me how many sessions were open at the same time. But it's probably also because not all

Re: Reading multiple channels under the same session

2019-01-30 Thread g4-lisz
On 30.01.19 22:50, Alberto Garcia wrote: > Hi, > > what about waiting to call ssh_event_remove_fd() > until my_channel_close_function() is reached? We have to remove the socket fd from the poll event in the same loop round when it's closed. We should avoid polling on a closed handle. It's all a

Re: Reading multiple channels under the same session

2019-01-30 Thread Alberto Garcia
Hi, what about waiting to call ssh_event_remove_fd() until my_channel_close_function() is reached? On Wed, Jan 30, 2019 at 1:48 PM Alberto Garcia wrote: > Hi, > So it is not something specific from Windows that needs to be changed > right? > > Good gob finding the root cause! :applause: > > On

Re: Reading multiple channels under the same session

2019-01-30 Thread Alberto Garcia
Hi, So it is not something specific from Windows that needs to be changed right? Good gob finding the root cause! :applause: On Wed, Jan 30, 2019 at 1:40 PM wrote: > I have found the issue. And I have an idea how to solve it... But it needs > a bit of a redesign of the whole channel / data

Re: Reading multiple channels under the same session

2019-01-30 Thread g4-lisz
I have found the issue. And I have an idea how to solve it... But it needs a bit of a redesign of the whole channel / data handling. The problem is that I call  ssh_event_remove_fd() in the callback function, which in turn de-registers this very callback function... This could have worked in a

Re: Reading multiple channels under the same session

2019-01-30 Thread g4-lisz
On 30.01.19 20:09, Alberto Garcia wrote: > Andreas, You can use Till example in this thread along with this > commands for the  ssh client: >  ssh -vvv -o StrictHostKeyChecking=no -D 0.0.0.0:11223 >  10.104.1.115 -p -N > > and to make it crash just run: > > import

Re: Reading multiple channels under the same session

2019-01-30 Thread g4-lisz
I think we face two different problems: One is related to my shaky code only. But the second one could be indeed related to polling and blocking on Windows. Till On 30.01.19 19:18, Alberto Garcia wrote: > We think it is because of a problem with libssh. Andreas maybe you can > bring some light

Re: Reading multiple channels under the same session

2019-01-30 Thread Alberto Garcia
Andreas, You can use Till example in this thread along with this commands for the ssh client: ssh -vvv -o StrictHostKeyChecking=no -D 0.0.0.0:11223 10.104.1.115 -p -N and to make it crash just run: import requests > import threading > def do_request(): > while 1: > resp =

Re: Reading multiple channels under the same session

2019-01-30 Thread Alberto Garcia
We think it is because of a problem with libssh. Andreas maybe you can bring some light to spot the bug? On Wed, Jan 30, 2019, 6:19 AM On 30.01.19 09:27, Andreas Schneider wrote: > > On Friday, January 25, 2019 3:26:10 PM CET g4-l...@tonarchiv.ch wrote: > >> On 24.01.19 22:09, Alberto Garcia

Re: [PATCH 0/4] dh-gex + dh: fix a couple of leaks

2019-01-30 Thread Andreas Schneider
On Wednesday, January 30, 2019 3:11:46 AM CET Jon Simons wrote: > Included here are some patches to the dh-gex and dh areas to fix > a few leaks and harden some error handling. Thank you very much for the fixes. I've pushed them upstream. I need to update all cwrap libs to allow running with

Re: [patch] SIGSEGV when adding Connector to Event

2019-01-30 Thread g4-lisz
Hi all, You finally find the test code attached. It's a bit complicated, but it can reproduce the issue: 1. Connect to an ssh server which supports direct socket tunnelling: > ./multichannelfw root myserver.com 22 This opens a local listening port at 20021 2. Open two or more simultaneous ssh

Re: Reading multiple channels under the same session

2019-01-30 Thread g4-lisz
On 30.01.19 09:27, Andreas Schneider wrote: > On Friday, January 25, 2019 3:26:10 PM CET g4-l...@tonarchiv.ch wrote: >> On 24.01.19 22:09, Alberto Garcia wrote: >>> Can you please post the link to the mentioned code? >>> Thanks >> Here you go. > Hi Till, > > if you send it as a patch I'm happy to

Re: Reading multiple channels under the same session

2019-01-30 Thread Andreas Schneider
On Friday, January 25, 2019 3:26:10 PM CET g4-l...@tonarchiv.ch wrote: > On 24.01.19 22:09, Alberto Garcia wrote: > > Can you please post the link to the mentioned code? > > Thanks > > Here you go. Hi Till, if you send it as a patch I'm happy to add it to the examples dir. Even if the code