[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buff
Dr. David Alan Gilbert
[Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
Thu, 15 Dec 2011 10:21:24 -0000
Fix pushed into QEMU upstream today.
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
qemu on ARM hosts asserts due to code buffer/libc heap conflict
Status in QEMU:
Status in Linaro QEMU:
On ARM hosts qemu (about half the time) asserts on startup:
qemu-system-i386: malloc.c:3096: 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.
This turns out to be because code_gen_alloc() is using mmap(MAP_FIXED)
to map the code buffer at address 0x01000000UL, which is in the area
glibc happens to be using for its heap. This tends to make the next
malloc() abort, although occasionally the stars align and we pass that
and fail weirdly later on.
I suspect we need to drop the MAP_FIXED requirement and fix the TCG code to
cope with emitting code for longer-range
branches for calls to host fns etc (calls/branches within the generated code
should be ok to keep using the short-range
branch insn I think). There is already no guarantee that the generated code
and the host C code are within short
branch range of each other...
To manage notifications about this bug go to: