#186 1.0rc3 malloc problem w/glibc-2.10 on x86_64 (with fix)

closed-fixed
nobody
None
5
2009-08-12
2009-07-09
No

Running muse 0.9 or 1.0rc3 on x86_64 with glibc 2.10.1 triggers this memory allocation error:

$ muse
muse: malloc.c:3074: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted

Running with MALLOC_CHECK_=1 solves the problem showing errors about free().

I compiled with debug symbols and running under gdb to locate the error. I created a simple patch, that solves the problem, but maybe can be wrong (please check it), just add +2 bytes in 'esize' Pool::grow @ memory.cpp

Take care.

Discussion

  • Orcan Ogetbil

    Orcan Ogetbil - 2009-07-14

    I confirm the error. This stops muse staritng with glibc-2.10 on x86_64. glibc-2.9, on the other hand, doesn't have this problem.

    With the attached patch, muse starts with glibc-2.10 on x86_64. But I am not sure either if it is a correct fix.

     
  • Robert Jonsson

    Robert Jonsson - 2009-07-15

    Right, the fix is probably not optimal. I'm going to add it with clear comments as to it's origins.

     
  • Robert Jonsson

    Robert Jonsson - 2009-08-12
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks