Red Hat Bugzilla – Bug 146527
C program cannot allocate enough on first Gnome login
Last modified: 2015-01-07 19:09:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Description of problem:
C program cannot allocate large amounts of memory on the first login
to Gnome, but works after a logout, login.
#define ENTITY_COUNT 65530
const char** argv)
int block_count = 0;
/* Allocate 8 arrays to simulate permanent entities. */
real_array0 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array1 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array2 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array3 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array4 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array5 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array6 = (double*)calloc(sizeof(double), ENTITY_COUNT);
real_array7 = (double*)calloc(sizeof(double), ENTITY_COUNT);
while (block_count < 100000000)
block_ptr = malloc(sizeof(Memory_Block));
block_ptr->number0 = block_count;
block_ptr->number1 = block_count;
block_ptr->number2 = block_count;
block_ptr->number3 = block_count;
block_ptr->int_array = (int*)calloc(sizeof(int), 30000);
if (block_count % 500 == 0)
printf("Count %d\n", block_count);
A similar bug has been sent to caci.com where the program compiled
with thier library has problems allocating _after_ the first logout.
This does not occur when the program is run from a text console, only
when run under X. This is worse, but I was not able to create a simple
C program where this occurs.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
2. Login to Gnome
3. Run the C program 1 or more times
6. Run the C program
Actual Results: On step 3, the program failed to malloc after
allocating a small amount of system memory.
On step 6, the program allocates alll available memory before the
Expected Results: The program should always behave as it does in step 6
Run under SMP and single processor kernels, with the latest patches
The machine is a dual processor AMD Athlon MP.
What does 'ulimit -a' say in the first and in the second case?
Since there are insufficient details provided in this report for us to
investigate the issue further, and we have not received the feedback we
requested, we will assume the problem was not reproduceable or has been fixed in
a later update for this product.
Users who have experienced this problem are encouraged to upgrade to the latest
update release, and if this issue is still reproduceable, please contact the Red
Hat Global Support Services page on our website for technical support options:
If you have a telephone based support contract, you may contact Red Hat at
1-888-GO-REDHAT for technical support for the problem you are experiencing.