From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Description of problem: C program cannot allocate large amounts of memory on the first login to Gnome, but works after a logout, login. Begin Code---------------------- #include "stdlib.h" #define ENTITY_COUNT 65530 typedef struct { double number0; double number1; double number2; double number3; int* int_array; } Memory_Block; int main( int argc, const char** argv) { double* real_array0; double* real_array1; double* real_array2; double* real_array3; double* real_array4; double* real_array5; double* real_array6; double* real_array7; Memory_Block* block_ptr; 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)); if (block_ptr) { 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); block_count++; if (block_count % 500 == 0) { printf("Count %d\n", block_count); } } else { exit(1); } } } End Code----------------------------- 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): How reproducible: Always Steps to Reproduce: 1. Reboot 2. Login to Gnome 3. Run the C program 1 or more times 4. Logout 5. Login 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 malloc fails. Expected Results: The program should always behave as it does in step 6 Additional info: Run under SMP and single processor kernels, with the latest patches from RHN. 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: https://www.redhat.com/support 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.