www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

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


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:


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


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
libssh2-devel mailing list
Received on 2008-09-13

the libssh2 team