Bug 124547

Summary: C program using all memory kills mouse and alt-tab in X
Product: [Fedora] Fedora Reporter: Raphael Clifford <raphael>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-19 15:47:57 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:
Attachments:
Description Flags
app that can cause the problem none

Description Raphael Clifford 2004-05-27 13:17:03 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124

Description of problem:
If I run a simple C program that allocates a very large amount of
memory and then writes to itm the system starts thrashing as expected.
Then, if I kill it after a minute or so some of the following happen
(not always the same subset)

1) The mouse pointer dissappears
2) alt-tab does do anything at all
3) The mouse is still there but clicking has no visible affect.

I can always still using the existing xterm is I am focussed on it. 
Restarting X fixes things.


Version-Release number of selected component (if applicable):
2.4.22-1.2188.nptl

How reproducible:
Always

Steps to Reproduce:
1. Run a C program that allocates more memory than is available then
writes to it
2. Wait for it to thrash for a minute or so
3. Kill the program using ctrl-C
    

Actual Results:  Mouse pointer has gone and/or alt-tab does not work.
In any case it is not possible to change to another window and you
have to restart X to be able to use it properly.

Expected Results:  X should be working as usual.

Additional info:

The OOM killer appears NOT to have run (nothing in dmesg).  It seems
that something else is happening. One suggestion has been that some
core Gnome app tries to allocate/use memory and fails which causes the
mouse/focus to die and that alt-tab is in some way tied to the
mouse/focus.

Comment 1 Raphael Clifford 2004-05-27 13:19:56 UTC
Created attachment 100628 [details]
app that can cause the problem

Run this app with ./progOLN 20000000 100

and it will cause the problem. Increase the first number if memory is not fully
used up by these parameters.

Comment 2 Dave Jones 2004-06-19 15:47:57 UTC
if those apps are misbehaving when theres a shortage of memory, the
bug lies with those apps, not with the kernel.

resource starvation issues are fixed typically by setting reasonable
ulimits. The kernel can overcommit resources, but if you design a
pathalogical case to actually use everything, breakage is to be expected.



Comment 3 Raphael Clifford 2004-06-21 13:31:50 UTC
I think the problem is that I shouldn't have classified it under
"kernel". The bottom line is that any user can make the system
permanently unusable (until it is restarted) simply by accidently (or
intentionally) making an array that is too large and writing to it. 
If this is a GNOME bug then I am of course happy to have it classified
there. It does certainly seem like something that needs attention however.