Re: kernel memory issue using malloc()

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

 



On Mon, Feb 12, 2007 at 12:04:20AM +0000, Srdjan Todorovic wrote:
> On Sun, 11 Feb 2007, Mounir Bakkali wrote:
> 
> > Well the kernel manages the memory and malloc makes a kernel call
> > to give you or not the amount of memory requested... so it is a kernel
> > issue and therefore my question fits totally in here.
> 
> From what I remember, malloc() is a C library function, which calls
> brk() system call after it does some checking or internal book-keeping.

Correct, though some libc versions sometimes use mmap(/dev/zero).

> So, this could be one of 3 possibilities:
> 
>  1) Your code is wrong or you do something that you shouldn't.

Very likely.

>  2) The C library on your system might have a bug in its malloc()
>     implementation.

Very very unlikely.

>  3) There could be a bug in the kernel brk() implementation or some
>     related function or subsystem (eg. memory management) in the kernel
>     version that you use.

Very very very unlikely.

> You could try changeing each individually, and see which solves your
> problem. Try your code with a livecd distro that you know has a C
> compiler and that has a newer C library/kernel.

The bug will probably show up somewhere else in the program, which only
points to a user programming error.


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

Attachment: signature.asc
Description: Digital signature


[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