[Barrelfish-users] Bug in malloc()/free() ?
Zeus Gómez Marmolejo
zeus.gomez at bsc.es
Thu Sep 22 13:23:21 CEST 2011
I'm running free() under the debugger and the x86_64 specific hack is not
firing.
It's going through lesscore() and then from a quick view it seems that is
doing it ok:
memobj_anon unfill(), calling to the x86_64 pmap unmap and then calling to
the kernel vnode_unmap(). Finally track_frame_return()...
I don't see anything wrong here, it seems it's not skipping anything... The
curious thing is that the pointer returned by malloc() is always the same.
So it "seems" that free is working correctly.
The program is always stopping after allocating about 1Gb of memory, which
is the size of the physical memory of the virtual machine....
zeus.
El 22 de septiembre de 2011 01:33, Baumann Andrew <andrewb at inf.ethz.ch>escribió:
> Hi Zeus,****
>
> ** **
>
> We’re really bad with reclaiming memory, but I didn’t know it was that bad!
> Honestly, there’s no good reason I can see for our heap being that broken.
> From the quick glance through the code (lib/c/src/malloc.c) my guess is that
> either the x86_64-specific hack to avoid freeing memory allocated on another
> core is firing incorrectly, or lesscore() is firing and doing something
> dumb. Could you check which it is?****
>
> ** **
>
> I’m CCing Simon, who should know more about the workings of lesscore().***
> *
>
> ** **
>
> Andrew****
>
> ** **
>
> *From:* Zeus Gómez Marmolejo [mailto:zeus.gomez at bsc.es]
> *Sent:* Wednesday, 21 September, 2011 6:14
> *To:* barrelfish-users at lists.inf.ethz.ch
> *Subject:* [Barrelfish-users] Bug in malloc()/free() ?****
>
> ** **
>
> Hi,****
>
> ** **
>
> Here I introduce you a pretty simple program:****
>
> ** **
>
> int main(int argc, char **argv)****
>
> {****
>
> void *p;****
>
> int i;****
>
> ****
>
> for(i=0; ;i++)****
>
> {****
>
> p = malloc(65536);****
>
> if (p==NULL)****
>
> USER_PANIC("malloc() returned NULL at %d", i);****
>
> free (p);****
>
> }****
>
> ****
>
> return 0;****
>
> }****
>
> ** **
>
> This is ALWAYS aborting as:****
>
> ** **
>
> ERROR: myapp.0 in morecore_alloc()
> ../barrelfish/lib/barrelfish/morecore.c:85****
>
> ERROR: vspace_mmu_aware_map fail****
>
> Failure: ( libbarrelfish) Out of space in vspace_mmu_aware_map() function
> [LIB_ERR_VSPACE_MMU_AWARE_NO_SPACE]****
>
> myapp.0 in main() ../barrelfish/usr/tests/myapp/myapp.c:12****
>
> malloc() returned NULL at 16382****
>
> Aborted****
>
> ** **
>
> With the latest Barrelfish tree. Are you aware of this?****
>
> ** **
>
> ** **
>
> --
> Zeus Gómez Marmolejo
> Barcelona Supercomputing Center
> PhD student
> http://www.bsc.es
>
> ****
>
--
Zeus Gómez Marmolejo
Barcelona Supercomputing Center
PhD student
http://www.bsc.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20110922/72018b2c/attachment.html
More information about the Barrelfish-users
mailing list