Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 58864 - When /proc not mounted kernel SRPM crashes machine
When /proc not mounted kernel SRPM crashes machine
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-01-25 20:17 EST by Ben Woodard
Modified: 2007-04-18 12:39 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-24 13:51:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to fix the problem (411 bytes, patch)
2002-01-25 20:19 EST, Ben Woodard
no flags Details | Diff

  None (edit)
Description Ben Woodard 2002-01-25 20:17:31 EST
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:

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
Comment 1 Ben Woodard 2002-01-25 20:19:27 EST
Created attachment 43574 [details]
patch to fix the problem
Comment 2 Arjan van de Ven 2002-02-11 12:24:39 EST
fix added to the rawhide kernel
Comment 3 Ben Woodard 2002-04-11 18:53:37 EDT
This bug reappeared in 2.4.18-0.13 out of the Skipjack beta that is out on the
ftp site.
Comment 4 Dave Maley 2004-02-24 13:51:07 EST
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

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