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

Crash on a simple POM file #597

Closed
alexolog opened this issue Sep 27, 2021 · 18 comments · Fixed by #604
Closed

Crash on a simple POM file #597

alexolog opened this issue Sep 27, 2021 · 18 comments · Fixed by #604
Assignees
Labels
binary bug Something isn't working
Milestone

Comments

@alexolog
Copy link

The language server crashes and I get the following message:

The XML language server crashed 5 times in the last 10 minutes. The server will not be restarted.

The file in question is:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.learning.kafka</groupId>
    <artifactId>kafka-getting-started</artifactId>

    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.13</artifactId>
            <version>2.7.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
@rgrunber
Copy link
Member

rgrunber commented Sep 28, 2021

If you restart and ensure xml.trace.server is set to verbose (in the VS Code Settings page), and then open the pom file, are there any possible errors you notice in the XML Support dropdown box of the Output View ? Can you search for vmargs to see what is being passed to the Java launch ? If you could attach that log file, it would definitely help.

As a workaround, you could try setting the preference xml.server.preferBinary to true on the VS Code Settings page. That should avoid trying to use a local Java runtime to launch.

@angelozerr , have you ever run into such a case ? I've seen OOM before, but the file was ~24MB.

@angelozerr
Copy link
Contributor

I cannot reproduce it. @alexolog could you share your project please?

As @rgrunber suggested, could you share XML support traces? Which version of Java do you use? If you switch to xml.server.preferBinary is it working better?

@alexolog
Copy link
Author

alexolog commented Sep 28, 2021

xml.server.preferBinary was already set to true, but apparently it did not work.

Here's the trace:

Click to expand
[Trace - 9:26:21 a.m.] Sending request 'initialize - (0)'.
Params: {
    "processId": 50625,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.60.2"
    },
    "locale": "en-gb",
    "rootPath": "/work/Ex_Files_Apache_Kafka/Exercise Files/KafkaGettingStarted",
    "rootUri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional",
                "normalizesLineEndings": true,
                "changeAnnotationSupport": {
                    "groupsOnLabel": true
                }
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true,
            "semanticTokens": {
                "refreshSupport": true
            },
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            }
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "insertReplaceSupport": true,
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    }
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    },
                    "activeParameterSupport": true
                },
                "contextSupport": true
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "labelSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                },
                "honorsChangeAnnotations": false
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true,
                "prepareSupportDefaultBehavior": 1,
                "honorsChangeAnnotations": true
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "operator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        },
        "general": {
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "1.1.0"
            }
        }
    },
    "initializationOptions": {
        "settings": {
            "xml": {
                "java": {
                    "home": "/usr/lib/jvm/java-11-openjdk-amd64"
                },
                "server": {
                    "vmargs": "-Xmx64M",
                    "workDir": "~/.lemminx",
                    "preferBinary": true,
                    "silenceExtensionWarning": false,
                    "binary": {
                        "path": "",
                        "args": "",
                        "trustedHashes": []
                    }
                },
                "trace": {
                    "server": "verbose"
                },
                "logs": {
                    "client": true,
                    "file": "/home/alexolog/.config/Code/User/workspaceStorage/c6b96943d22f3c731e322056bf2ef954/redhat.vscode-xml/lemminx.log"
                },
                "catalogs": [],
                "fileAssociations": [],
                "format": {
                    "enabled": true,
                    "emptyElements": "ignore",
                    "enforceQuoteStyle": "ignore",
                    "joinCDATALines": false,
                    "joinCommentLines": false,
                    "joinContentLines": false,
                    "preserveAttributeLineBreaks": false,
                    "preserveEmptyContent": false,
                    "preservedNewlines": 2,
                    "spaceBeforeEmptyCloseTag": true,
                    "xsiSchemaLocationSplit": "none",
                    "splitAttributes": false,
                    "splitAttributesIndentSize": 2,
                    "closingBracketNewLine": false,
                    "trimFinalNewlines": false,
                    "trimTrailingWhitespace": true,
                    "insertFinalNewline": false
                },
                "preferences": {
                    "quoteStyle": "double",
                    "showSchemaDocumentationType": "all"
                },
                "completion": {
                    "autoCloseTags": true,
                    "autoCloseRemovesContent": true
                },
                "codeLens": {
                    "enabled": false
                },
                "validation": {
                    "enabled": true,
                    "namespaces": {
                        "enabled": "always"
                    },
                    "schema": {
                        "enabled": "always"
                    },
                    "disallowDocTypeDecl": false,
                    "resolveExternalEntities": false,
                    "noGrammar": "hint"
                },
                "symbols": {
                    "enabled": true,
                    "excluded": [],
                    "maxItemsComputed": -1,
                    "showReferencedGrammars": true,
                    "filters": []
                },
                "extension": {
                    "jars": []
                },
                "useCache": true,
                "telemetry": {
                    "enabled": false
                }
            }
        },
        "extendedClientCapabilities": {
            "codeLens": {
                "codeLensKind": {
                    "valueSet": [
                        "references",
                        "association",
                        "open.uri"
                    ]
                }
            },
            "actionableNotificationSupport": true,
            "openSettingsCommandSupport": true,
            "bindingWizardSupport": true,
            "shouldLanguageServerExitOnShutdown": true
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted",
            "name": "KafkaGettingStarted"
        }
    ]
}


[Trace - 9:26:21 a.m.] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Sep 28, 2021 09:26:21 org.eclipse.lemminx.XMLLanguageServer initialize()\nMessage: Initializing XML Language server\nLemMinX Server info:\n - Version : 0.18.0\n - Native Image\n - VM Version : 1.8.0_272\n - Git [Branch 61ac76820f1a87405a75530a054e40e63dbf18e4] 61ac768 - [maven-release-plugin] prepare release 0.18.0"
}


[Info  - 9:26:21 a.m.] Sep 28, 2021 09:26:21 org.eclipse.lemminx.XMLLanguageServer initialize()
Message: Initializing XML Language server
LemMinX Server info:
 - Version : 0.18.0
 - Native Image
 - VM Version : 1.8.0_272
 - Git [Branch 61ac76820f1a87405a75530a054e40e63dbf18e4] 61ac768 - [maven-release-plugin] prepare release 0.18.0
[Trace - 9:26:21 a.m.] Received response 'initialize - (0)' in 30ms.
Result: {
    "capabilities": {
        "textDocumentSync": 2,
        "hoverProvider": false,
        "definitionProvider": false,
        "typeDefinitionProvider": false,
        "referencesProvider": false,
        "documentHighlightProvider": false,
        "documentSymbolProvider": false,
        "codeActionProvider": false,
        "documentFormattingProvider": false,
        "documentRangeFormattingProvider": false,
        "renameProvider": false,
        "foldingRangeProvider": false,
        "linkedEditingRangeProvider": false
    }
}


[Trace - 9:26:21 a.m.] Sending notification 'initialized'.
Params: {}


[Trace - 9:26:21 a.m.] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "xml": {
            "java": {
                "home": "/usr/lib/jvm/java-11-openjdk-amd64"
            },
            "server": {
                "vmargs": "-Xmx64M",
                "workDir": "~/.lemminx",
                "preferBinary": true,
                "silenceExtensionWarning": false,
                "binary": {
                    "path": "",
                    "args": "",
                    "trustedHashes": []
                }
            },
            "trace": {
                "server": "verbose"
            },
            "logs": {
                "client": true,
                "file": "/home/alexolog/.config/Code/User/workspaceStorage/c6b96943d22f3c731e322056bf2ef954/redhat.vscode-xml/lemminx.log"
            },
            "catalogs": [],
            "fileAssociations": [],
            "format": {
                "enabled": true,
                "emptyElements": "ignore",
                "enforceQuoteStyle": "ignore",
                "joinCDATALines": false,
                "joinCommentLines": false,
                "joinContentLines": false,
                "preserveAttributeLineBreaks": false,
                "preserveEmptyContent": false,
                "preservedNewlines": 2,
                "spaceBeforeEmptyCloseTag": true,
                "xsiSchemaLocationSplit": "none",
                "splitAttributes": false,
                "splitAttributesIndentSize": 2,
                "closingBracketNewLine": false,
                "trimFinalNewlines": false,
                "trimTrailingWhitespace": true,
                "insertFinalNewline": false
            },
            "preferences": {
                "quoteStyle": "double",
                "showSchemaDocumentationType": "all"
            },
            "completion": {
                "autoCloseTags": true,
                "autoCloseRemovesContent": true
            },
            "codeLens": {
                "enabled": false
            },
            "validation": {
                "enabled": true,
                "namespaces": {
                    "enabled": "always"
                },
                "schema": {
                    "enabled": "always"
                },
                "disallowDocTypeDecl": false,
                "resolveExternalEntities": false,
                "noGrammar": "hint"
            },
            "symbols": {
                "enabled": true,
                "excluded": [],
                "maxItemsComputed": -1,
                "showReferencedGrammars": true,
                "filters": []
            },
            "extension": {
                "jars": []
            },
            "useCache": true,
            "telemetry": {
                "enabled": false
            }
        }
    }
}


[Trace - 9:26:21 a.m.] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted/pom.xml",
        "languageId": "xml",
        "version": 1,
        "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>com.learning.kafka</groupId>\n    <artifactId>kafka-getting-started</artifactId>\n\n    <version>1.0-SNAPSHOT</version>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.apache.kafka</groupId>\n            <artifactId>kafka_2.13</artifactId>\n            <version>2.7.0</version>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.3</version>\n                <configuration>\n                    <source>1.8</source>\n                    <target>1.8</target>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n\n</project>"
    }
}


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (1)'.
Params: {
    "registrations": [
        {
            "id": "bbceaaf6-53ff-4eed-8603-d83de07e94d8",
            "method": "textDocument/codeAction"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (1)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (2)'.
Params: {
    "registrations": [
        {
            "id": "caa9e428-8a79-4ec2-aceb-4eb134d09696",
            "method": "textDocument/completion",
            "registerOptions": {
                "resolveProvider": false,
                "triggerCharacters": [
                    ".",
                    ":",
                    "<",
                    "\"",
                    "=",
                    "/",
                    "\\",
                    "?",
                    "'",
                    "&"
                ]
            }
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (2)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (3)'.
Params: {
    "registrations": [
        {
            "id": "48224fdc-e60c-47e0-a04c-0af0b16d5ae0",
            "method": "textDocument/documentHighlight"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (3)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (4)'.
Params: {
    "registrations": [
        {
            "id": "2239d43e-b4d2-4188-a086-bb1430f7a9c5",
            "method": "textDocument/foldingRange"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (4)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (5)'.
Params: {
    "registrations": [
        {
            "id": "52163c83-f178-4d3c-b5e1-bf2a7c84e4ad",
            "method": "textDocument/hover"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (5)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (6)'.
Params: {
    "registrations": [
        {
            "id": "225bd2b1-8862-4aca-abea-97b11e0de66e",
            "method": "textDocument/documentLink",
            "registerOptions": {
                "resolveProvider": true
            }
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (6)'. Processing request took 1ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (7)'.
Params: {
    "registrations": [
        {
            "id": "ebe329a2-7271-4da4-b903-d39ea8614985",
            "method": "textDocument/rename"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (7)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (8)'.
Params: {
    "registrations": [
        {
            "id": "80499f5c-564a-482d-ae60-e744bd9250cb",
            "method": "textDocument/definition"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (8)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (9)'.
Params: {
    "registrations": [
        {
            "id": "56b2c129-7fed-4cb6-b4fe-bdb0b81af578",
            "method": "textDocument/typeDefinition"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (9)'. Processing request took 2ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (10)'.
Params: {
    "registrations": [
        {
            "id": "3f474df9-f2b7-4841-b0a7-32d32a7972e7",
            "method": "textDocument/references"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (10)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (11)'.
Params: {
    "registrations": [
        {
            "id": "b64416f1-8072-4e1e-bd96-7242e9ae08f7",
            "method": "textDocument/linkedEditingRange"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (11)'. Processing request took 2ms
No result returned.


[Trace - 9:26:21 a.m.] Sending request 'textDocument/codeAction - (1)'.
Params: {
    "textDocument": {
        "uri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted/pom.xml"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 0,
            "character": 0
        }
    },
    "context": {
        "diagnostics": []
    }
}


[Trace - 9:26:21 a.m.] Sending request 'textDocument/documentLink - (2)'.
Params: {
    "textDocument": {
        "uri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted/pom.xml"
    }
}


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (12)'.
Params: {
    "registrations": [
        {
            "id": "07dd858e-676c-4fbe-ad9f-4304632e0307",
            "method": "workspace/didChangeWatchedFiles",
            "registerOptions": {
                "watchers": [
                    {
                        "globPattern": "**/*.xsd"
                    },
                    {
                        "globPattern": "**/*.dtd"
                    }
                ]
            }
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (12)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (13)'.
Params: {
    "registrations": [
        {
            "id": "293e309d-bdef-4211-a6aa-df2890730ced",
            "method": "textDocument/formatting"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (13)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (14)'.
Params: {
    "registrations": [
        {
            "id": "7484f529-0a71-4c9f-be2c-2ec3a90e113b",
            "method": "textDocument/rangeFormatting"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (14)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (15)'.
Params: {
    "registrations": [
        {
            "id": "b6a4cfc8-8464-4551-b161-747dd9574145",
            "method": "textDocument/selectionRange"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (15)'. Processing request took 0ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (16)'.
Params: {
    "registrations": [
        {
            "id": "348f243e-a2d0-4f6c-8e29-9f4720eca734",
            "method": "textDocument/documentSymbol"
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (16)'. Processing request took 6ms
No result returned.


[Trace - 9:26:21 a.m.] Received request 'client/registerCapability - (17)'.
Params: {
    "registrations": [
        {
            "id": "95961196-2f5d-4f7b-bf5c-2edc3a3be3a6",
            "method": "workspace/executeCommand",
            "registerOptions": {
                "commands": [
                    "xml.check.bound.grammar",
                    "xml.associate.grammar.insert",
                    "xml.validation.current.file",
                    "xml.validation.all.files"
                ]
            }
        }
    ]
}


[Trace - 9:26:21 a.m.] Sending response 'client/registerCapability - (17)'. Processing request took 0ms
[Trace - 9:26:21 a.m.] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted/pom.xml",
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 1,
                    "character": 1
                },
                "end": {
                    "line": 1,
                    "character": 8
                }
            },
            "severity": 3,
            "source": "xml",
            "message": "The resource 'http://maven.apache.org/xsd/maven-4.0.0.xsd' is downloading."
        }
    ]
}


[Trace - 9:26:21 a.m.] Received notification 'telemetry/event'.
Params: {
    "name": "server.document.open",
    "properties": {
        "file.resolver": [
            "default"
        ],
        "file.extension": "xml",
        "file.grammar.schemalocation": true
    }
}


[Trace - 9:26:21 a.m.] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Sep 28, 2021 09:26:21 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()\nMessage: Downloading http://maven.apache.org/xsd/maven-4.0.0.xsd to /home/alexolog/.lemminx/cache/http/maven.apache.org/xsd/maven-4.0.0.xsd..."
}


[Info  - 9:26:21 a.m.] Sep 28, 2021 09:26:21 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()
Message: Downloading http://maven.apache.org/xsd/maven-4.0.0.xsd to /home/alexolog/.lemminx/cache/http/maven.apache.org/xsd/maven-4.0.0.xsd...
[Trace - 9:26:21 a.m.] Sending request 'textDocument/documentSymbol - (3)'.
Params: {
    "textDocument": {
        "uri": "file:///work/Ex_Files_Apache_Kafka/Exercise%20Files/KafkaGettingStarted/pom.xml"
    }
}


[Info  - 9:26:21 a.m.] Connection to server got closed. Server will restart.
[Error - 9:26:21 a.m.] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:454533)
	at Object.dispose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:341841)
	at E.handleConnectionClosed (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:342054)
	at E.handleConnectionClosed (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:402460)
	at t (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:340143)
	at invoke (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456147)
	at o.fire (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456908)
	at Y (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:443791)
	at invoke (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456147)
	at o.fire (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456908)
	at m.fireClose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:464790)
	at Socket.<anonymous> (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:466375)
	at Socket.emit (events.js:327:22)
	at Pipe.<anonymous> (net.js:673:12)
[Error - 9:26:21 a.m.] Request textDocument/documentLink failed.
Error: Connection got disposed.
	at Object.dispose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:454533)
	at Object.dispose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:341841)
	at E.handleConnectionClosed (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:342054)
	at E.handleConnectionClosed (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:402460)
	at t (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:340143)
	at invoke (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456147)
	at o.fire (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456908)
	at Y (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:443791)
	at invoke (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456147)
	at o.fire (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456908)
	at m.fireClose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:464790)
	at Socket.<anonymous> (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:466375)
	at Socket.emit (events.js:327:22)
	at Pipe.<anonymous> (net.js:673:12)
[Error - 9:26:21 a.m.] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
	at Object.dispose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:454533)
	at Object.dispose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:341841)
	at E.handleConnectionClosed (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:342054)
	at E.handleConnectionClosed (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:402460)
	at t (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:340143)
	at invoke (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456147)
	at o.fire (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456908)
	at Y (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:443791)
	at invoke (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456147)
	at o.fire (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:456908)
	at m.fireClose (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:464790)
	at Socket.<anonymous> (/home/alexolog/.vscode/extensions/redhat.vscode-xml-0.18.0/dist/extension.js:2:466375)
	at Socket.emit (events.js:327:22)
	at Pipe.<anonymous> (net.js:673:12)

There are no "project settings, I just open the POM file directly code -n pom.xml

@rgrunber rgrunber added binary bug Something isn't working labels Sep 28, 2021
@angelozerr
Copy link
Contributor

angelozerr commented Sep 28, 2021

Many thanks @alexolog to have taken time to share your trace.

I suspect it's a problem with XSD downloading (perhaps it's a problem with some proxy or right to write in your /home)?

@alexolog could you download with your browser the maven-4.0.0.xsd and store it at /home/alexolog/.lemminx/cache/http/maven.apache.org/xsd/maven-4.0.0.xsd please.

Is it working better?

@rgrunber
Copy link
Member

rgrunber commented Sep 28, 2021

Bingo, I'm able to reproduce as well. It started happening the moment I cleared my ~/.lemminx folder, where the resource was cached. I was seeing The resource 'http://maven.apache.org/xsd/maven-4.0.0.xsd' is downloading. but it never completed. It happens on both binary and Java, but the binary case seems to be what crashes, so far.

@angelozerr
Copy link
Contributor

Bingo, I'm able to reproduce as well. It started happening the moment

@rgrunber I cannot reproduce it with my Windows OS -( Do you think you could have time to investigate the problem?

@angelozerr
Copy link
Contributor

angelozerr commented Sep 28, 2021

@alexolog
Copy link
Author

could you download with your browser the maven-4.0.0.xsd and store it at /home/alexolog/.lemminx/cache/http/maven.apache.org/xsd/maven-4.0.0.xsd please.

Is it working better?

The workaround stopped the crashing,

@angelozerr
Copy link
Contributor

The workaround stopped the crashing,

Ok thanks for your feedback. The problem comes from downloading. By waiting a fix for that, you can enjoy with vscode-xml features (diagnostic, completion,etc). Hope you will like it.

@angelozerr
Copy link
Contributor

@alexolog is it working without binary? If it doesn't work could you share your traces please. Thanks.

@rgrunber
Copy link
Member

rgrunber commented Sep 29, 2021

Although I'm not entirely sure, I seem unable to reproduce on vscode-xml 0.16.0, and can easily can reproduce on any version 0.16.1 or above. One interesting thing that happened between those releases was we started building the native binary as a static library (instead of dynamic). Maybe some statically linked library just isn't working on our system.

I would guess the failure happens somehwere in https://github.com/eclipse/lemminx/blob/master/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/uriresolver/CacheResourcesManager.java#L168-L176 because the last communication from the server is right above that line, and I'm unable to detect a GET request coming from the process (according to wireshark).

Update :

Attaching to the LemMinX binary with gdb :

Thread 5 "onPool-worker-2" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 112592]
0x00007f3eb21549d4 in __nss_readline () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f3eb21549d4 in __nss_readline () from /lib64/libc.so.6
#1  0x00007f3eb4cea4de in internal_getent () from /lib64/libnss_files.so.2
#2  0x00007f3eb4ceb4a5 in _nss_files_gethostbyname3_r ()
   from /lib64/libnss_files.so.2
#3  0x0000000001a8ca0f in ?? ()
#4  0x0000000001a8d8fb in getaddrinfo ()
#5  0x00000000019e66af in Java_java_net_Inet4AddressImpl_lookupAllHostAddr (
    env=0x7f3e9c000b80, this=<optimized out>, host=0x2)
    at o/T/P1/203733.buildslave/s/jdk/src/solaris/native/java/net/Inet4AddressImpl.c:418
#6  0x0000000000b394d0 in ?? ()
#7  0x00007f3eb021a328 in ?? ()
#8  0x00007f3eb45c0690 in ?? ()
#9  0x00007f3eb24d3460 in ?? ()
#10 0x00007f3eb021a328 in ?? ()
#11 0x0000000000000001 in ?? ()
#12 0x0000000100db59ca in ?? ()
#13 0x0000000000b394bd in ?? ()
#14 0x00007f3eb0bfe620 in ?? ()
#15 0x0000000000000000 in ?? ()

@rgrunber
Copy link
Member

rgrunber commented Sep 29, 2021

Using -H:+StaticExecutableWithDynamicLibC (https://www.graalvm.org/reference-manual/native-image/StaticImages/#build-a-mostly-static-native-image) solves the problem for me. I think we can modify our build process to do this on Linux only.

This is the ldd for a fully dynamically linked LemMinX binary :

linux-vdso.so.1 (0x00007ffd7d5c2000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f40c7b06000)
libz.so.1 => /lib64/libz.so.1 (0x00007f40c7aec000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f40c7acb000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f40c7ac4000)
librt.so.1 => /lib64/librt.so.1 (0x00007f40c7ab9000)
libc.so.6 => /lib64/libc.so.6 (0x00007f40c78ea000)
libm.so.6 => /lib64/libm.so.6 (0x00007f40c77a4000)
/lib64/ld-linux-x86-64.so.2 (0x00007f40c7d39000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f40c7789000)

This is the ldd for a statically linked except for glibc LemMinX binary :

linux-vdso.so.1 (0x00007ffee3f40000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f627d948000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f627d941000)
librt.so.1 => /lib64/librt.so.1 (0x00007f627d936000)
libc.so.6 => /lib64/libc.so.6 (0x00007f627d767000)
/lib64/ld-linux-x86-64.so.2 (0x00007f627d97d000)

Looks like we'd be regressing #457, so I'll have to test what the situation is like on an Alpine container. We added the static build specifically for glibc, and so this would remove exactly that.

@angelozerr
Copy link
Contributor

On Windows os it works but what about with mac os? @fbricon is download is working for you?

@rgrunber
Copy link
Member

rgrunber commented Oct 1, 2021

# cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.14.2
PRETTY_NAME="Alpine Linux v3.14"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

# ldd lemminx-linux-x86_64-0.18.1-SNAPSHOT-part-dynamic
	/lib64/ld-linux-x86-64.so.2 (0x7f5f3ae30000)
	libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f5f3ae30000)
	libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f5f3ae30000)
	librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f5f3ae30000)
	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f5f3ae30000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by lemminx-linux-x86_64-0.18.1-SNAPSHOT-part-dynamic)
Error relocating lemminx-linux-x86_64-0.18.1-SNAPSHOT-part-dynamic: __strtok_r: symbol not found
Error relocating lemminx-linux-x86_64-0.18.1-SNAPSHOT-part-dynamic: __strdup: symbol not found

Looks like making it dynamic would break Alpine, so we'll have to see if there's a another way.

@rgrunber
Copy link
Member

rgrunber commented Oct 14, 2021

Might be similar to https://bugs.gentoo.org/763585#c1 ?
Update : Plenty of issues filed upstream also https://github.com/oracle/graal/issues?q=is%3Aissue+nss+is%3Aclosed .

Seems like an additional workaround is to add libmusl to the build environment and use -H:UseMuslC=<path to static library bundle> apparently this should work around the issue also.

rgrunber added a commit to rgrunber/vscode-xml that referenced this issue Oct 15, 2021
- Fixes redhat-developer#597
- Use -H:+StaticExecutableWithDynamicLibC to statically link everything
  except libc

Signed-off-by: Roland Grunberg <[email protected]>
@rgrunber
Copy link
Member

I've also tried the statically generated binaries in our validation builds (Ubuntu 20.04.3, glibc 2.31), and even those fail the same way.

@rgrunber
Copy link
Member

rgrunber commented Oct 27, 2021

Once this issue is addressed (which should regress support for Alpine Linux, or any platform not providing libc), we can address that with #593 . According to https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions , there is support for targeting alpine-x64.

CC'ing @benoitf & @svor

rgrunber added a commit that referenced this issue Oct 27, 2021
- Fixes #597
- Use -H:+StaticExecutableWithDynamicLibC to statically link everything
  except libc

Signed-off-by: Roland Grunberg <[email protected]>
@rgrunber
Copy link
Member

rgrunber commented Oct 27, 2021

In case anyone would like to use/test the binary until we get a release out, I've just tested and confirmed that the following should work :

  1. Download for your platform https://download.jboss.org/jbosstools/vscode/snapshots/lemminx-binary/0.18.1-433/ and unzip locally. You can also verify the sha256 hash after download.
  2. Optionally, run ldd on the binary to confirm it's dynamic :
$ ldd lemminx-linux
	linux-vdso.so.1 (0x00007ffcaffe1000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc3ae7a2000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fc3ae79b000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fc3ae790000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fc3ae5c1000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fc3ae7d7000)
  1. Remove or back up your $HOME/.lemminx/ folder and ensure you set the following settings for vscode :
...
"xml.server.preferBinary": true,
"xml.server.binary.path": "/path/to/the/downloaded/lemminx-linux",
...

You can also (optionally) add
"xml.server.binary.trustedHashes" : [ ... ] and provide the sha256 hash of the binary, though if you don't, you'll just be prompted whether to trust the binary prior to its execution.

  1. When you open the sample file from Crash on a simple POM file #597 (comment) , you may see a prompt asking whether you'd like to trust the binary if you didn't trust it in step 3. Once trusted you should see the file loading as usual. The binary shouldn't crash, and there should be no diagnostic/problem text indicating that the resource is loading ...

@fbricon fbricon added this to the 0.18.1 milestone Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants