[distcc] Problem with distcc doing remote compiles locally

Martin Pool mbp at sourcefrog.net
Thu Mar 2 23:04:44 GMT 2006

On  2 Mar 2006, Victor Norman <vtnpgh at yahoo.com> wrote:
> I am having a problem right now with my distcc not being able to run compiles
> in which it chooses a distccd that happens to be on the same machine.  Whenever
> the local machine is chosen, the distcc verbose output shows:
> distcc[7434] (dcc_connect_by_addr) started connecting to
> distcc[7434] ERROR: failed to connect to File exists
> or, after manually having deleted the lock/state directory before starting the compile:
> distcc[10729] (dcc_connect_by_addr) started connecting to
> distcc[10729] ERROR: failed to connect to No such file or directory

I think there is a bug in the select-for-write loop that Dan added to

       if (failed == -1 && errno != EINPROGRESS) {
                  "failed to connect to %s: %s", s, strerror(errno));
           ret = EXIT_CONNECT_FAILED;
           goto out_failed;

'failed' is set by the original call to connect(), but errno will be
reassigned by the various other calls done inside the loop.  (I think
strictly it is undefined except immediately after a library/system call
that fails?)   At any rate it seems risky.

Perhaps that check should be hoisted out of the loop.  Inside the loop
we can just keep select()ing and checking for errors until we either
timeout, fail or connect.

Victor, could you test that?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/distcc/attachments/20060303/825c35a1/attachment.bin

More information about the distcc mailing list