From: Kostka B. <ko...@to...> - 2010-06-28 19:48:27
|
I did some tests with cl_demo and found following: In DocumentsWriter destructor postingsFreeCountDW is 5888 and the length of postingsFreeListDW.values is 7424. Maybe I'm wrong but if I understand the logic implemented in getPostings and recyclePostings well, the postingsFreeListDW.values above postingsFreeCountDW shouldn't be considered a valid pointers But they are by ArrayBase destructor, and delete attempt can (and will) cause crash. To test this, I simply added (yes it might be done more efficient way using memset) for ( size_t i = this->postingsFreeCountDW; i< this->postingsFreeListDW.length; i++ ){ this->postingsFreeListDW.values[i] = NULL; } and cl_demo runs correctly. Of course I could miss something important in code and produce memory leaks instead of fixing bug.... Borek > -----Original Message----- > From: Itamar Syn-Hershko [mailto:it...@co...] > Sent: Sunday, June 27, 2010 11:50 PM > To: clu...@li... > Cc: fr...@gm...; Kostka Bořivoj; jus...@gm... > Subject: Re: [CLucene-dev] vector subscript outofrangeexceptionduringindexing > > Hi all, > > Just to let you know Borek was right. The error you all hit was related > to a typo (or rather, an incorrect port of code). I committed a fix to > master [1]. > > However, this introduced a new issue with double deletion of the > postings array (DocumentsWriter::postingsFreeListDW). Some code tracking > needs to be done here to decide on the best action. I'm done for today > and I'm not sure when I'll be back on it again, so if you guys can have > a look and see if you can come up with something, that'd be ideal. > > Itamar. > > [1] > http://clucene.git.sourceforge.net/git/gitweb.cgi?p=clucene/clucene;a=commitdiff;h=6e > a11164d92569a742ce01588e821a82fcff9f48 > > On 25/6/2010 2:43 PM, Kostka Bořivoj wrote: > > Thanks for the patch. Ufortunatelly the original problem is probably not related to > JIRA 1072 issue. > > Any idea how to continue to tracing this? I'm ready to help but as my knowledge of > CLucene core > > is limited I can't figure out what to trace. > > > > Borek |