Bug 541758 - [newindex] Deadlock
Summary: [newindex] Deadlock
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.10   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 541771 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-30 11:49 EST by Carsten Reckord CLA
Modified: 2023-03-13 09:41 EDT (History)
5 users (show)

See Also:


Attachments
Quick Type Hierarchy Stacktrace (54.88 KB, text/plain)
2018-11-30 11:49 EST, Carsten Reckord CLA
no flags Details
Show Type Hierarchy Stacktrace (31.35 KB, text/plain)
2018-11-30 11:50 EST, Carsten Reckord CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Reckord CLA 2018-11-30 11:49:43 EST
Created attachment 276782 [details]
Quick Type Hierarchy Stacktrace

I recently set up a new workspace and decided to give the new index a try. 

It works mostly great, but I consistently and reproducibly run into a deadlock when trying to show a type hierarchy, both through "Quick Type Hierarchy" and through "Open Type Hierarchy".

I can recover by cancelling the action in the UI, through the progress view (for "Open Type Hierarchy") or through the progress indicator in the status area (for "Quick Type Hierarchy") - although that indicator vanishes after a bit, and then I'm stuck with an unrecoverable busy cursor.

The stack traces in both cases look similar, see attachments. In both cases, a CreateTypeHierarchyOperation is performed, which ultimately hangs in Indexer.waitForIndex. I can't see any suspicious activity on other threads, or anything else holding a lock though.

The same scenario works fine with the old index.
Comment 1 Carsten Reckord CLA 2018-11-30 11:50:33 EST
Created attachment 276783 [details]
Show Type Hierarchy Stacktrace
Comment 2 Carsten Reckord CLA 2018-11-30 11:59:25 EST
Hm, I just tried connecting with a debugger to see who might be holding the log, and now I consistently get the following upon workbench start:

java.lang.IllegalStateException: Generic signature starts with unknown character: ( ^ *)Lorg/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper;
	at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.countMethodArguments(ClassFileToIndexConverter.java:650)

Not sure if that might leave the index in a deadlockable state. But I've had that deadlock for some time now, and prior to today, the workspace would start up without showing any index errors.
Comment 3 Stephan Herrmann CLA 2018-11-30 12:56:25 EST
(In reply to Carsten Reckord from comment #2)
> java.lang.IllegalStateException: Generic signature starts with unknown
> character: ( ^ *)Lorg/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper;
> 	at
> org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.
> countMethodArguments(ClassFileToIndexConverter.java:650)

How was that classfile created, ecj (version?) or javac?

If ecj, please file a separate bug for this issue. TIA.

(does the signature in the message really contain spaces, or is this an artifact of copy-paste to bz?)
Comment 4 Stephan Herrmann CLA 2018-11-30 13:07:22 EST
The deadlock remotely reminds me of bug 513872.

When you saw the IllegalStateException, was the indexer visible somewhere in that call stack?
Comment 5 Carsten Reckord CLA 2018-11-30 14:42:09 EST
(In reply to Stephan Herrmann from comment #3)
> How was that classfile created, ecj (version?) or javac?

It's a class from my target platform, so I would assume ecj. It's from the 
 org.eclipse.fx.osgi_3.5.0.201811300600.jar bundle coming from http://download.eclipse.org/efxclipse/runtime-nightly/site.

Looking at the bundle qualifier, that could also explain why I didn't see the IllegalStateException before today...

> (does the signature in the message really contain spaces, or is this an
> artifact of copy-paste to bz?)

It really contains spaces.

> When you saw the IllegalStateException, was the indexer visible somewhere in
> that call stack?

Yes, it's coming from the indexer. The full error log entry was:

!ENTRY org.eclipse.core.jobs 4 0 2018-11-30 17:13:36.875
!MESSAGE Updating Java index
!SUBENTRY 1 org.eclipse.core.jobs 4 2 2018-11-30 17:13:36.875
!MESSAGE An internal error occurred during: "Updating Java index".
!STACK 0
java.lang.IllegalStateException: Generic signature starts with unknown character: ( ^ *)Lorg/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper;
	at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.countMethodArguments(ClassFileToIndexConverter.java:650)
	at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.addMethod(ClassFileToIndexConverter.java:350)
	at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.addType(ClassFileToIndexConverter.java:219)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.addClassToIndex(Indexer.java:853)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.addElement(Indexer.java:784)
	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)
Comment 6 Stephan Herrmann CLA 2018-11-30 15:08:40 EST
Thanks, I secured the class files, the closest I could come to the above is 
ModuleLayerWrapper.class, which contains:

  private static org.eclipse.fx.osgi.fxloader.jpms.ModuleWrapper lambda$1(?);
    descriptor: (Ljava/lang/Object;)Lorg/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper;
    flags: ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
    Code:
      stack=3, locals=1, args_size=1
         0: new           #90                 // class org/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper
         3: dup
         4: aload_0
         5: invokespecial #185                // Method org/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper."<init>":(Ljava/lang/Object;)V
         8: areturn
      LineNumberTable:
        line 111: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0       9     0     o   Ljava/lang/Object;
    Signature: #117                         // (*)Lorg/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper;

Clearly the signature does not contain the "( ^ *)" garbage.

Next, I checked where the signature comes from, which is: org.eclipse.jdt.internal.core.nd.indexer.GenericSignatures.getGenericSignature(IBinaryMethod), which suggests that the bogus signature may be an artifact of the new index itself.


I'm stopping my investigation at this point.

To get you going again I suggest you try to re-build the index.
Comment 7 Stephan Herrmann CLA 2018-11-30 17:40:07 EST
*** Bug 541771 has been marked as a duplicate of this bug. ***
Comment 8 Sous Lesequels CLA 2019-04-12 13:29:28 EDT
FWIW I am getting this after eclipse -clean -refresh

!ENTRY org.eclipse.core.jobs 4 0 2019-04-12 13:26:28.936
!MESSAGE Updating Java index
!SUBENTRY 1 org.eclipse.core.jobs 4 2 2019-04-12 13:26:28.936
!MESSAGE An internal error occurred during: "Updating Java index".
!STACK 0
java.lang.IllegalStateException: Generic signature starts with unknown character: ( ^ *)Lorg/eclipse/fx/osgi/fxloader/jpms/ModuleWrapper;
        at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.countMethodArguments(ClassFileToIndexConverter.java:650)
        at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.addMethod(ClassFileToIndexConverter.java:350)
        at org.eclipse.jdt.internal.core.nd.indexer.ClassFileToIndexConverter.addType(ClassFileToIndexConverter.java:219)
        at org.eclipse.jdt.internal.core.nd.indexer.Indexer.addClassToIndex(Indexer.java:853)
        at org.eclipse.jdt.internal.core.nd.indexer.Indexer.addElement(Indexer.java:784)
        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)

This is with 2019-03. Since it looks like it's the same class that the OP had, perhaps it's something related to efxclipse extension itself?
Comment 9 Stephan Herrmann CLA 2019-04-12 15:45:08 EDT
People observing this problem should be interested in bug 544898 (after which this current bug most likely will go the way of WONTFIX).
Comment 10 Eclipse Genie CLA 2021-04-02 15:39:25 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.
Comment 11 Simeon Andreev CLA 2023-03-13 09:41:29 EDT
See bug 515496 and bug 572978, the new index was removed.