BIND 10 #2836: update in-memory zone loading so it can work with shmem segment
BIND 10 Development
do-not-reply at isc.org
Mon May 13 07:30:12 UTC 2013
#2836: update in-memory zone loading so it can work with shmem segment
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | vorner
Priority: medium | Status:
Component: data source | reviewing
Keywords: | Milestone:
Sensitive: 0 | Sprint-20130514
Sub-Project: DNS | Resolution:
Estimated Difficulty: 4 | CVSS Scoring:
Total Hours: 0 | Defect Severity: N/A
| Feature Depending on Ticket:
| shared memory data source
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by vorner):
Hello
Replying to [comment:15 jinmei]:
> As you mentioned a crash on the daily call, I've looked into the
> latest trac2836 branch (at 2f220f9).
>
> I'm not sure what exactly happened to you, but it caused a crash
> in my environment, too. In my case, address reallocation (mapped on a
> different address) never happened until growing the segment finally
> fails, at which point the `MemorySegmentMapped` object breaks its
> integrity (already reset the underlying boost segment). So the
> subsequent cleanup attempt triggered NULL pointer dereference.
Thank you, I'll look into this. Actually, my crash is in a code I did not
commit yet, but I'll investigate and see if it might be related. But I
think not, my crash is in this code:
{{{#!c++
// Load bunch of small zones, hoping some of the relocation will happen
// during the memory creation, not only Rdata creation.
TEST(ZoneDataLoaterTest, relocate) {
MemorySegmentMapped segment(mapped_file,
isc::util::MemorySegmentMapped::CREATE_ONLY,
4096);
const size_t zone_count = 10000;
typedef SegmentObjectHolder<ZoneData, RRClass> Holder;
typedef boost::shared_ptr<Holder> HolderPtr;
std::vector<HolderPtr> zones;
for (size_t i = 0; i < zone_count; ++i) {
// Load some zone
ZoneData* data = loadZoneData(segment, RRClass::IN(),
Name("example.org"),
TEST_DATA_DIR
"/example.org-nsec3-signed.zone");
// Store it, so it is cleaned up later
zones.push_back(HolderPtr(new Holder(segment, data,
RRClass::IN())));
}
// Deallocate all the zones now.
zones.clear();
EXPECT_TRUE(segment.allMemoryDeallocated());
EXPECT_EQ(0, unlink(mapped_file));
}
}}}
I tried to put a breakpoint onto the place that throws the SegmentGrown
exception and it actually never happened. What is even more strange, it
does not crash with the local segment. I get a segfault somewhere in the
rbtree, but my valgrind is broken and refuses to start.
--
Ticket URL: <http://bind10.isc.org/ticket/2836#comment:16>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list