Bug 1416796 - rlRun -s can end in an endless loop under specific conditions
Summary: rlRun -s can end in an endless loop under specific conditions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Jiri Jaburek
URL:
Whiteboard:
Depends On: 1361246
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-26 12:45 UTC by Frantisek Sumsal
Modified: 2018-03-16 12:25 UTC (History)
5 users (show)

Fixed In Version: beakerlib-1.17-13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-16 12:25:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Frantisek Sumsal 2017-01-26 12:45:20 UTC
Description of problem:
Some change in the testing version causes rlRun -s being stuck in an endless loop under some circumstances. I guess the culprit is commit 688273145292c75fb3e5ea013621746bd713086d.

Version-Release number of selected component (if applicable):
beakerlib-1.13-1.el7eso.noarch

How reproducible:
always

Steps to Reproduce:
# cat loop.sh
#!/bin/bash

. /usr/share/beakerlib/beakerlib.sh || exit 1

function sleep() {
    rlLogInfo "Waiting $1 secs"
    /bin/sleep $1
}

rlJournalStart
    rlPhaseStart FAIL
        rlRun -s "systemd-run --scope ./test.sh" 
    rlPhaseEnd
rlJournalEnd

# cat test.sh
#!/bin/bash

echo "Forking sleep"
( echo "Forked"; while true; do sleep 1; done ) &
echo "Main end"

Actual results:
# bash loop.sh 

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Phase of FAIL type
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'systemd-run --scope ./test.sh'
Running scope as unit run-18865.scope.
Forking sleep
Main end
Forked
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs
:: [ 07:39:06 ] :: [ INFO    ] :: Waiting 0.01 secs (# see testing.sh:799)
...

Expected results:
# rpm -q beakerlib
beakerlib-1.11-1.el7.noarch
# bash loop.sh 

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Phase of FAIL type
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'systemd-run --scope ./test.sh'
Running scope as unit run-19470.scope.
Forking sleep
Main end
Forked
:: [   PASS   ] :: Command 'systemd-run --scope ./test.sh' (Expected 0, got 0)
:: [ 07:40:34 ] :: JOURNAL XML: /var/tmp/beakerlib-h11RGSv/journal.xml
:: [ 07:40:34 ] :: JOURNAL TXT: /var/tmp/beakerlib-h11RGSv/journal.txt

Comment 1 Dalibor Pospíšil 2017-01-26 12:58:00 UTC
This is caused by fix of bz1361246, let's continue discussion there.


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