[Barrelfish-users] Bug in malloc()/free() ?

Baumann Andrew andrewb at inf.ethz.ch
Thu Sep 22 01:33:37 CEST 2011


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20110921/2d5f96c9/attachment.html 


More information about the Barrelfish-users mailing list