Skip to content

Diagnostic keeps breaking since a few releases #423

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

Closed
Yakehira opened this issue Feb 24, 2021 · 14 comments
Closed

Diagnostic keeps breaking since a few releases #423

Yakehira opened this issue Feb 24, 2021 · 14 comments
Labels
bug Something isn't working Info Needed More information is required

Comments

@Yakehira
Copy link

So i don't know when this exactly started, but sometimes after copy/pasting code around the diagnostic produces errors that it thinks are in the code, but are not there. Sometimes i can recover this by selecting all text, cutting it out and back in. Using VSCode 1.53.0. It shows a lot of garbage errors, a lot of . (dot) syntax errors, brackets, wrong globals etc, just parsing the file weirdly.

@sumneko
Copy link
Collaborator

sumneko commented Feb 25, 2021

Is your problem same as this: #398

@Yakehira
Copy link
Author

Don't think so, i can see hover info. I also don't have a good repro, i just wanted to report it as i've seen it happen randomly for a while now :\

@sumneko
Copy link
Collaborator

sumneko commented Feb 25, 2021

@Yakehira
Copy link
Author

Yakehira commented Feb 25, 2021

Here are big logs from 1.16, though I'm not sure if it contains the issue.
service.log
workspace.log

@sumneko
Copy link
Collaborator

sumneko commented Feb 25, 2021

From the log, it seems that it is caused by a stack overflow error in the parser, which is usually due to very deep nesting in the script (for example, a 100-level literal table).
At present, I have no idea to solve this problem, you can only bypass this problem by rewriting your script.

@sumneko sumneko added the bug Something isn't working label Feb 25, 2021
@Yakehira
Copy link
Author

Yakehira commented Feb 26, 2021

But why does this only happen sometimes, and only when i copy paste something? Why is it not breaking all the time if that is the cause, i only had it happen a few times in the past month or so. I can't even repro is on purpose, if i copy paste stuff around it refuses to break ^^ What i noticed though the Diagnostic seems pretty slow if a lot of files are loaded into workspace, is it crawling through the entire tree of all loaded files even though you are only editing your current file?

@sumneko
Copy link
Collaborator

sumneko commented Mar 5, 2021

I took a look again, and it seems that the two log files are from different projects:

service.log : shows you opened a single file without workspace, then you opened some other files. Since I forgot to record the file name where the compilation error occurred, I can only guess that the error file is GamePedia/demofile.lua based on the context.
workspace.log: shows you opened a workspace Addons , and there is no compilation error.

Which log does the problem you encounter come from?

@Yakehira
Copy link
Author

Yakehira commented Mar 5, 2021

Oh, sorry. It was in my workspace, the 'demofile.lua' was a new emmy testing file, but the issue i experienced has been present for 2 months or longer or so? It happend really infrequently and can't reproduce it on purpose. I can update this issue with a new log when it happens again and also take a screenshot.

@sumneko
Copy link
Collaborator

sumneko commented Mar 5, 2021

May have been fixed, see #398

@sumneko sumneko added the Info Needed More information is required label Mar 5, 2021
@Yakehira
Copy link
Author

Yakehira commented Mar 5, 2021

You can close or keep issue open. If i run into the problem again i will update.

@Yakehira
Copy link
Author

Yakehira commented Mar 10, 2021

I've run into it again, it just randomly broke editing. There is no error in output. The small Lua text in statusbar has a continous spinning circle that doesn't stop. F2 to rename also does not work anymore after this issue.
image
image

Only noteworthy info in log appears to be this at the end of log.

[19:41:06.100][warn] [#0:script.files:399]: Compile [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/sharedxml/anchorutil.lua] takes [0.110] sec, size [9.922] kb.
[19:41:06.210][warn] [#0:script.files:399]: Compile [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/addons/blizzard_compactraidframes/blizzard_compactraidframemanager.lua] takes [0.104] sec, size [31.671] kb.
[19:41:07.038][warn] [#0:script.files:399]: Compile [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/addons/blizzard_storeui/blizzard_storeuisecure.lua] takes [0.138] sec, size [203.325] kb.
[19:41:08.647][warn] [#0:script.files:399]: Compile [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/addons/blizzard_calendar/blizzard_calendar.lua] takes [0.123] sec, size [202.862] kb.
[19:41:09.225][warn] [#0:script.files:409]: Parse LuaDoc of [file:///c%3a/games/addondevelopment/api/globalfunctions.lua] takes [0.244] sec, size [534.388] kb.
[19:41:10.350][warn] [#0:script.files:399]: Compile [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/framexml/uiparent.lua] takes [0.119] sec, size [197.486] kb.
[19:41:11.632][warn] [#0:script.files:399]: Compile [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/addons/blizzard_achievementui/blizzard_achievementui.lua] takes [0.546] sec, size [141.300] kb.
[19:41:14.038][warn] [#0:script.files:409]: Parse LuaDoc of [file:///c%3a/games/addondevelopment/blizzardinterfacecode/interface/wow-ui-source/addons/blizzard_artifactui/blizzard_artifactui.lua] takes [0.353] sec, size [10.514] kb.
[19:41:16.772][warn] [#0:script.await:175]: [fire]Await step takes [10.782] sec.
stack traceback:
	[C]: in function 'coroutine.yield'
	...de/extensions/sumneko.lua-1.18.1/server/script/await.lua:161: in function 'await.delay'
	...s/sumneko.lua-1.18.1/server/script/vm\guideInterface.lua:105: in field 'cache'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:3132: in function 'parser.guide.getRefCache'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:3179: in function 'parser.guide.searchRefs'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:2413: in function 'parser.guide.searchSameFieldsInValue'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:2834: in function 'parser.guide.checkSameSimple'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:2963: in function 'parser.guide.searchSameFields'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:3201: in function 'parser.guide.searchRefs'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:4202: in function 'parser.guide.inferByDef'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:4635: in function 'parser.guide.searchInfer'
	...nsions/sumneko.lua-1.18.1/server/script/parser\guide.lua:4700: in function 'parser.guide.requestInfer'
	...ensions/sumneko.lua-1.18.1/server/script/vm\getInfer.lua:70: in upvalue 'getInfers'
	...ensions/sumneko.lua-1.18.1/server/script/vm\getInfer.lua:85: in function <...ensions/sumneko.lua-1.18.1/server/script/vm\getInfer.lua:81>
	(...tail calls...)
	...ensions/sumneko.lua-1.18.1/server/script/vm\getInfer.lua:25: in function 'vm.vm.hasInferType'
	...ons/sumneko.lua-1.18.1/server/script/core\hover/init.lua:132: in function 'core.hover.get'
	...ons/sumneko.lua-1.18.1/server/script/core\hover/init.lua:163: in function 'core.hover.byUri'
	...s/sumneko.lua-1.18.1/server/script/provider\provider.lua:300: in function <...s/sumneko.lua-1.18.1/server/script/provider\provider.lua:288>
	[C]: in function 'xpcall'
	...ensions/sumneko.lua-1.18.1/server/script/proto\proto.lua:143: in function <...ensions/sumneko.lua-1.18.1/server/script/proto\proto.lua:122>
[19:41:16.772][debug][#0:script.proto.proto:131]: Method [textDocument/hover] takes [10.786]sec.
[19:41:17.429][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:41:17.429][warn] [#0:script.await:166]: Await step takes [0.641] sec.
[19:41:17.429][debug][#0:script.proto.proto:131]: Method [textDocument/hover] takes [0.648]sec.
[19:41:17.632][warn] [#0:script.await:166]: Await step takes [0.193] sec.
[19:41:17.647][debug][#0:script.proto.proto:131]: Method [textDocument/documentSymbol] takes [0.860]sec.
[19:41:17.647][debug][#0:script.proto.proto:131]: Method [textDocument/documentSymbol] takes [0.857]sec.
[19:41:28.304][warn] [#0:script.await:166]: Await step takes [0.592] sec.
[19:41:41.679][debug][#0:script.proto.proto:131]: Method [textDocument/hover] takes [0.408]sec.
[19:41:42.991][debug][#0:script.service.service:136]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 674.248 MB
        # 00 : 669.169 MB
        # 01 : 0.859 MB
        # 02 : 1.377 MB
        # 03 : 1.467 MB
        # 04 : 1.377 MB
    --------------- Coroutine ---------------
        Total:     3
        Running:   0
        Suspended: 3
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    --------------- Proto ---------------
        Holdon:   1
        Waiting:  0
==============================================
[19:41:44.147][debug][#0:script.proto.proto:131]: Method [textDocument/hover] takes [0.226]sec.
[19:41:49.913][warn] [#0:script.provider.provider:451]: Completion takes 3.017 sec.
[19:41:49.913][debug][#0:script.proto.proto:131]: Method [textDocument/completion] takes [3.019]sec.
[19:41:50.116][warn] [#0:script.provider.provider:451]: Completion takes 0.183 sec.
[19:41:50.210][debug][#0:script.proto.proto:131]: Method [textDocument/didChange] takes [3.315]sec.
[19:41:50.210][debug][#0:script.proto.proto:131]: Method [textDocument/didChange] takes [0.264]sec.
[19:41:50.413][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	7
[19:41:51.694][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	8
[19:41:52.038][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	6
[19:41:54.929][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:42:18.069][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:42:18.507][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:42:19.991][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	2
[19:42:20.335][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:42:42.991][debug][#0:script.service.service:136]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 794.483 MB
        # 00 : 789.404 MB
        # 01 : 0.859 MB
        # 02 : 1.377 MB
        # 03 : 1.467 MB
        # 04 : 1.377 MB
    --------------- Coroutine ---------------
        Total:     30
        Running:   0
        Suspended: 2
        Normal:    0
        Dead:      28
    --------------- Cache ---------------
        Total: 4
        Dead:  3
    --------------- Proto ---------------
        Holdon:   1
        Waiting:  0
==============================================
[19:43:07.397][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:43:07.632][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	1
[19:43:09.429][warn] [#0:script.provider.provider:451]: Completion takes 0.660 sec.
[19:43:09.429][debug][#0:script.proto.proto:131]: Method [textDocument/completion] takes [0.661]sec.
[19:43:09.663][warn] [#0:script.provider.provider:451]: Completion takes 0.209 sec.
[19:43:09.663][debug][#0:script.proto.proto:131]: Method [textDocument/completion] takes [0.210]sec.
[19:43:09.694][debug][#0:script.proto.proto:131]: Method [textDocument/didChange] takes [0.925]sec.
[19:43:09.694][debug][#0:script.proto.proto:131]: Method [textDocument/didChange] takes [0.245]sec.
[19:43:10.132][debug][#0:script.provider.diagnostic:223]: publishDiagnostics	file:///c%3A/Games/AddonDevelopment/Addons/Silence.git/Silence/Silence.lua	3
[19:43:11.679][warn] [#0:script.provider.provider:451]: Completion takes 1.555 sec.
[19:43:11.679][debug][#0:script.proto.proto:131]: Method [textDocument/completion] takes [1.558]sec.
[19:43:11.960][warn] [#0:script.provider.provider:451]: Completion takes 0.241 sec.
[19:43:11.960][debug][#0:script.proto.proto:131]: Method [textDocument/completion] takes [0.243]sec.
[19:44:06.007][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:08.960][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:11.694][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:14.366][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:17.741][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:19.788][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:22.397][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:25.116][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:28.366][warn] [#0:script.parser.guide:29]: Queue too large!
[19:44:30.960][warn] [#0:script.parser.guide:29]: Queue too large!
[19:50:09.335][warn] [#0:script.parser.guide:29]: Queue too large!
[19:50:11.897][warn] [#0:script.parser.guide:29]: Queue too large!

@sumneko
Copy link
Collaborator

sumneko commented Mar 11, 2021

Seems it runs into an endless loop, could you please provide a sample project?

@Yakehira
Copy link
Author

Yakehira commented Mar 11, 2021

Problem is that i can't reproduce it in any project, i don't know the trigger :( All workspaces have in common that they use https://github.com./Gethe/wow-ui-source

When i encounter this issue and reload vscode it works again.

@sumneko
Copy link
Collaborator

sumneko commented Jun 25, 2021

Is this fixed?

@sumneko sumneko closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Info Needed More information is required
Projects
None yet
Development

No branches or pull requests

2 participants