Red Hat Bugzilla – Bug 124547
C program using all memory kills mouse and alt-tab in X
Last modified: 2007-11-30 17:10:43 EST
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):
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.
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
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.
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.
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.