diff --git a/SOURCES/0001-wait-child-with-os-wait.patch b/SOURCES/0001-wait-child-with-os-wait.patch new file mode 100644 index 0000000..73b59e3 --- /dev/null +++ b/SOURCES/0001-wait-child-with-os-wait.patch @@ -0,0 +1,52 @@ +commit e7b3e6817421763eee37cb35ef8627bdd37a3690 +Author: Chunyu Hu +Date: Wed May 6 18:59:43 2020 +0800 + + Wait child with os.wait() + + os.popen() is an async method, it fork() child and exec() in child + with the arg command. If it's slow enough, main process could get + incomplete result. + + During our test, we find python3 is faster than python2,after coverting + to python3, 'groupadd' usually doesn't finish when the followed step iter + on groups, we would get '-1' as the groupid and lead to error. + + To reproduce it with python3: + /root/rpmbuild/BUILD/libhugetlbfs-2.21/huge_page_setup_helper.py < + +diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py +index a9ba2bf..01fc8dc 100755 +--- a/huge_page_setup_helper.py ++++ b/huge_page_setup_helper.py +@@ -169,6 +169,10 @@ else: + os.popen("/usr/sbin/groupadd %s" % userGroupReq) + else: + print("/usr/sbin/groupadd %s" % userGroupReq) ++ ++ # wait for the groupadd finish ++ os.wait() ++ + groupNames = os.popen("/usr/bin/getent group %s" % userGroupReq).readlines() + for line in groupNames: + curGroupName = line.split(":")[0] +@@ -244,6 +248,9 @@ else: + print("/usr/bin/hugeadm --set-recommended-shmmax") + print() + ++# wait for the hugepage setups finish ++os.wait() ++ + # figure out what that shmmax value we just set was + hugeadmexplain = os.popen("/usr/bin/hugeadm --explain 2>/dev/null").readlines() + for line in hugeadmexplain: diff --git a/SPECS/libhugetlbfs.spec b/SPECS/libhugetlbfs.spec index 772c801..7a92b44 100644 --- a/SPECS/libhugetlbfs.spec +++ b/SPECS/libhugetlbfs.spec @@ -1,6 +1,6 @@ Name: libhugetlbfs Version: 2.21 -Release: 16%{?dist} +Release: 17%{?dist} Summary: A library which provides easy access to huge pages of memory Group: System Environment/Libraries License: LGPLv2+ @@ -38,6 +38,10 @@ Patch7: huge_page_setup_helper-python3-convert.patch # Fixes for downstream COVSCAN and RPMDiff execshield complaints: Patch8: tests-fix-covscan-SHELLCHECK_WARNING-complaints.patch Patch9: tests-include-missing-LDFLAGS-to-make-targets.patch +# Patch10: RHBZ#1832243 "hugeadm: ERROR: Invalid group specification (-1)" fix +# upstream pull request +# https://github.com/libhugetlbfs/libhugetlbfs/pull/48/commits/e7b3e6817421763eee37cb35ef8627bdd37a3690 +Patch10: 0001-wait-child-with-os-wait.patch # Upstream follow-ups for libhugetlbfs-2.21 Patch50: 0001-tests-Add-utility-to-check-for-a-minimum-number-of-o.patch @@ -150,6 +154,7 @@ to verify the libhugetlbfs functionality and validate the library. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 pathfix.py -i %{__python3} -pn huge_page_setup_helper.py \ tests/run_tests.py @@ -224,6 +229,9 @@ rm -fr $RPM_BUILD_ROOT/%{_sbindir}/ %{_libdir}/libhugetlbfs %changelog +* Tue May 26 2020 Rafael Aquini - 2.21-17 +- hugeadm: "ERROR: Invalid group specification" fix (1832243) + * Mon Apr 13 2020 Rafael Aquini - 2.21-16 - libhugetlbfs-tests: harden the testcases to satisfy EXECSHIELD RPMDiff checks (1785296)