First Last Prev Next    No search results available
Details
: Based pointer repository not updated when using persisten...
Bug#: 2216
: ACE
: ACE Core
Status: RESOLVED
Resolution: FIXED
: x86
: Windows XP
: 5.4.7
: P3
: normal
: ---

:
:
: 1991
:
  Show dependency tree - Show dependency graph
People
Reporter: Steve Williams <steve.williams@telxio.com>
Assigned To: DOC Center Support List (internal) <tao-support@dre.vanderbilt.edu>

Attachments
Patch for proposed fix (628 bytes, patch)
2005-08-26 19:02, Steve Williams
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2005-08-22 17:19
When an ACE_MMAP_Memory_Pool is created using an existing backing store. The
ACE_Based_Pointer_repository is not updated with the mapped segment information.

The following code demonstrates the issue:

int
mmap_remap_test(void)
{
    MMAP_Allocator* alloc;

    ACE_OS::unlink("foo");
    {
        ACE_NEW_RETURN (alloc, MMAP_Allocator ("foo", "foo"), -1);
	alloc->sync();

	// Delete Malloc and the memory pool, but do not remove
	// the backing store
	alloc->memory_pool().release(0);
	delete alloc;
    }
    //
    // Recreate segment with existing backing store
    //
    ACE_NEW_RETURN (alloc, MMAP_Allocator ("foo", "foo"), -1);

    void* addr = alloc->base_addr();
    if(addr == 0)
    {
	ACE_ERROR_RETURN ((LM_ERROR,
	    ACE_TEXT ("Unable to get base to remapped MMAP Memory Pool\n")),
            -1);
    }
    void* ba;
    if(ACE_BASED_POINTER_REPOSITORY::instance()->find(addr, ba) == -1)
    {
	ACE_ERROR_RETURN ((LM_ERROR,
            ACE_TEXT ("Unable to find base address after remap of segment\n")),
            -1);
    }

    if(!ba)      \\ <--***   fails here, ba is zero  ***
    {
	ACE_ERROR_RETURN ((LM_ERROR,
            ACE_TEXT ("No base address mapping after remap\n")),
            -1);
    }
    delete alloc;

    return 0;
}
------- Comment #1 From Steve Williams 2005-08-22 21:18:57 -------
I have added this test to the test program I wrote for:

http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1991
------- Comment #2 From Steve Williams 2005-08-26 19:01:24 -------
I have a patch file that corrects this issue by binding the segment to the 
Based_Pointer_Repository in the case that the backing file already exists.
------- Comment #3 From Steve Williams 2005-08-26 19:02:12 -------
Created an attachment (id=370) [details]
Patch for proposed fix
------- Comment #4 From Johnny Willemsen 2005-08-29 04:20:48 -------
Mon Aug 29 09:20:12 UTC 2005  Johnny Willemsen  <jwillemsen@remedy.nl>

        * ace/MMAP_Memory_Pool.cpp:
          Fixed bugzilla bug 2216, when an ACE_MMAP_Memory_Pool is created
          using an existing backing store, the ACE_Based_Pointer_repository
          was not updated with the mapped segment information.

          Thanks to Steve Williams <steve at telxio dot com> for reporting
          this and supplying the fix and regression test below.

First Last Prev Next    No search results available