wiki:access/FixToUMParexeWithUpdatedBash

FIXING ACCESS UM JOBS

AFFECTED BY UPDATED BASH SHELL

....

WORK-IN-PROGRESS                         [ 30/9/2014]


Background

Due to discovery of a serious vulnerability within unix's bash shell, patched version of bash was quickly applied on raijin and other servers where there was potential for its exploitation.

The patched version of bash changes the way a utility - make_parexe.pl works. This utility is widely used within the UM run environment for running in MPI mode. make_parexe.pl is used to generate parexe - a wrapper script used by mpirun.

The changed parexe contains invalid lines. Consequently, it is likely that any UM (or reconfiguration ) job on raijin will fail.

Fortunately fixing your ACCESS UM job to make it work again is quite straightforward.

There are two different ways of fixing your job if it is affected by the updated bash shell.

Method 1: Patch make_parexe.pl

Locate the make_parexe.pl utility used in your run and add an extra line in the following bit of code.

BEFORE:

foreach $key ( sort keys %ENV ){
   $value = $ENV{$key};

   print $key,"\n";
   push @print_array, "$key='$value'\n";
}

AFTER

foreach $key ( sort keys %ENV ){
   $value = $ENV{$key};
   $key =~ s/\(\)//g;
   print $key,"\n";
   push @print_array, "$key='$value'\n";
}





Method 2: Use a simple edit script to correct the output of make_parexe.pl

In some cases, your job may be using make_parexe.pl from a shared area which is not writable by you and the person who have update permission is not immediately available.

In this case, a simple edit script below can be used to remove the problem lines in parexe (the output of make_parexe.pl).

EXAMPLE:

#!/bin/bash

echo "Removing bash module line in parexe"

ed parexe  <<\EOF
/BASH_FUNC_module()=
d
d
.
w
q
EOF


The above script should be executed just after make_parexe.pl is executed in your job.
Here is an example on how the fix is applied. (The edit script above was named handedit_parexe_bash_bug_fix

$MY_BINDIR/um/make_parexe.pl -c $PAREXE  -x $LOADMODULE -p ${MY_DATADIR_PFX}
$MY_BINDIR/um/handedit_parexe_bash_bug_fix          #this is added line
chmod +x $PAREXE




  • NOTE: If user's UM run utilise UM runscripts from a shared area, user will need to have their own copy of all the UM runscripts including make_parexe.pl and prepend the new path into their $PATH.



Please email access_help@… if you need further help.


Contact regarding this page: azs@… -or - L.Wenming@…



Last modified 6 years ago Last modified on Oct 10, 2014 2:26:40 PM