OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Build Failure
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Michael Jones - 06.03.2019

FS#2164 - When compiling with zero packages configured, the compilation hangs forever with a call to "cat"

Supply the following if possible:
- Device problem occurs on
- Software versions of OpenWrt/LEDE release, packages, etc.
- Steps to reproduce

 

git clone –depth 1 https://github.com/openwrt/openwrt.git openwrt-reproduce-package-cat-bug
cd openwrt-reproduce-package-cat-bug
cp $attached_file_.config .config
make V=sc

The build process hangs after these log lines:

find .tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost   -o ./Module.symvers    -S    -s -T -

make[5]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.14.104’ touch /home/jonesmz/openwrt-reproduce-package-cat-bug/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.14.104/.modules
make -C image compile TARGET_BUILD=
make[5]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/target/linux/ipq806x’ make[5]: warning: jobserver unavailable: using -j1. Add ‘+’ to parent make rule.
make[5]: Nothing to be done for ‘compile’.
make[5]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/target/linux/ipq806x/image’ make[4]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/target/linux/ipq806x’ make[3]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/target/linux’ time: target/linux/compile#2.58#0.96#1.99
make[2]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug’ export MAKEFLAGS= ;make -w -r diffconfig
make[2]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug’ make[2]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug’ make[3]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/package/libs/libjson-c’ make[3]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/package/libs/libjson-c’ time: package/libs/libjson-c/host-compile#0.16#0.08#0.22
make[3]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/package/libs/libubox’ make[3]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/package/libs/libubox’ time: package/libs/libubox/host-compile#0.68#0.36#0.98
make[3]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/package/system/opkg’ make[2]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug’ make[3]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug/package/system/opkg’ time: package/system/opkg/host-compile#0.55#0.25#0.75
make[2]: Leaving directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug’ make[2]: Entering directory ‘/home/jonesmz/openwrt-reproduce-package-cat-bug’ make[2]: warning: -jN forced in submake: disabling jobserver mode.
rm -rf /home/jonesmz/openwrt-reproduce-package-cat-bug/staging_dir/packages/ipq806x
mkdir -p /home/jonesmz/openwrt-reproduce-package-cat-bug/staging_dir/packages/ipq806x

And the following process tree

/bin/bash
- make -j25 V=sc

  1. /bin/sh -c _limit=`ulimit -n` ; .............
  2. make -w -r world
    1. make -j1 package/install
    2. bash -c cat 2>/dev/null
      1. cat

The attached .config file has a minimal configuration where as few packages as possible selected. In this case, I think I’ve managed to get it down to zero packages. I believe that what’s failing is this line:

./package/Makefile: $(call opkg_package_files,$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))

Where if this line is executed when $PACKAGE_INSTALL_FILES expands to nothing, then the “cat” program expects to read data from standard in, which will wait forever.

An easy workaround is to add /dev/null to the list of files to cat, such as

./package/Makefile: $(call opkg_package_files,$(foreach pkg,$(shell cat /dev/null $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))

But you still end up with failures later, such as opkg being given an empty list of packages to install.

   .config (51.1 KiB)
Michael Jones commented on 06.03.2019 02:52

Wow, my formatting got absolutely destroyed. Sorry about that.

I apparently can't edit the bug, but can resubmit if that is needed

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing