Bug 1648589

Summary: recursively repeats command until no more processes
Product: [Fedora] Fedora Reporter: Brian J. Murrell <brian>
Component: setupAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 29CC: brian, karsten, lnykryn, me, ovasik, pfrankli, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: setup-2.12.1-2.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-10 03:18:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
make -d image PROFILE=WNDR4300V1 none

Description Brian J. Murrell 2018-11-10 20:26:27 UTC
Description of problem:
I'm not entirely sure this is in make, but as of F29, running make in a given project ends up calling bash shells recursively until the system is exhausted of resources.  This exact same operation in the exact same (NFS shared) project tree works find on F28

Version-Release number of selected component (if applicable):
make-4.2.1-10.fc29.x86_64

How reproducible:
100%

Steps to Reproduce:
1. download and unpack https://downloads.openwrt.org/releases/18.06.1/targets/ar71xx/nand/openwrt-imagebuilder-18.06.1-ar71xx-nand.Linux-x86_64.tar.xz
2. cd openwrt-imagebuilder-18.06.0-ar71xx-nand.Linux-x86_64/
3. make image PROFILE=WNDR4300V1

Actual results:
If you let it run without interrupting it, it will exhaust all of your system resources and result in a process tree that looks like https://paste.fedoraproject.org/paste/5Ty5VyLrwD3e4Jd2~BHq9Q where the recursive lists of shells is as long as the resources on your system will allow them to continue to open.

Expected results:
Should build the image without issue

Additional info:
Again, this is an F28->F29 regression.  This exact same operation on F28 works fine.

Comment 1 Brian J. Murrell 2018-11-16 12:38:45 UTC
Any idea here?

Comment 2 Patsy Griffin 2018-11-17 03:30:36 UTC
Hi,

I'm not seeing this fail on f29.  Can you provide a build log?

Thanks,
Patsy

Comment 3 Brian J. Murrell 2018-11-19 12:58:26 UTC
It doesn't produce any output at all.  I will attach the output of:

make -d image PROFILE=WNDR4300V1

Comment 4 Brian J. Murrell 2018-11-19 12:59:01 UTC
Created attachment 1507221 [details]
make -d image PROFILE=WNDR4300V1

Output of "make -d image PROFILE=WNDR4300V1".

Comment 5 Brian J. Murrell 2018-11-19 15:35:17 UTC
It's /etc/profile.d/lang.sh on F29.  When I [re-]move that file, the build works.  Somehow that file is causing bash to run itself recursively.

I notice that it is *significantly* different in F29 than F28.

Should I open a new ticket on the package it comes from: "setup" or will we just reassign this ticket to the "setup" package so that the history is there to be seen?

Comment 6 Brian J. Murrell 2018-11-19 17:06:50 UTC
And in /etc/profile.d/lang.sh it's this line that is causing the problem:

        eval $(sed -r -e 's/^[[:blank:]]*([[:upper:]_]+)=([[:print:][:digit:]\._-]+|"[[:print:][:digit:]\._-]+")/export \1=\2/;t;d' ${config})

because in that build PATH is set to:

PATH=/net/server/src/openwrt-imagebuilder-18.06.0-ar71xx-nand.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin:/net/server/src/openwrt-imagebuilder-18.06.0-ar71xx-nand.Linux-x86_64/staging_dir/host/bin:$PATH

and:

$ cat /net/server/src/openwrt-imagebuilder-18.06.0-ar71xx-nand.Linux-x86_64/staging_dir/host/bin/sed 
#!/usr/bin/env bash
dir="$(dirname "$0")"
export RUNAS_ARG0="$0"
export LD_PRELOAD="$dir/../lib/runas.so"
exec "$dir/../lib/ld-linux-x86-64.so.2" --library-path "$dir/../lib/" "$dir/.sed.bin" "$@"

causes bash to call itself recursively.

Comment 7 Brian J. Murrell 2018-11-22 16:23:26 UTC
Moving to setup component since this problem seems to be there, not make.

Comment 8 Ondrej Vasik 2018-12-10 14:19:55 UTC
lang.sh and lang.csh used to be part of initscripts package before. In F29 we moved them to setup package. I'll check whether there were some changes or not.

Comment 9 Brian J. Murrell 2018-12-10 15:01:06 UTC
Probably, ultimately for security if nothing else, perhaps scripts such as lang.[c]sh should fully-qualify the path to the tools it wants to use?

Comment 10 Fedora Update System 2019-06-24 12:19:41 UTC
FEDORA-2019-0045f042d7 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-0045f042d7

Comment 11 Fedora Update System 2019-06-24 22:46:13 UTC
setup-2.12.1-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-0045f042d7

Comment 12 Fedora Update System 2019-07-10 03:18:44 UTC
setup-2.12.1-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.