From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120 Description of problem: if /proc is not mounted when you try to build the kernel RPM (for example if you are building it in a chrooted environment) then it causes the machine to go into hard swapping and then ultimately crash. The reason is actually very simple, you calculate the number of processors using a file in the /proc file system and if this query of the proc file system doesn't work then the make command ends up being "make -j bzImage" rather than "make -j 2 bzImage" (using a dual processor machine as an example). This ends up being like a fork bomb on the computer and ultimately takes it down. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. unmount /proc 2. rpm -ba kernel-*.spec Actual Results: machine starts hard swapping then ultimately crashes. Expected Results: kernel builds Additional info: Here is a patch to the spec file which will fix this problem: diff -u -r1.1 kernel-2.4.spec --- kernel-2.4.spec 2002/01/23 00:54:05 1.1 +++ kernel-2.4.spec 2002/01/23 02:28:37 @@ -1242,7 +1242,7 @@ # if RPM_BUILD_NCPUS unset, set it if [ -z "$RPM_BUILD_NCPUS" ] ; then - RPM_BUILD_NCPUS=`egrep -c "^cpu[0-9]+" /proc/stat || :` + RPM_BUILD_NCPUS=`egrep -c "^cpu[0-9]+" /proc/stat || echo 1` if [ $RPM_BUILD_NCPUS -eq 0 ] ; then RPM_BUILD_NCPUS=1 fi
Created attachment 43574 [details] patch to fix the problem
fix added to the rawhide kernel
This bug reappeared in 2.4.18-0.13 out of the Skipjack beta that is out on the ftp site.
tested rebuilding kernel-2.4.21-9.0.1.EL.src.rpm with /proc not mounted --> success Looks like this has been fixed in current kernel packages --> closing BZ