From e08b62a9dfcde27a1c32d126c6348ae0ee6e313c Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 3 Oct 2012 22:18:42 +1200 Subject: [PATCH] Bug 3661: Segmentation fault when using more than 1 worker Previous change to Ipc::Mem::PageStack making variable arrays into dynamically-allocated arrays added an allocate after use bug. --- src/ipc/mem/PageStack.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/mem/PageStack.cc b/src/ipc/mem/PageStack.cc index 93616cea94..4f3a6e18eb 100644 --- a/src/ipc/mem/PageStack.cc +++ b/src/ipc/mem/PageStack.cc @@ -17,10 +17,10 @@ Ipc::Mem::PageStack::PageStack(const uint32_t aPoolId, const unsigned int aCapac theSize(theCapacity), theLastReadable(prev(theSize)), theFirstWritable(next(theLastReadable)) { + theItems=new Item[theSize]; // initially, all pages are free for (Offset i = 0; i < theSize; ++i) theItems[i] = i + 1; // skip page number zero to keep numbers positive - theItems=new Item[theSize]; } Ipc::Mem::PageStack::~PageStack() -- 2.47.2