Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server goes into an infinite loop when typing < in an empty dtd file #266

Closed
fbricon opened this issue Dec 18, 2018 · 2 comments
Closed
Labels
bug Something isn't working completion This issue or enhancement is related to completion support regression
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Dec 18, 2018

Server goes into an infinite loop when typing < in an empty dtd file. jstack shows:

2018-12-18 01:01:28
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.141-b15 mixed mode):

"ForkJoinPool.commonPool-worker-0" #29 daemon prio=5 os_prio=31 tid=0x00007fc67d2e9800 nid=0x100f waiting on condition [0x0000700005a87000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007bc541ab8> (a java.util.concurrent.ForkJoinPool)
	at java.util.concurrent.ForkJoinPool.awaitWork(ForkJoinPool.java:1824)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1693)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

"ForkJoinPool.commonPool-worker-3" #28 daemon prio=5 os_prio=31 tid=0x00007fc67d0f0800 nid=0x5b0f runnable [0x0000700005983000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.lsp4xml.dom.DOMNode.getParentElement(DOMNode.java:389)
	at org.eclipse.lsp4xml.services.AbstractPositionRequest.getParentElement(AbstractPositionRequest.java:57)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.ContentModelCompletionParticipant.onTagOpen(ContentModelCompletionParticipant.java:46)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectOpenTagSuggestions(XMLCompletions.java:375)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectInsideContent(XMLCompletions.java:542)
	at org.eclipse.lsp4xml.services.XMLCompletions.doComplete(XMLCompletions.java:205)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doComplete(XMLLanguageService.java:103)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$completion$1(XMLTextDocumentService.java:192)
	at org.eclipse.lsp4xml.XMLTextDocumentService$$Lambda$46/2027672026.apply(Unknown Source)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

"ForkJoinPool.commonPool-worker-2" #27 daemon prio=5 os_prio=31 tid=0x00007fc67b924000 nid=0x9a0f runnable [0x0000700005880000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.lsp4xml.dom.DOMNode.getParentElement(DOMNode.java:389)
	at org.eclipse.lsp4xml.services.AbstractPositionRequest.getParentElement(AbstractPositionRequest.java:57)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.ContentModelCompletionParticipant.onTagOpen(ContentModelCompletionParticipant.java:46)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectOpenTagSuggestions(XMLCompletions.java:375)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectInsideContent(XMLCompletions.java:542)
	at org.eclipse.lsp4xml.services.XMLCompletions.doComplete(XMLCompletions.java:205)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doComplete(XMLLanguageService.java:103)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$completion$1(XMLTextDocumentService.java:192)
	at org.eclipse.lsp4xml.XMLTextDocumentService$$Lambda$46/2027672026.apply(Unknown Source)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

"Attach Listener" #20 daemon prio=9 os_prio=31 tid=0x00007fc67d26a800 nid=0x9d07 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"pool-2-thread-1" #16 prio=5 os_prio=31 tid=0x00007fc67b8f2800 nid=0x5903 waiting on condition [0x000070000567b000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007bc54e418> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1081)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

"DestroyJavaVM" #15 prio=5 os_prio=31 tid=0x00007fc67d002800 nid=0x1803 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"pool-3-thread-1" #14 prio=5 os_prio=31 tid=0x00007fc67b8db800 nid=0x5803 runnable [0x0000700005578000]
   java.lang.Thread.State: RUNNABLE
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:255)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
	- locked <0x00000007bc582168> (a java.io.BufferedInputStream)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:79)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

"pool-4-thread-1" #13 prio=5 os_prio=31 tid=0x00007fc67c93b800 nid=0x9f03 waiting on condition [0x0000700005475000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007bc582410> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

"Service Thread" #11 daemon prio=9 os_prio=31 tid=0x00007fc67c03c800 nid=0xa203 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread2" #10 daemon prio=9 os_prio=31 tid=0x00007fc67c03c000 nid=0xa403 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #9 daemon prio=9 os_prio=31 tid=0x00007fc67b832000 nid=0xa603 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #8 daemon prio=9 os_prio=31 tid=0x00007fc67c04d800 nid=0xa803 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" #7 daemon prio=10 os_prio=31 tid=0x00007fc67c04c800 nid=0x5503 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" #6 daemon prio=10 os_prio=31 tid=0x00007fc67c04c000 nid=0x3e07 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #5 daemon prio=9 os_prio=31 tid=0x00007fc67c846000 nid=0x3d03 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Surrogate Locker Thread (Concurrent GC)" #4 daemon prio=9 os_prio=31 tid=0x00007fc67c824000 nid=0x3b03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fc67b831800 nid=0x4603 in Object.wait() [0x0000700004a57000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000007bc5832c8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x00000007bc5832c8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fc67b829000 nid=0x3503 in Object.wait() [0x0000700004954000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000007bc583480> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
	- locked <0x00000007bc583480> (a java.lang.ref.Reference$Lock)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"VM Thread" os_prio=31 tid=0x00007fc67d02c800 nid=0x3403 runnable

"Gang worker#0 (Parallel GC Threads)" os_prio=31 tid=0x00007fc67c803800 nid=0x1e07 runnable

"Gang worker#1 (Parallel GC Threads)" os_prio=31 tid=0x00007fc67c812800 nid=0x2a03 runnable

"Gang worker#2 (Parallel GC Threads)" os_prio=31 tid=0x00007fc67c813000 nid=0x2c03 runnable

"Gang worker#3 (Parallel GC Threads)" os_prio=31 tid=0x00007fc67c814000 nid=0x5303 runnable

"G1 Main Concurrent Mark GC Thread" os_prio=31 tid=0x00007fc67b80f000 nid=0x3103 runnable

"Gang worker#0 (G1 Parallel Marking Threads)" os_prio=31 tid=0x00007fc67b810000 nid=0x4b03 runnable

"G1 Concurrent Refinement Thread#0" os_prio=31 tid=0x00007fc67b807800 nid=0x4d03 runnable

"G1 Concurrent Refinement Thread#1" os_prio=31 tid=0x00007fc67b807000 nid=0x3003 runnable

"G1 Concurrent Refinement Thread#2" os_prio=31 tid=0x00007fc67c815000 nid=0x2f03 runnable

"G1 Concurrent Refinement Thread#3" os_prio=31 tid=0x00007fc67b806000 nid=0x2e03 runnable

"G1 Concurrent Refinement Thread#4" os_prio=31 tid=0x00007fc67c814800 nid=0x2d03 runnable

"String Deduplication Thread" os_prio=31 tid=0x00007fc67c818800 nid=0x3303 runnable

"VM Periodic Task Thread" os_prio=31 tid=0x00007fc67c03d800 nid=0xa103 waiting on condition

JNI global references: 2535

The issue is caused by:
https://github.com/angelozerr/lsp4xml/blob/f4e8319ba63c970277469ccd3115cd6c1f96c096/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/dom/DOMNode.java#L370-L378

when parent.isElement() returns false, it goes back into the loop but the parent value is not updated, so it continues indefinitely

@fbricon fbricon added bug Something isn't working completion This issue or enhancement is related to completion support labels Dec 18, 2018
@fbricon fbricon added this to the v0.0.3 milestone Dec 18, 2018
@angelozerr
Copy link
Contributor

@fbricon it should be fixed with d55d53e

@fbricon
Copy link
Contributor Author

fbricon commented Dec 18, 2018

Yup it's fixed. Thanks @angelozerr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completion This issue or enhancement is related to completion support regression
Projects
None yet
Development

No branches or pull requests

2 participants