Ticket #353 (closed bug: fixed)

Opened 10 months ago

Last modified 9 months ago

[mpich2-dev] smpd + mpiexec_rsh.c

Reported by: Jeffrey Frey <frey@…> Owned by: jayesh
Priority: major Milestone:
Component: mpich2 Keywords:
Cc:

Description

Has anyone else has run into this bug before...it exists in 1.0.7 and
1.0.8 (at least) and affects smpd with the mpiexec_rsh startup.


In src/pm/smpd/mpiexec_rsh.c:475 the rsh command string is created as:


            MPIU_Snprintf(pExe, SMPD_MAX_EXE_LENGTH - curLen, "
\"PMI_RANK=%d\" \"PMI_SIZE=%d\" \"PMI_KVS=%s\" \"PMI_ROOT_HOST=%s\"
\"PMI_ROOT_PORT=%d\" \"PMI_ROOT_LOCAL=0\" \"PMI_APPNUM=%d\" \"%s\"",
                launch_node_ptr->iproc, launch_node_ptr->nproc,
smpd_process.kvs_name, root_host, root_port, launch_node_ptr->appnum,
exe);


Note the escaped quotes around the final argument [exe] in the format
string.  This resulting string [pExe] is later re-parsed by
smpd_launch_process; if the string in [exe] contains any quote
characters then the parsing inside smpd_launch_process() will mangle
the argument list to be passed to the executable.  E.g.


    ... "PMI_APPNUM=####" "/home/frey/mpitest "--x=y" testing"


gets parsed into an argv[] list of


   argv[0] = "/home/frey/mpitest "
   argv[1] = "--x"
   argv[2] = "="
   argv[3] = "y testing"
   argv[4] = NULL


by smpd_launch_process().  Note that the quotes around "--x=y" were
introduced by mpiexec, since the argument contains an "=" which is
used as a delimiter character in the string utilities -- it was not
explicitly quoted in my invocation of mpiexec.


I think the quoting in the code cited above (src/pm/smpd/
mpiexec_rsh.c:475) was mistakenly introduced, since all three command-
building code sections coming before it in that source file do NOT
quote [exe] in the command string they create.  Here's a diff for src/
pm/smpd/mpiexec_rsh.c:



== SNIP ====
475c475
<           MPIU_Snprintf(pExe, SMPD_MAX_EXE_LENGTH - curLen, "
\"PMI_RANK=%d\" \"PMI_SIZE=%d\" \"PMI_KVS=%s\" \"PMI_ROOT_HOST=%s\"
\"PMI_ROOT_PORT=%d\" \"PMI_ROOT_LOCAL=0\" \"PMI_APPNUM=%d\" \"%s\"",
---
 >           MPIU_Snprintf(pExe, SMPD_MAX_EXE_LENGTH - curLen, "
\"PMI_RANK=%d\" \"PMI_SIZE=%d\" \"PMI_KVS=%s\" \"PMI_ROOT_HOST=%s\"
\"PMI_ROOT_PORT=%d\" \"PMI_ROOT_LOCAL=0\" \"PMI_APPNUM=%d\" %s",
==== SNIP ==




::::::::::::::::::::::::::::::::::::::::::::::::::::::
   Jeffrey T. Frey, Ph.D.
   Systems Programmer IV / Cluster Management
   Network & Systems Services / College of Engineering
   University of Delaware, Newark DE  19716
   Office: (302) 831-6034  Mobile: (302) 419-4976
   http://turin.nss.udel.edu/

   99 A1 7F 5E 71 70 8A 38  3C 4A A2 B1 4D 0A B2 49
::::::::::::::::::::::::::::::::::::::::::::::::::::::



Attachments

Change History

Changed 10 months ago by Jeffrey Frey

  • id set to 353

This message has 0 attachment(s)

Changed 10 months ago by jayesh

  • owner set to jayesh

Changed 9 months ago by thakur

  • status changed from new to closed
  • resolution set to fixed

WARNING! You need to either login using OpenID here or enter your email address here before you can create or edit tickets. Otherwise the ticket will get treated as spam. More information on creating tickets can be found here.

Don't forget to add your email address to the cc list to make sure that you get updated of the ticket status.

Add/Change #353 ([mpich2-dev] smpd + mpiexec_rsh.c)

Author



Change Properties
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.