You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Michael McCandless <lu...@mikemccandless.com> on 2008/03/19 18:18:44 UTC

Re: CorruptIndexException with some versions of java

Hi Ian,

Can you try this patch?  Grasping at straws at this point, trying to  
isolate where the JVM fails us...

I'm CC'ing java-dev. To sum up: sometimes when we merge fields, the  
fdx file ends up exactly one document too short.  In adding numerous  
asserts around this code in SegmentMerger.java, insanely, somehow the  
call to indexStream.writeLong fails to actually "happen" when we call  
FieldsWriter.addDocument, even though from looking at the code I see  
no way to explain that.  As hard as it is to believe, it really is  
looking like a strange JVM bug at this point...

Has anyone else seen any odd behavior on update 4 or 5 of JDK 1.6?   
The issue does not happen on previous updates of JDK 1.6.

Mike


Re: CorruptIndexException with some versions of java

Posted by Michael McCandless <lu...@mikemccandless.com>.
Spookily, I believe this is in fact some sort of JVM hotspot compiler  
bug.  Adding -Xbatch (forces up-front compilation) prevents (works  
around) the problem.

I added a counter, to IndexOutput, of total bytes written, and then  
in SegmentMerger.mergeFields, I added an assert that the #docs  
written through FieldsWriter matched the number of bytes written to  
the fdx file.  Insanely, that assert would fail when the issue was  
hit, which is just not possible from the code.  It's as if when the  
BG compilation finished and the native method got swapped into the  
JVM, it somehow "missed" a call to IndexOutput.writeLong.

I committed some of these asserts into SegmentMerger on both 2.3 &  
trunk.

I'll respond on the java-user thread to bring closure here.

Mike

Yonik Seeley wrote:
> On Wed, Mar 19, 2008 at 1:18 PM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
>>  I'm CC'ing java-dev. To sum up: sometimes when we merge fields, the
>>  fdx file ends up exactly one document too short.  In adding numerous
>>  asserts around this code in SegmentMerger.java, insanely, somehow  
>> the
>>  call to indexStream.writeLong fails to actually "happen" when we  
>> call
>>  FieldsWriter.addDocument, even though from looking at the code I see
>>  no way to explain that.  As hard as it is to believe, it really is
>>  looking like a strange JVM bug at this point...
>
> JDK 1.6_04 was a major upgrade of hotspot.
> Is there a way to dump the compiled machine code that hotspot
> eventually generates for that method?
>
> -Yonik
>
>
>>  Has anyone else seen any odd behavior on update 4 or 5 of JDK 1.6?
>>  The issue does not happen on previous updates of JDK 1.6.
>>
>>  Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: CorruptIndexException with some versions of java

Posted by Yonik Seeley <yo...@apache.org>.
On Wed, Mar 19, 2008 at 1:18 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
>  I'm CC'ing java-dev. To sum up: sometimes when we merge fields, the
>  fdx file ends up exactly one document too short.  In adding numerous
>  asserts around this code in SegmentMerger.java, insanely, somehow the
>  call to indexStream.writeLong fails to actually "happen" when we call
>  FieldsWriter.addDocument, even though from looking at the code I see
>  no way to explain that.  As hard as it is to believe, it really is
>  looking like a strange JVM bug at this point...

JDK 1.6_04 was a major upgrade of hotspot.
Is there a way to dump the compiled machine code that hotspot
eventually generates for that method?

-Yonik


>  Has anyone else seen any odd behavior on update 4 or 5 of JDK 1.6?
>  The issue does not happen on previous updates of JDK 1.6.
>
>  Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org