Subject: [libssh2] Multiple channel creation bug

[libssh2] Multiple channel creation bug

From: Paul Thomas <thomaspu_at_gmail.com>
Date: Fri, 12 Sep 2008 21:56:25 -0400

Developers,

I've ran into a bug that's causing me some serious trouble using the
libssh2 library. I'm trying to get x11 forwarding working on my custom
ssh client and am having problems creating more than one channel. I
was browsing the bug repository and noticed that two other people have
written up bug reports for what I believe is the same issue. The two
bug reports are here for quick reference:

http://sourceforge.net/tracker/index.php?func=detail&aid=1878973&group_id=125852&atid=703942
http://sourceforge.net/tracker/index.php?func=detail&aid=1902169&group_id=125852&atid=703942

In good spirits of trying to see if I can shed some light on whats
going wrong, I made an interesting discovery that I think might help.
I've found that If I create two channels (one is setup and has a pty
and shell allocated on it) one after the other, the second channel
creation always fails and returns a NULL pointer. What I found
interesting is that by watching the ssh daemon's debugging output,
both channels ARE created successfully. Yet libssh2 returns a NULL
pointer for the 2nd channel.

I experimented further and did something like this:
  create first channel
  create 2nd channel
    if 2nd channel creation fails
        retry channel creation

Now this works, but whats really interesting here is that:
 1st channel creation goes through (seen on server as successful) and
libssh2 returns valid channel pointer
 2nd channel creation goes through (seen on server as successful) and
libssh2 returns NULL
 3rd channel creation (retrying..channel create) goes through (nothing
seen on server log) and libssh2 returns valid channel pointer

Hope this explanation helps with this bug. Kinda seems like something
is getting messed up in the depths of the libssh2_packet_requirev_ex
function....

Paul

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-09-13