Bug 55829

Summary: System Hangs While trying to allocate memory with malloc()
Product: [Retired] Red Hat Linux Reporter: Deian Chepishev <dchepishev>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-11-07 12:18:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Deian Chepishev 2001-11-07 12:18:11 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
When I make an infinite cycle for allocating memory with malloc function. 
The first time when i start the program After the memory is finished the 
system Terminates the process, But if i start 2 processes simultaneously 
the system almost allways hangs completely. The interesting thing is that 
this happens if I use the default RedHat kernel shiped with RH7.2 (2.4.7). 
If I try with 2.4.14 this does not happen. Even regular user can crash the 
system

Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1. Write this code
#include<stdio.h>
int main(){
int *i;

while(1){
    i=(int*)malloc(10000);
}
return 0;
}
2.Compile the program
3. Run the program. If it does not hang from the first time. Start 2 
processes SIMULTANEOUSLY. It will hang for at most 4 tryes.	

Actual Results:  The system is Completely Hanged. I can not change the 
console with Alt-F1-6. I can do nothing from the keyboard. I do not know 
about the network but may be it hangs too.

Expected Results:  Instead of this the system should terminate the 
processes as it had done the first time when i Tryed this

Additional info:

Nothing Appears on the console.
My system is RH7.2 Default instalation. No patches applyed. 
Intel Celeron 433
163 MB RAM
BX440 chipset
But this works and on P3 733, 256 MB RAM, I815 chipset. The same 
Distrubution with all relevant patches applyed only the kernel is default. 
I have and kernel 2.4.14 compiled too and this is not happening with it. 
Even regular user can crash the system.

Comment 1 Arjan van de Ven 2001-11-07 12:28:04 UTC
The 2.4.9 kernel errata should have this fixed.