Bug 1400371 - oorexx execution of Linux pgrep command returns invalid results
Summary: oorexx execution of Linux pgrep command returns invalid results
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: oorexx
Version: 24
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Gérard Milmeister
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-01 02:17 UTC by Don Swaner
Modified: 2017-08-08 19:23 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 19:23:21 UTC
Type: Bug


Attachments (Terms of Use)

Description Don Swaner 2016-12-01 02:17:30 UTC
Description of problem:
When the pgrep command is executed by oorexx, the result is invalid.  (Note that pgrep is not an oorexx command, but a linux command.)

Version-Release number of selected component (if applicable):
oorexx-4.2.0-1.fc23.x86_64

How reproducible:
Always

Steps to Reproduce:
1.  From the bash command line, issue the following commands:
pgrep -f zort-zort
pgrep -f zort-zort | cat
Note that there is no output from either command (the nonexistent process zort-zort is not running).

2.  Run the commands:
rexx -e "'pgrep -f zort-zort'"
rexx -e "'pgrep -f zort-zort | cat'"

Note that for the first command, one invalid process ID is returned and for the
second, 2 invalid process IDs are returned.

3. If the pgrep commands are run implicitly from a rexx script:

#!/usr/bin/rexx
trace 'R'
"pgrep -f zort-zort"
"pgrep -f zort-zort | cat"
"pgrep -f zort-zort | rxqueue"
do while queued() > 0
    parse pull zans
    say zans
    "ps -F --pid "zans
end
exit

The results differ from item 2: zero or 1 invalid process IDs are returned.
(Note rxapi must be running to use rxqueue.)

Actual results:
Invalid process IDs are returned.

Expected results:
No process IDs are returned for a pgrep on non-existent processes.

Additional info:

Comment 1 Don Swaner 2016-12-01 21:53:32 UTC
If the "-c" or "--count" option is added to pgrep, from bash, "pgrep -c -f zort-zort | cat" displays the correct result: 0.  However, when run under oorexx, the result displayed is 1.  Now 1 is the return code from pgrep when no items are found (i.e. the count is zero), and the zero count is output on stdout (correctly, under bash).  Similary, under oorexx, when stdout of "pgrep -c -f zort-zort" is piped to rxqueue, then 1 is pulled from the queue (instead of the correct answer 0).

Comment 2 Don Swaner 2016-12-24 19:21:11 UTC
These invalid results also happen in F25 (same version of oorexx).  A work-around is to use "ps -A -o args | rxqueue" and parse the queued output for the target process.

Comment 3 Fedora End Of Life 2017-07-26 00:01:54 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-08-08 19:23:21 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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