Launchpad has imported 8 comments from the remote bug at
http://sourceware.org/bugzilla/show_bug.cgi?id=5553.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2008-01-08T16:54:12+00:00 Drow-sources wrote:


Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/0

------------------------------------------------------------------------
On 2008-01-08T17:00:51+00:00 Drow-sources wrote:

Created attachment 2187
Proposed fix.

Sorry about the broken bug; I hit enter accidentally.

The failing assertion is this one:
  assert(!victim || chunk_is_mmapped(mem2chunk(victim)) ||
         ar_ptr == arena_for_chunk(mem2chunk(victim)));

GDB's bigcore.c testcase triggers this assertion on several PowerPC systems I
tested.  It starts by a malloc too large for the system to satisfy; when
_int_malloc fails, malloc creates and tries a new arena.  This arena is saved
as the default arena for the main thread so future allocations come from that
arena instead of the main one.

Later the test tries a malloc which can be met by mmap.  Eventually mmap
returns ENOMEM after a number of similar allocations:

mmap(NULL, 134221824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xa810c000
mmap(NULL, 134221824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb010d000
mmap(NULL, 134221824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
-1 ENOMEM (Cannot alloca
te memory)
mmap(NULL, 134221824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
-1 ENOMEM (Cannot alloca
te memory)
brk(0x180c1000)                         = 0x180c1000

I do not know why brk succeeded (another seven times, all 0x8000000 bytes) when
mmap failed.  But the result is a non-mmapped chunk allocated from the main
arena.  The assert checks the thread's specific arena and fails.  Updating
ar_ptr fixes the failure.

Patch attached.

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/1

------------------------------------------------------------------------
On 2008-01-09T20:35:28+00:00 Drepper-fsp wrote:

The patch is correct but incomplete.  I've checked in the complete
version.

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/2

------------------------------------------------------------------------
On 2008-01-09T20:49:06+00:00 Drow-sources wrote:

Thanks.  Is your change to memalign correct?

       ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
+      (void)mutex_unlock(&ar_ptr->mutex);
       if(ar_ptr) {
         p = _int_memalign(ar_ptr, alignment, bytes);
         (void)mutex_unlock(&ar_ptr->mutex);

if (!ar_ptr), segfault, else double unlock.

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/3

------------------------------------------------------------------------
On 2010-02-24T11:33:14+00:00 Petr Baudis wrote:

valloc() implementation has the same problem.

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/16

------------------------------------------------------------------------
On 2010-02-24T11:35:18+00:00 Petr Baudis wrote:

Created attachment 4624
proposed patch

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/17

------------------------------------------------------------------------
On 2010-02-24T23:45:22+00:00 Drepper-fsp wrote:

I've applied the patch.  But you failed to update the copyright year and
provided no ChangeLog entry.

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/18

------------------------------------------------------------------------
On 2010-02-25T10:30:04+00:00 Petr Baudis wrote:

Thanks. I have provided a changelog entry, but you are right that I forgot to
update the year.

Reply at: https://bugs.launchpad.net/deluge/+bug/490024/comments/19


** Changed in: eglibc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/490024

Title:
  assert hit in eglibc (valloc) with libtorrent v0.15

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to