From: Avi Kivity <avi@redhat.com>
To: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Cc: aliguori@us.ibm.com, mtosatti@redhat.com, qemu-devel@nongnu.org,
ohmura.kei@lab.ntt.co.jp
Subject: Re: [Qemu-devel] Re: [PATCH v3 2/6] Introduce bit-based phys_ram_dirty for VGA, CODE, MIGRATION and MASTER.
Date: Mon, 19 Apr 2010 14:38:46 +0300 [thread overview]
Message-ID: <4BCC40C6.1040203@redhat.com> (raw)
In-Reply-To: <g2j87e9effc1004190431gda3d837cp1a1a6b589f7fedd9@mail.gmail.com>
On 04/19/2010 02:31 PM, Yoshiaki Tamura wrote:
>
>>>> typedef struct RAMBlock {
>>>> @@ -2825,10 +2825,16 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size)
>>>> new_block->next = ram_blocks;
>>>> ram_blocks = new_block;
>>>>
>>>> - phys_ram_dirty = qemu_realloc(phys_ram_dirty,
>>>> - (last_ram_offset + size)>> TARGET_PAGE_BITS);
>>>> - memset(phys_ram_dirty + (last_ram_offset>> TARGET_PAGE_BITS),
>>>> - 0xff, size>> TARGET_PAGE_BITS);
>>>> + if (BITMAP_SIZE(last_ram_offset + size) !=
>>>> BITMAP_SIZE(last_ram_offset)) {
>>>>
>>> This check is unneeded - the code will work fine even if the bitmap size
>>> doesn't change.
>>>
>> OK. I'll remove it.
>>
> I have a problem here.
> If I remove this check, glibc reports an error as below.
>
> *** glibc detected *** /usr/local/qemu/bin/qemu-system-x86_64:
> realloc(): invalid pointer: 0x0000000001f0e450 ***
> ======= Backtrace: =========
> /lib64/libc.so.6[0x369fa75a96]
> /lib64/libc.so.6(realloc+0x2a1)[0x369fa7b881]
> /usr/local/qemu/bin/qemu-system-x86_64[0x437d93]
> /usr/local/qemu/bin/qemu-system-x86_64[0x4f03f6]
> /usr/local/qemu/bin/qemu-system-x86_64[0x5b052c]
> /usr/local/qemu/bin/qemu-system-x86_64[0x5b0d8b]
> /usr/local/qemu/bin/qemu-system-x86_64[0x41ec2b]
> /lib64/libc.so.6(__libc_start_main+0xfd)[0x369fa1ea2d]
> /usr/local/qemu/bin/qemu-system-x86_64[0x406479]
> ======= Memory map: ========
>
> I reminded that I put this check to avoid reallocating same size to the bitmap.
> qemu goes this routine at start up, and extends last_ram_offset at
> small numbers.
> The error above is reported at the extension phase.
>
>
This probably means that an old bitmap pointer leaked somewhere, and we
realloc() it after free? Or perhaps a glibc bug.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-04-19 11:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-19 9:43 [Qemu-devel] [PATCH v3 0/6] Introduce bit-based phys_ram_dirty, and bit-based dirty page checker Yoshiaki Tamura
2010-04-19 9:43 ` [Qemu-devel] [PATCH v3 1/6] Modify DIRTY_FLAG value and DIRTY_IDX introduce to use as indexes of bit-based phys_ram_dirty Yoshiaki Tamura
2010-04-19 10:15 ` [Qemu-devel] " Avi Kivity
2010-04-19 10:30 ` Yoshiaki Tamura
2010-04-19 9:43 ` [Qemu-devel] [PATCH v3 2/6] Introduce bit-based phys_ram_dirty for VGA, CODE, MIGRATION and MASTER Yoshiaki Tamura
2010-04-19 10:17 ` [Qemu-devel] " Avi Kivity
2010-04-19 10:36 ` Yoshiaki Tamura
2010-04-19 11:31 ` Yoshiaki Tamura
2010-04-19 11:38 ` Avi Kivity [this message]
2010-04-19 11:52 ` Yoshiaki Tamura
2010-04-19 11:56 ` Avi Kivity
2010-04-19 14:51 ` Yoshiaki Tamura
2010-04-19 9:43 ` [Qemu-devel] [PATCH v3 3/6] Modifies wrapper functions for byte-based phys_ram_dirty bitmap to bit-based phys_ram_dirty bitmap Yoshiaki Tamura
2010-04-19 9:43 ` [Qemu-devel] [PATCH v3 4/6] Introduce cpu_physical_memory_get_dirty_range() Yoshiaki Tamura
2010-04-19 9:43 ` [Qemu-devel] [PATCH v3 5/6] Use cpu_physical_memory_set_dirty_range() to update phys_ram_dirty Yoshiaki Tamura
2010-04-19 9:43 ` [Qemu-devel] [PATCH v3 6/6] Use cpu_physical_memory_get_dirty_range() to check multiple dirty pages Yoshiaki Tamura
2010-04-19 10:24 ` [Qemu-devel] Re: [PATCH v3 0/6] Introduce bit-based phys_ram_dirty, and bit-based dirty page checker Avi Kivity
2010-04-19 10:37 ` Yoshiaki Tamura
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BCC40C6.1040203@redhat.com \
--to=avi@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=mtosatti@redhat.com \
--cc=ohmura.kei@lab.ntt.co.jp \
--cc=qemu-devel@nongnu.org \
--cc=tamura.yoshiaki@lab.ntt.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.