When try to run my program with up to 1 thread, it works fine for a while (some seconds or minutes) but finally get segmentation fault(core dumped) or double free(faststop ) error. 

Here are the function which the threads run.

```
        //used in the Function
[Added]   typedef folly::ProducerConsumerQueue<std::string*> PcapTask;
        struct s_EntryItem {
        Columns* p_packet; //has some arbitrary method and variables
        boost::mutex _mtx;
        };
        //_buffersConnection.wait_and_pop()
        Data wait_and_pop() {
            boost::mutex::scoped_lock lock(the_mutex);
            while (the_queue.empty()) {
                the_condition_variable.wait(lock);
            }
            Data popped_value = the_queue.front();
            the_queue.pop();
            return popped_value;
        }
        struct HandlerTask {
            std::string year;
            folly::ProducerConsumerQueue<std::string*> queue = NULL;
        };
        -----------------------------------------
        //The function which threads run
           void Connection() {
                std::string datetime, year;
                uint32_t srcIPNAT_num, srcIP_num;
                std::string srcIP_str, srcIPNAT_str, srcIPNAT_str_hex;
                int counter = 0;
                while (true) {
                    //get new task
                    HandlerTask* handlerTask = _buffersConnection.wait_and_pop();
                    PcapTask* pcapTask = handlerTask->queue;
                    year = handlerTask->year;                         
                    counter = 0;
                    do {
                        pcapTask->popFront();
                        s_EntryItem* entryItem = searchIPTable(srcIP_num);

                        entryItem->_mtx.lock();
                        if (entryItem->p_packet == NULL) {
                            Columns* newColumn = new Columns();
                            newColumn->initConnection(srcIPNAT_str, srcIP_str, datetime, srcIP_num);
                            entryItem->p_packet = newColumn;
                            addToSequanceList(newColumn);

                        } else {
                            bool added = entryItem->p_packet->addPublicAddress(srcIPNAT_str_hex, datetime);
                            if (added == false) {
                                removeFromSequanceList(entryItem->p_packet);
                                _bufferManager->addTask(entryItem->p_packet);

                                Columns* newColumn = new Columns();
                                newColumn->initConnection(srcIPNAT_str, srcIP_str, datetime, srcIP_num);
                                //add to ip table
                                entryItem->p_packet = newColumn;
                                addToSequanceList(newColumn);
                            }   
                        }
                        entryItem->_mtx.unlock();
                        ++_totalConnectionReceived;
                    } while (true);                        
                    delete pcapTask;
                    delete handlerTask;
                }
            }

```