Bug 541471 - [newindex] IllegalStateException in Indexer
Summary: [newindex] IllegalStateException in Indexer
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.9   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-22 13:43 EST by Patrick Tasse CLA
Modified: 2023-04-21 19:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Tasse CLA 2018-11-22 13:43:01 EST
It seems I had a corrupted index. When launching Eclipse I would get in the Error Log:

Database corruption detected during indexing. Deleting and rebuilding the index.

org.eclipse.jdt.internal.core.nd.db.IndexException: All child pointers should be null for a free chunk that is in the sibling list but not part of the trie. Problematic chunk number: 49941
Related addresses:
non-null child pointer [address 204558344, size 4]: No modification report
	at org.eclipse.jdt.internal.core.nd.IndexExceptionBuilder.build(IndexExceptionBuilder.java:77)
	at org.eclipse.jdt.internal.core.nd.db.Database.unlinkFreeBlock(Database.java:796)
	at org.eclipse.jdt.internal.core.nd.db.Database.createLargeBlock(Database.java:698)
	at org.eclipse.jdt.internal.core.nd.db.Database.malloc(Database.java:540)
	at org.eclipse.jdt.internal.core.nd.db.LongString.<init>(LongString.java:70)
	at org.eclipse.jdt.internal.core.nd.db.Database.newString(Database.java:1496)
	at org.eclipse.jdt.internal.core.nd.field.FieldString.put(FieldString.java:62)
	at org.eclipse.jdt.internal.core.nd.java.NdResourceFile.setManifestContent(NdResourceFile.java:132)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.addElement(Indexer.java:757)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.rescanArchive(Indexer.java:640)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.rescan(Indexer.java:287)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.lambda$0(Indexer.java:149)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:185)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

But while rebuilding the index I would always get this in the Error Log:

An internal error occurred during: "Updating Java index".

java.lang.IllegalStateException: Joining on a job belonging to the same group is not allowed
	at org.eclipse.core.internal.jobs.JobManager.join(JobManager.java:866)
	at org.eclipse.core.internal.jobs.InternalJob.join(InternalJob.java:348)
	at org.eclipse.core.runtime.jobs.Job.join(Job.java:608)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.rebuildIndex(Indexer.java:1057)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.lambda$0(Indexer.java:153)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:185)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

So the index was never rebuilt correctly, and these errors repeated every time I restarted Eclipse.

By the way, I fixed the corruption by deleting <workspace>/.metadata/.plugins/org.eclipse.jdt.core.

eclipse.buildId=4.9.0.I20180906-0745
java.version=1.8.0_162
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.committers.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.committers.product
Comment 1 Patrick Tasse CLA 2019-02-21 09:39:03 EST
Same thing happened again:

Database corruption detected during indexing. Deleting and rebuilding the index.

followed by:

java.lang.IllegalStateException: Joining on a job belonging to the same group is not allowed
	at org.eclipse.core.internal.jobs.JobManager.join(JobManager.java:852)
	at org.eclipse.core.internal.jobs.InternalJob.join(InternalJob.java:348)
	at org.eclipse.core.runtime.jobs.Job.join(Job.java:608)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.rebuildIndex(Indexer.java:1057)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.lambda$0(Indexer.java:153)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:185)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Some additional info, I don't know if this is a cause or a symptom of the corruption, but around the same time this started happening, I did Ctrl+T (Quick Type Hierarchy) and it got in some kind of deadlock with a ModalContext thread never finishing and wait cursor in Eclipse. The first time I killed Eclipse, but the subsequent times I realized that there was a progress bar in the status bar with a stop button that I could use to stop the job.

eclipse.buildId=4.10.0.I20181206-0815
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.committers.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.committers.product
Comment 2 Stephan Herrmann CLA 2019-02-21 09:59:32 EST
Are you aware that you are using the experimental new indexer?

See preferences > Java > Search > "Enable new Java index"
Comment 3 Patrick Tasse CLA 2019-02-21 10:42:37 EST
Yes, I am aware, but is that a bad thing?

Should I specifically opt-out of the new Java index? I don't remember opting-in. Is the experimental index the default setting?

So is there a bug in Indexer.rebuildIndex() joining the job?
Comment 4 Stephan Herrmann CLA 2019-02-21 14:16:10 EST
(In reply to Patrick Tasse from comment #3)
> Yes, I am aware, but is that a bad thing?

I can't judge good or bad for you :)
 
> Should I specifically opt-out of the new Java index? I don't remember
> opting-in. Is the experimental index the default setting?

It shouldn't be the default, because it is not sufficiently stable for general use in production.
 
> So is there a bug in Indexer.rebuildIndex() joining the job?

I don't know exactly where the bug is, but we'd have to wait until someone picks up the (currently suspended) work on [newindex] bugs.
Comment 5 Eclipse Genie CLA 2021-02-17 14:19:05 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Eclipse Genie CLA 2023-04-21 19:55:06 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.