GwenNelson / distcc

Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

absence of DISTCC_SSH setting causes exec("ssh") failure #147

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version:
distcc-3.2_rc1-r1.ebuild in gentoo

Steps to reproduce:
gcc-4.8.3
binutils-2.24-r3
glibc-2.19-r1
/etc/distcc/hosts has ssh,lzo,cpp hosts only
sudo DISTCC_VERBOSE=1 FEATURES="distcc distcc-pump" pump emerge -v1 bzip2

Symptoms:
with DISTCC_VERBOSE=1, I see:
(dcc_run_piped_cmd) ERROR: failed to exec : No such file or directory
                                          ^ "ssh" should print here if it were truly not found. argv[0] to exec is some garbage (unprintable) value.

Cause:
Looking in the source code, I found the line emitting the error in ssh.c and 
traced back a bit. In the early parts of dcc_ssh_connect(), argv[0] is supposed 
to be set, but for some reason I can't discern, it never appropriately assigns 
the default value. Is this because of the cast from (const char *) to (char *) 
and my version of gcc? Maybe the problem is apparent to someone more familiar 
with the code. I didn't invest any more time once I'd found tho workaround.

Workaround:
adding DISTCC_SSH=ssh (what should be the default anyway) fixes the garbage 
(unprintable) argv[0] passed to exec()

Original issue reported on code.google.com by eli...@gmail.com on 8 Dec 2014 at 2:31

GoogleCodeExporter commented 9 years ago
Oops, looks like this is a bug in gentoo, actually. I found that 
/etc/env.d/02distcc is setting DISTCC_SSH="", causing the symptoms I described. 
Close this.

Original comment by eli...@gmail.com on 12 Dec 2014 at 8:03