core dumped when using MatchAll in multi-threads
张少华 <[email protected]>
| Newsgroups | gmane.comp.search.xapian.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
We have a search service based on xapian, when receving a request, we create several threads to create xapian-query and search in the corresponding databases, and then merge all results together.
In some case, we use Xapian::Query::MatchAll to create the query, but it always has Segmentation fault (core dumped). It looks like some pointers are double freed.
This is the function that we use to create xapian-query.
std::shared_ptr<Xapian::Query> constructQuery() {
Xapian::Query black_list("BLt1");
return std::make_shared<Xapian::Query>(Xapian::Query::OP_AND_NOT, Xapian::Query::MatchAll, black_list);
}
I have wrote a demo to reproduce our problems, you can click this link for the detail. https://github.com/xiangqianzsh/xapian_leaning/tree/master/matchall_coredump
How we solve this problems?