[mvapich-discuss] problem with mpirun_rsh.c in 0.9.9-beta2
Karl W. Schulz
karl at tacc.utexas.edu
Wed Mar 21 15:08:07 EDT 2007
Hello,
I just ran into a problem with mpirun_rsh (0.9.9-beta2) regarding the
size of the LD_LIBRARY_PATH in the underlying user environment which
would result in a core dump. Looking at the source, it appears that the
allocation for "remote_command" does not account for arbitrary
LD_LIBRARY_PATH lengths. There is some hardcoded padding in the
"str_len" calculation, but it does not account for larger lengths in
general.
To resolve in our case, we pre-computed the size prior to computing the
str_len which is used to allocate the remote_command variable.
Something along the lines of the following should do the trick:
/* Quantify LD_LIBRARY_PATH length */
if(( ld_library_path = getenv( "LD_LIBRARY_PATH" ) ) != NULL )
len_LD_PATH = strlen(ld_library_path);
.
.
.
str_len = strlen(command_name) + strlen(env) + strlen(wd) +
strlen(device_port_env) + 530 + len_LD_PATH;
Regards,
Karl
More information about the mvapich-discuss
mailing list