https://bugs.kde.org/show_bug.cgi?id=274189

--- Comment #3 from Eric Hoffman <ehoff...@videotron.ca> ---
I added a test case for this issue (see attachment).

This is NOT an undocumented feature:

       If the value of old_size is zero, and old_address refers to a
       shareable mapping (see mmap(2) MAP_SHARED), then mremap() will create
       a new mapping of the same pages.  new_size will be the size of the
       new mapping and the location of the new mapping may be specified with
       new_address; see the description of MREMAP_FIXED below.  If a new
       mapping is requested via this method, then the MREMAP_MAYMOVE flag
       must also be specified.


Run the program, you get:

Initial map virtual address: 0x7f1498f8a000
Alias map virtual address  : 0x7f1498f89000
Value at map  : 0
Value at alias: 0
Value at map  : 123
Value at alias: 123
Value at map  : 456
Value at alias: 456

Run it in memcheck, you get EINVAL at the mremap.

Regards,
Eric

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to