All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
@ 2011-12-01 20:11 ` Natalia Portillo
  2011-12-09 18:50 ` Dr. David Alan Gilbert
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: Natalia Portillo @ 2011-12-01 20:11 UTC (permalink / raw)
  To: qemu-devel

** Also affects: qemu
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  New
Status in Linaro QEMU:
  New

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
  2011-12-01 20:11 ` [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict Natalia Portillo
@ 2011-12-09 18:50 ` Dr. David Alan Gilbert
  2011-12-15 10:21 ` Dr. David Alan Gilbert
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: Dr. David Alan Gilbert @ 2011-12-09 18:50 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu-linaro
     Assignee: (unassigned) => Dr. David Alan Gilbert (davidgil-uk)

** Changed in: qemu-linaro
       Status: New => In Progress

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  New
Status in Linaro QEMU:
  In Progress

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
  2011-12-01 20:11 ` [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict Natalia Portillo
  2011-12-09 18:50 ` Dr. David Alan Gilbert
@ 2011-12-15 10:21 ` Dr. David Alan Gilbert
  2011-12-15 22:56 ` Peter Maydell
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: Dr. David Alan Gilbert @ 2011-12-15 10:21 UTC (permalink / raw)
  To: qemu-devel

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.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  New
Status in Linaro QEMU:
  In Progress

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
                   ` (2 preceding siblings ...)
  2011-12-15 10:21 ` Dr. David Alan Gilbert
@ 2011-12-15 22:56 ` Peter Maydell
  2012-01-04 15:16 ` Peter Maydell
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2011-12-15 22:56 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  Fix Committed
Status in Linaro QEMU:
  In Progress

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
                   ` (3 preceding siblings ...)
  2011-12-15 22:56 ` Peter Maydell
@ 2012-01-04 15:16 ` Peter Maydell
  2012-01-05  0:58 ` Michael Hope
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2012-01-04 15:16 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu-linaro
       Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  Fix Committed
Status in Linaro QEMU:
  Fix Committed

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
                   ` (4 preceding siblings ...)
  2012-01-04 15:16 ` Peter Maydell
@ 2012-01-05  0:58 ` Michael Hope
  2012-01-05 16:03 ` Peter Maydell
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: Michael Hope @ 2012-01-05  0:58 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu-linaro
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  Fix Committed
Status in Linaro QEMU:
  Fix Committed

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
                   ` (5 preceding siblings ...)
  2012-01-05  0:58 ` Michael Hope
@ 2012-01-05 16:03 ` Peter Maydell
  2012-01-12 10:12 ` Peter Maydell
  2012-07-10 14:54 ` Peter Maydell
  8 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2012-01-05 16:03 UTC (permalink / raw)
  To: qemu-devel

NB: this would typically only happen when the ARM host had address space
randomization including brk randomization enabled (ie
/proc/sys/kernel/randomize_va_space is 2).

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  Fix Committed
Status in Linaro QEMU:
  Fix Committed

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
                   ` (6 preceding siblings ...)
  2012-01-05 16:03 ` Peter Maydell
@ 2012-01-12 10:12 ` Peter Maydell
  2012-07-10 14:54 ` Peter Maydell
  8 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2012-01-12 10:12 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu-linaro
       Status: Fix Committed => Triaged

** Changed in: qemu-linaro
       Status: Triaged => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  Fix Committed
Status in Linaro QEMU:
  Fix Released

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict
       [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
                   ` (7 preceding siblings ...)
  2012-01-12 10:12 ` Peter Maydell
@ 2012-07-10 14:54 ` Peter Maydell
  8 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2012-07-10 14:54 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/883133

Title:
  qemu on ARM hosts asserts due to code buffer/libc heap conflict

Status in QEMU:
  Fix Released
Status in Linaro QEMU:
  Fix Released

Bug description:
  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:
https://bugs.launchpad.net/qemu/+bug/883133/+subscriptions

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-10 15:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20111028150403.31257.25788.malonedeb@chaenomeles.canonical.com>
2011-12-01 20:11 ` [Qemu-devel] [Bug 883133] Re: qemu on ARM hosts asserts due to code buffer/libc heap conflict Natalia Portillo
2011-12-09 18:50 ` Dr. David Alan Gilbert
2011-12-15 10:21 ` Dr. David Alan Gilbert
2011-12-15 22:56 ` Peter Maydell
2012-01-04 15:16 ` Peter Maydell
2012-01-05  0:58 ` Michael Hope
2012-01-05 16:03 ` Peter Maydell
2012-01-12 10:12 ` Peter Maydell
2012-07-10 14:54 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.