Re: kernel memory issue using malloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/11/07, Mounir Bakkali <mounir.bakkali@xxxxxxxxx> wrote:
Hi everything,

Here is the issue:
I am trying to allocate some memory for my data structure
and after a msecs, I get a "segmentation fault" right after
"allocating mem"....
but if I change the size of the malloc from 256 to 512, it works just fine.


My kernel version is: 2.6.19.2
CPU: Pentium M (mobile centrino).
RAM: 1GB
Compiler: gcc 4.1.2-2
And here is the peace of code:

// the following code is called about 2500 times.
printf("allocating mem\n");
my = (char*) malloc(256);
printf("GOOD!\n");
There's a nifty utility called strace,it can be of  great help for
preliminary investigation.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux