[Bug 1131] buffer_append_space: alloc not supported Error with V 4.2p1

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Apr 4 10:51:48 EST 2006


http://bugzilla.mindrot.org/show_bug.cgi?id=1131





------- Comment #23 from djm at mindrot.org  2006-04-04 10:51 -------
Created an attachment (id=1114)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1114&action=view)
Hopefully fix the problem

I think I get it now :)

It looks like the problem is occuring when the buffer offset is close to, but
not exceeding BUFFER_MAX_CHUNK and the allocation is close to BUFFER_MAX_LEN. 

channels.c tries to do the right thing and stop reading when the buffer is full
like this, but it didn't take into account the 32768 byte allocation increment
that the buffer code uses to avoid having to go and fetch more memory at each
buffer_append_space() call. 

Hopefully this patch will fix the problem.

It adds a buffer_check_alloc(buffer, len) function that the channel.c code can
use to test whether a CHAN_RBUF allocation can fit. It is more logical to keep
this check in the buffer.c code so it can stay synced with the actual
append_space math.

The patch also chunks the buffer memory allocations, so the number of bytes
allocated to the buffer is always a multiple of 32768, which is a little
neater. 

Please let me know if it solves your problem (you will probably need to pull
out the last debug patch to apply it)




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list