Pure-D / code-d

Fully featured D language extension for Visual Studio Code using Serve-D
MIT License
297 stars 47 forks source link

Broadcasting dcd server crash. Unable to connect socket #389

Open rocex opened 2 years ago

rocex commented 2 years ago

This problem has bothered me for a long time. Other computers still exist on the latest version of the software. I saw it, too https://github.com/Pure-D/code-d/issues/123 , according to what's said here, it still hasn't been solved.

os windows 7 sp1 vsc 1.63.2 code-d 0.23.2 dcd v0.13.6 serve d_0.7.1

dub.json "targetPath": ".dub", "targetType": "executable",

"sourcePaths": ["./source"],

"dependencies": { "ddbc": "~>0.5.3", "vibe-d": "~>0.9.4" },

"subConfigurations": { "ddbc": "SQLite" },

"dflags": ["-J./resource"],
"lflags": [""],

vsc Setting "d.servedPath": "E:\Server\Dmd\code-d\serve-d.exe", "d.dcdClientPath": "E:\Server\Dmd\code-d\dcd-client.exe", "d.dcdServerPath": "E:\Server\Dmd\code-d\dcd-server.exe", "d.overrideDfmtEditorconfig": false,

code-d console log 2022-01-03T12:31:23.700 [info] source\app.d:132:main Setting language to zh serve-d v0.7.1 with workspace-d v3.6.1 Included features: "d", "workspaces" Built: Fri Dec 10 23:12:58 2021 with compiler LDC v2.98 on win64 littleEndian dub, dfmt and dscanner are bundled within (compiled in) 2022-01-03T12:31:23.762 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.1\workspace-d\source\workspaced\com\dcd.d:80:reloadBinaries using builtin DCD client 2022-01-03T12:31:23.871 [info] source\served\extension.d:638:rootsForProject Root Suggestions: [RootSuggestion("d:\DataHub\GitLabStats", true)] 2022-01-03T12:31:23.871 [info] source\served\extension.d:670:doStartup registering instance for root RootSuggestion("d:\DataHub\GitLabStats", true) 2022-01-03T12:31:23.872 [info] source\served\extension.d:758:delayedProjectActivation Initializing instance for root RootSuggestion("d:\DataHub\GitLabStats", true) 2022-01-03T12:31:24.207 [info] source\served\extension.d:829:delayedProjectActivation Root RootSuggestion("d:\DataHub\GitLabStats", true) initialized in 335 ms, 580 μs, and 8 hnsecs 2022-01-03T12:31:27.293 [info] source\served\extension.d:908:startDCDServer Imports for d:\DataHub\GitLabStats: ["d:\DataHub\GitLabStats\source\", "E:\Server\dpackage\vibe-d-0.9.4\source\", "E:\Server\dpackage\vibe-d-0.9.4\crypto\", "E:\Server\dpackage\mir-linux-kernel-1.0.1\source\", "E:\Server\dpackage\vibe-core-1.22.0\source\", "E:\Server\dpackage\eventcore-0.9.20\source\", "E:\Server\dpackage\taggedalgebraic-0.11.22\source\", "E:\Server\dpackage\stdx-allocator-2.77.5\source\", "E:\Server\dpackage\vibe-d-0.9.4\data\", "E:\Server\dpackage\vibe-d-0.9.4\utils\", "E:\Server\dpackage\vibe-d-0.9.4\http\", "E:\Server\dpackage\diet-ng-1.8.0\source\", "E:\Server\dpackage\vibe-d-0.9.4\inet\", "E:\Server\dpackage\vibe-d-0.9.4\stream\", "E:\Server\dpackage\vibe-d-0.9.4\textfilter\", "E:\Server\dpackage\vibe-d-0.9.4\tls\", "E:\Server\dpackage\openssl-1.1.6_1.0.1g\", "E:\Server\dpackage\vibe-d-0.9.4\mail\", "E:\Server\dpackage\vibe-d-0.9.4\mongodb\", "E:\Server\dpackage\vibe-d-0.9.4\redis\", "E:\Server\dpackage\vibe-d-0.9.4\web\", "E:\Server\dpackage\ddbc-0.5.3\source\"] 2022-01-03T12:31:42.083 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.1\workspace-d\source\workspaced\com\dcd.d:239:lambda15 DCD-Server stopped with code -1073741819 2022-01-03T12:31:42.083 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.1\workspace-d\source\workspaced\com\dcd.d:242:lambda15 Broadcasting dcd server crash. 2022-01-03T12:31:44.134 [info] source\served\extension.d:908:startDCDServer Imports for d:\DataHub\GitLabStats: ["d:\DataHub\GitLabStats\source\", "E:\Server\dpackage\vibe-d-0.9.4\source\", "E:\Server\dpackage\vibe-d-0.9.4\crypto\", "E:\Server\dpackage\mir-linux-kernel-1.0.1\source\", "E:\Server\dpackage\vibe-core-1.22.0\source\", "E:\Server\dpackage\eventcore-0.9.20\source\", "E:\Server\dpackage\taggedalgebraic-0.11.22\source\", "E:\Server\dpackage\stdx-allocator-2.77.5\source\", "E:\Server\dpackage\vibe-d-0.9.4\data\", "E:\Server\dpackage\vibe-d-0.9.4\utils\", "E:\Server\dpackage\vibe-d-0.9.4\http\", "E:\Server\dpackage\diet-ng-1.8.0\source\", "E:\Server\dpackage\vibe-d-0.9.4\inet\", "E:\Server\dpackage\vibe-d-0.9.4\stream\", "E:\Server\dpackage\vibe-d-0.9.4\textfilter\", "E:\Server\dpackage\vibe-d-0.9.4\tls\", "E:\Server\dpackage\openssl-1.1.6_1.0.1g\", "E:\Server\dpackage\vibe-d-0.9.4\mail\", "E:\Server\dpackage\vibe-d-0.9.4\mongodb\", "E:\Server\dpackage\vibe-d-0.9.4\redis\", "E:\Server\dpackage\vibe-d-0.9.4\web\", "E:\Server\dpackage\ddbc-0.5.3\source\"] {"code":-32603,"data":"std.socket.SocketOSException@std\socket.d(2857): Unable to connect socket: 由于目标计算机积极拒绝,无法连接。\n\n0x000000013FA8DFAD\n0x000000013FA8DD26\n0x000000013FA8ACE0\n0x000000013FA6490A\n0x000000013FA4E116\n0x000000013FA07621\n0x000000013FA0783E\n0x000000013FA07C5D\n0x000000013F74686B\n0x000000013FA4F6D1\n0x000000013FA4F86B\n0x000000013FA72428\n0x000000013FA9C052\n0x00000000772C556D in BaseThreadInitThunk\n0x000000007742372D in RtlUserThreadStart","message":"Unable to connect socket: 由于目标计算机积极拒绝,无法连接。"} [Error - 下午12:31:44] Request textDocument/hover failed. Message: Unable to connect socket: 由于目标计算机积极拒绝,无法连接。 Code: -32603 std.socket.SocketOSException@std\socket.d(2857): Unable to connect socket: 由于目标计算机积极拒绝,无法连接。

0x000000013FA8DFAD 0x000000013FA8DD26 0x000000013FA8ACE0 0x000000013FA6490A 0x000000013FA4E116 0x000000013FA07621 0x000000013FA0783E 0x000000013FA07C5D 0x000000013F74686B 0x000000013FA4F6D1 0x000000013FA4F86B 0x000000013FA72428 0x000000013FA9C052 0x00000000772C556D in BaseThreadInitThunk 0x000000007742372D in RtlUserThreadStart 2022-01-03T12:31:46.701 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.1\workspace-d\source\workspaced\com\dcd.d:239:lambda15 DCD-Server stopped with code -1073741819 2022-01-03T12:31:46.701 [info] C:\Users\runneradmin\AppData\Local\dub\packages\workspace-d-3.6.1\workspace-d\source\workspaced\com\dcd.d:242:lambda15 Broadcasting dcd server crash. 2022-01-03T12:31:48.734 [info] source\served\extension.d:908:startDCDServer Imports for d:\DataHub\GitLabStats: ["d:\DataHub\GitLabStats\source\", "E:\Server\dpackage\vibe-d-0.9.4\source\", "E:\Server\dpackage\vibe-d-0.9.4\crypto\", "E:\Server\dpackage\mir-linux-kernel-1.0.1\source\", "E:\Server\dpackage\vibe-core-1.22.0\source\", "E:\Server\dpackage\eventcore-0.9.20\source\", "E:\Server\dpackage\taggedalgebraic-0.11.22\source\", "E:\Server\dpackage\stdx-allocator-2.77.5\source\", "E:\Server\dpackage\vibe-d-0.9.4\data\", "E:\Server\dpackage\vibe-d-0.9.4\utils\", "E:\Server\dpackage\vibe-d-0.9.4\http\", "E:\Server\dpackage\diet-ng-1.8.0\source\", "E:\Server\dpackage\vibe-d-0.9.4\inet\", "E:\Server\dpackage\vibe-d-0.9.4\stream\", "E:\Server\dpackage\vibe-d-0.9.4\textfilter\", "E:\Server\dpackage\vibe-d-0.9.4\tls\", "E:\Server\dpackage\openssl-1.1.6_1.0.1g\", "E:\Server\dpackage\vibe-d-0.9.4\mail\", "E:\Server\dpackage\vibe-d-0.9.4\mongodb\", "E:\Server\dpackage\vibe-d-0.9.4\redis\", "E:\Server\dpackage\vibe-d-0.9.4\web\", "E:\Server\dpackage\ddbc-0.5.3\source\"]

vanceism7 commented 2 years ago

I'm also getting basically this same exact error. Im on Windows 10. Same error code: -1073741819

WebFreak001 commented 2 years ago

some DUB libraries or user code can cause this (there are some stack overflow errors when using too-nested static if / else if / else if / ...

ddbc is a known cause for this.

vanceism7 commented 2 years ago

Ah that makes sense. It started happening to me after I installed the hibernated package, probably because I don't actually have the driver libs installed. Thanks for the explanation

WebFreak001 commented 2 years ago

no, it's actually because of how some code is structured, which crashes DCD due it going out of memory when iterating over its tree representation due to the large call stack. Installing things won't fix this, we need to flatten the AST tree in libdparse somewhat to better fix this, or just throw more memory at it, which is imo not a great solution (when doubling memory usage it will just break again when the code size of the problematic area is doubled)

vanceism7 commented 2 years ago

Yea lol, just realized I did end up having those dependencies installed and my code started compiling and running, but the dcd was still crashing.

we need to flatten the AST tree

Sounds like a doozy lol