ClangBlackList$ClangClientSpy -- What?!
Answered
I got this stacktrace:
Can you please tell me what your software is doing? What is this clang blacklist and what is this clientSpy up to?
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:126)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:172)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:143)
at com.jetbrains.cidr.lang.daemon.clang.clangd.lsp.server.ClangClientServerProviderImpl$LoggingMessageConsumer.consume(ClangClientServerProviderImpl.java:185)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51)
... 12 more
Caused by: java.lang.AssertionError: Why didn't get clion offset for the given clang offset?
at com.jetbrains.cidr.lang.daemon.clang.ClangUtils.a(ClangUtils.java:820)
at com.jetbrains.cidr.lang.daemon.clang.ClangUtils.toCharRanges(ClangUtils.java:780)
at com.jetbrains.cidr.lang.daemon.clang.clangd.lsp.client.ClangClientImpl.a(ClangClientImpl.java:58)
at com.jetbrains.cidr.lang.daemon.clang.clangd.registry.ClangFilesRegistry$ClangFileImpl.a(ClangFilesRegistry.java:612)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1168)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.a(ProgressIndicatorUtils.java:70)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.a(ProgressIndicatorUtils.java:123)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:582)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:112)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:70)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:91)
at com.jetbrains.cidr.lang.daemon.clang.clangd.lsp.ClangLanguageServiceUtils.runClangReadAction(ClangLanguageServiceUtils.java:264)
at com.jetbrains.cidr.lang.daemon.clang.clangd.registry.ClangFilesRegistry$ClangFileImpl.withVirtualFile(ClangFilesRegistry.java:615)
at com.jetbrains.cidr.lang.daemon.clang.clangd.lsp.client.ClangClientImpl.clionPublishDiagnostics(ClangClientImpl.java:54)
at com.jetbrains.cidr.lang.daemon.clang.clangd.lsp.client.ClangClientAdapter.clionPublishDiagnostics(ClangClientAdapter.kt:11)
at com.jetbrains.cidr.lang.daemon.clang.clangd.lsp.server.ClangBlackList$ClangClientSpy.clionPublishDiagnostics(ClangBlackList.java:159)
... 16 more
Please sign in to leave a comment.
Hi Franz!
ClangClientSpy ensures that request to the clangd (which is our alternative parser) haven't caused clangd crash. If ClangClientSpy sees that request to parse some file leads to the crash, it puts that file into the blacklist. You will not get errors for that file anymore, but at least clangd will continue to work for other files.
Actually, that exception is not about crash of clangd, it's an assertion failure as you can see. Could you please file a bug and attach some test case where this happens? If it's reproducible of course.