[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 09/11] dump: Add API to write dump pages
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 09/11] dump: Add API to write dump pages |
Date: |
Tue, 07 Jan 2014 16:12:56 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 01/07/2014 03:37 PM, Laszlo Ersek wrote:
> comments below
>
> On 01/05/14 08:27, Qiao Nuohan wrote:
>> functions are used to write page to vmcore. vmcore is written page by page.
>> page desc is used to store the information of a page, including a page's
>> size,
>> offset, compression format, etc.
>>
>> + uint64_t pfn_start, pfn_end, pfn;
>> + unsigned char buf[s->page_size];
>
> Whoa, a VLA! :) I believe it's *very* non-idiomatic in the qemu source.
> Please consider allocating it dynamically. (Of course others might point
> out that I'm wrong.)
Worse, a stack allocation greater than the size of a stack frame. Any
time you have a function taking more than a page size of local storage,
you risk nasty behavior on some platforms (Windows in particular is
notorious for giving you only a single guard page, and if you overflow
the stack by more than the guard page, your program is unceremoniously
terminated with no message, compared to the usual desirable behavior of
getting a SIGSEGV that your program can at least react to in order to
diagnose that you had a stack overflow).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v6 02/11] dump: Add API to write header of flatten format, (continued)
- [Qemu-devel] [PATCH v6 04/11] dump: Add API to write elf notes to buffer, Qiao Nuohan, 2014/01/05
- [Qemu-devel] [PATCH v6 10/11] dump: Make kdump-compressed format available for 'dump-guest-memory', Qiao Nuohan, 2014/01/05
- [Qemu-devel] [PATCH v6 08/11] dump: Add APIs to operate DataCache, Qiao Nuohan, 2014/01/05
- [Qemu-devel] [PATCH v6 09/11] dump: Add API to write dump pages, Qiao Nuohan, 2014/01/05
- [Qemu-devel] [PATCH v6 07/11] dump: Add API to write dump_bitmap, Qiao Nuohan, 2014/01/05
- [Qemu-devel] [PATCH v6 01/11] dump: Add argument to write_elfxx_notes, Qiao Nuohan, 2014/01/05
- Re: [Qemu-devel] [PATCH v6 00/11] Make 'dump-guest-memory' dump in kdump-compressed format, Qiao Nuohan, 2014/01/07