Ticket #124 (closed defect)
poll() and accept() segmentation fault
|Reported by:||juzna||Owned by:||bagder|
I'm using ssh2 module in PHP, and this module uses libssh2. When trying libssh2 version that comes in my distribution, poll a accept calls did deadlock and never finished. When trying git version, it did seg fault.
I've fixed the seg fault problem (in packet.c there was forgotted to assign value to listen_state->channel, which caused to write to null pointer) and partially also deadlock problem (in channel.c). It work's now only for non-blocking calls, someone who understand it better could fix it.
In channel_forward_accept(), the do-while is trying to read data from transport layer and when it reads all, it gots PACKET_EAGAIN error which causes to stop reading data and return. So it will never try to accept the connection. (at least I think so).
Sorry for problems, but it's my first patch made ever so I'm not sure whether I'm doing it correctly. And I also dont know how to commit changes to git, so I'm posting it here.
If someone wanna give me some advices about how to commit patches, I'd be glad. You can use my email juzna.cz at gmail dot com