bugGNU Parallel - build and execute command lines from standard input in parallel - Bugs: bug #49970, Python child process dies if --env...

 
 

bug #49970: Python child process dies if --env is used

Submitted by:  Ole Tange <tange>
Submitted on:  Sun 01 Jan 2017 04:05:11 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Ole Tange <tange>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 01 Jan 2017 06:33:42 PM UTC, comment #4:

Fixed in [9f7eaa5].

Ole Tange <tange>
Project AdministratorIn charge of this item.
Sun 01 Jan 2017 04:39:14 PM UTC, comment #3:

#!/usr/bin/perl
use MIME::Base64;
$SIG{CHLD}="IGNORE";
$eval=q(
$bashfunc = "fu() {
echo \$1
};
export -f fu >/dev/null;";
@a="python -c \"import os;f = os.popen('uname -p');output = f.read();rc = f.close()\"";
exec "/bin/bash","-c",($bashfunc."@a");
die"exec:$!\n";);
eval$eval;

Ole Tange <tange>
Project AdministratorIn charge of this item.
Sun 01 Jan 2017 04:09:49 PM UTC, comment #2:

The setuptool spans a shell, and the signal handler is apparently inherited.

The fix is simple, but can we make an example that does not use 'setuptools' - which can be used in the test suite?

Ole Tange <tange>
Project AdministratorIn charge of this item.
Sun 01 Jan 2017 04:07:01 PM UTC, comment #1:

This fails:

#!/usr/bin/perl
use MIME::Base64;
$SIG{CHLD}="IGNORE";
$eval=q(
$bashfunc = "fu() {
echo \$1
};
export -f fu >/dev/null;";
@a="python -c \"import setuptools\" 2";
exec "/bin/bash","-c",($bashfunc."@a");
die"exec:$!\n";);
eval$eval;

Works:

#!/usr/bin/perl
use MIME::Base64;
$chld=$SIG{CHLD};
$SIG{CHLD}="IGNORE";
$eval=q(
$bashfunc = "fu() {
echo \$1
};
export -f fu >/dev/null;";
@a="python -c \"import setuptools\" 2";
exec "/bin/bash","-c",($bashfunc."@a");
die"exec:$!\n";);
$SIG{CHLD}=$chld;
eval$eval;

Ole Tange <tange>
Project AdministratorIn charge of this item.
Sun 01 Jan 2017 04:05:11 PM UTC, original submission:

http://lists.gnu.org/archive/html/parallel/2016-12/msg00018.html

function fun {
echo $1
}
export -f fun

## Works fine
parallel 'python -c "import setuptools"' ::: 2

## Breaks
parallel --env fun 'python -c "import setuptools"' ::: 2

Ole Tange <tange>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tange (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 01 Jan 2017 06:33:42 PM UTCtangeStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1