When IndexModifier switches between indexReader and indexWriter being
active, the switch is currently not done atomically. So when an
exception occurs while doing so, both member variables may be
NULL. However, due to scoping rules, the destructor may be called,
resulting in IndexModifier::close being called. This method currently
assumes that exactly one of the two variables is not NULL during open
state, resulting in a segmentation fault. The attached patch makes
this closing behavior more defensive, circumventing the
problem. I'm not sure if other parts of IndexModifier would
justify to go for another, more sophisticated alternative: making the
reader/writer switchings work atomically. Ideas, anyone?
Get latest updates about Open Source Projects, Conferences and News.