patch for fakeroot faked.c

your name john.k.doe at
Wed Nov 18 23:07:02 UTC 2009

we have discovered a fakeroot deadlock, and we've attached a
source-patch that solves the problem at our site.

the outward manifestation is that *faked* & the client (in our case,
usually "*chown -R ...*") appear to be deadlocked, with faked hanging at
listen() and the client hanging at read().

adding some debug-output (and writing to /dev/shm/ to cut down on the
timing differences), we discovered that some of the writes from the
client that were not full-length "*struct fake_msg*" buffers were being
accepted as such.

this would corrupt the stream, and everything later in the stream would
be off.

the cascading problem would be that process_msg() would get values for
functions to call that were out of bounds and skip them entirely.  the
final result would be that the client would finish sending messages for
which it expected replies, and faked would have thrown all of its
messages away as invalid, and go back to listening for more.

the attached patch, when applied, should be pretty self-explanatory:  if
the size of the buffer read is not of the appropriate size, then
continue back to the top of the loop and get just enough more from the
read to fill the buffer.

this solves the problem for us.

let us know if you need any further details, or what we might do in
order to help properly get this patch into a place where it can be

++ kirk beitz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fakeroot-tcp-client-server-deadlock.patch
Type: text/x-diff
Size: 1177 bytes
Desc: not available
URL: <>

More information about the Ubuntu-devel-discuss mailing list