execjob_launch fails to setup the environment properly if one of the environment variables has a \n or a comma or quotes

Description

While troubleshooting why DM did not work with cgroups we learned that PBS_JOBDIR was not being set. When we dumped the environment from /opt/altair/pas/12.1/pas/pbs_spawn/SpawnWrapper we see the following

'PATH': '/bin:/usr/bin', 'PAS_ACTION_DM_APP_ENVS': 'DM_GEOMETRY=1898x1058\nDM_APP_LAUNCH_STYLE=EARLY\n', 'PBS_JOBDIR': '/scratch/pbs.4832.host.x8z'

When I look at the hook input file I see the following.

pbs.event().env=TZ=Europe/Berlin,PATH=/bin:/usr/bin,PAS_APPLICATION=GlxSpheres,PAS_HPCBP_EXECUTABLE=/opt/pbs/default/bin/pbs_python,PAS_CLIENT_HOST=IP_ADDRESS,PAS_SERVER_VERSION=12.1.1,PAS_SERVER_PORT=17084,AIF_MODE=enterprise,VERSION=2.3.3,PAS_MEMORY=256,DM_SESSION_MGR=TurboVNC,PAS_DM_APP_SERVER_MONITOR_HOST=host,PBS_HOME=/var/spool/PBS,PAS_HPCBP_ARGUMENTS=runtime/iJobStart.py,PBS_PYTHON_PATH=/opt/pbs/default/bin/pbs_python,PAS_COMPUTE_MANAGER_JOB_NAME=GlxSpheres,PAS_GPU=true,PAS_PYTHON_PATH=/opt/pbs/default/bin/pbs_python,PAS_CLUSTER_NAME=host,DM_APP_MGR=VGL,PAS_DM_APP_GEOMETRY=1898x1058,PAS_JOB_NAME=GlxSpheres,PAS_DM_APP_SERVER_MONITOR_PORT=4909,PAS_VERSION=2.3.3,PAS_NCPUS=1,PAS_DM_APP_LAUNCH_STYLE=EARLY,DM_JOB=True,PAS_EXECUTABLE=/opt/VirtualGL/bin/glxspheres64,AIF_USER=demo,PBS_O_QUEUE=iworkq,PBS_O_HOST=host.europe.altair.com,HOME=/home/demo,PBS_JOBNAME=GlxSpheres,PBS_JOBID=4831.host,PBS_QUEUE=iworkq,PBS_JOBCOOKIE=000000003EAF0EA90000000020CD1082,PBS_NODENUM=0,PBS_TASKNUM=00000002,PBS_MOMPORT=15003,OMP_NUM_THREADS=0,NCPUS=0,PBS_ENVIRONMENT=PBS_BATCH,ENVIRONMENT=BATCH,USER_NAME=demo,AMS_TOKEN=null,PAS_ACTION_DM_CUSTOM_ACTION_TYPE=GET_SESSION,PAS_ACTION_DM_APP_ARGS=,PAS_ACTION_DM_APP_ENVS=DM_GEOMETRY=1898x1058
DM_APP_LAUNCH_STYLE=EARLY
,PAS_ACTION_DM_APP_WDIR=,PAS_ACTION_HWE_JSESSIONID=0788827BC2F47DBE5D88C35936F07E70,AIF_SPAWN_COOKIE=}À¾WÐ8¸Õ,TMPDIR=/var/tmp/pbs.4831.host,PBS_JOBDIR=/scratch/pbs.4831.host.x8z

As you can see it split the pbs.event().env file into three lines. I believe that this caused the hook to not properly read in all of the environment. Then when DM tried to launch it could not find the env PBS_JOBDIR and DM failed to launch the job.

Acceptance Criteria

None

Status

Assignee

Al Bayucan

Reporter

Scott Campbell

Severity

3-High

OS

None

Start Date

None

Pull Request URL

Story Points

1

Components

Fix versions

Priority

Blocker
Configure