Last modified: 2014-02-12 14:14:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50811, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48811 - jsub breaks whitespaces in arguments
jsub breaks whitespaces in arguments
Status: RESOLVED WONTFIX
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Marc A. Pelletier
:
: 61140 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-25 14:19 UTC by Liangent
Modified: 2014-02-12 14:14 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2013-05-25 14:19:20 UTC
Exactly the same behavior: https://jira.toolserver.org/browse/TS-1479
Comment 1 Tim Landscheidt 2013-05-28 03:44:27 UTC
Wow, that was a hard one to track down.  I spent literally an hour suspecting Perl's exec.

It's essentially a bug (or a *very* odd feature) in qsub's "-b" option that is set by jsub:

| $ /usr/bin/qsub $PWD/test.py '1=2 3' '$4'

=> "['/var/spool/gridengine/execd/tools-exec-01/job_scripts/143663', '1=2 3', '$4']"

| $ /usr/bin/qsub -b n $PWD/test.py '1=2 3' '$4'

=> "['/var/spool/gridengine/execd/tools-exec-02/job_scripts/143662', '1=2 3', '$4']"

| $ /usr/bin/qsub -b y $PWD/test.py '1=2 3' '$4'

=> "['/home/scfc/tmp/test.py', '1=2', '3']"

I have to think more about whether "-b y" is a good or bad idea (for example for binary commands), or if we should double-escape arguments to the user script, or what other options we have, and maybe ask on the mailing list.

Thanks for the report.
Comment 2 Liangent 2013-05-28 04:06:40 UTC
(In reply to comment #1)
> Wow, that was a hard one to track down.  I spent literally an hour suspecting
> Perl's exec.
> 
> It's essentially a bug (or a *very* odd feature) in qsub's "-b" option that
> is
> set by jsub:
> 
> | $ /usr/bin/qsub $PWD/test.py '1=2 3' '$4'
> 
> => "['/var/spool/gridengine/execd/tools-exec-01/job_scripts/143663', '1=2 3',
> '$4']"
> 
> | $ /usr/bin/qsub -b n $PWD/test.py '1=2 3' '$4'
> 
> => "['/var/spool/gridengine/execd/tools-exec-02/job_scripts/143662', '1=2 3',
> '$4']"
> 
> | $ /usr/bin/qsub -b y $PWD/test.py '1=2 3' '$4'
> 
> => "['/home/scfc/tmp/test.py', '1=2', '3']"

Note that in this command it's more buggy than that JIRA bug: $4 seems missing here.

> 
> I have to think more about whether "-b y" is a good or bad idea (for example
> for binary commands), or if we should double-escape arguments to the user
> script, or what other options we have, and maybe ask on the mailing list.
> 
> Thanks for the report.
Comment 3 Tim Landscheidt 2013-05-28 04:16:56 UTC
(In reply to comment #2)
> [...]
> Note that in this command it's more buggy than that JIRA bug: $4 seems
> missing
> here.
> [...]

I wouldn't rate bugginess, they both don't work as they should :-).  And just in case someone from Toolserver stumbles onto this bug: The Toolserver bug is different to this ("qcronsub" doesn't use "-b y") and my fix there works (or would work if it was applied).
Comment 4 Liangent 2013-06-16 09:25:59 UTC
btw My use case may require -b y (running a PHP script with php command).
Comment 5 Marc A. Pelletier 2013-07-24 19:38:19 UTC
This particular bug is actually triggered by qsub evaluating arguments through a shell when it really shouldn't; the bug may or may not be apparent depending on the amount of quoting before the command line reaches it -- relying on a specific behaviour is bound to be troublesome.

It's not possible to have jsub just blindly add a level of quoting since that may simply end up overquoting the arguments.  The maintainers can add extra quoting when appropriate, though that makes invocation more brittle than it should.

The "proper" solution is to not rely on the number of shell evaluations arguments will go through before ending up on the exec node; either by providing any arguments through a script (and submitting /that/) or by passing arguments through a file.

Marking "WONTFIX" since the bug is in qsub and there is no plausibility that upstream would even consider a change that would break every user of gridengine and introduce incompatibilities with Oracle's version.
Comment 6 Tim Landscheidt 2014-02-12 14:14:13 UTC
*** Bug 61140 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links