-
Notifications
You must be signed in to change notification settings - Fork 27
Description
I'm still trying to figure out the exact setup for reproducing this, but I can consistently cause the Wake LSP to crash, and then to continue crashing immediately each time it tries to restart; VS Code winds up recognizing this and disabling the extension, which then requires the user to find the invalid code, make the fix, and then reload (while not being given any guidance on what to do from the editor).
Currently my basis of experimentation is changing the localRunner within hashcode into defaultRunner. If I then try to run wake -x Unit (whether with an external wake or with the one built by this same checkout) it gives a reasonable trace, followed by a crash:
$ wake -x Unit
share/wake/lib/system/path.wake:254:[8-15]: definition of 'hashcode@wake' references 'defaultRunner@wake' forming an illegal cyclic value
share/wake/lib/system/job.wake:146:[5-13]: definition of 'runAlways@wake' references 'hashcode@wake' forming an illegal cyclic value
share/wake/lib/system/job.wake:217:[12-20]: definition of 'runJobImp@wake' references 'runAlways@wake' forming an illegal cyclic value
share/wake/lib/system/job.wake:255:[12-21]: definition of 'runJobWith@wake' references 'runJobImp@wake' forming an illegal cyclic value
share/wake/lib/system/io.wake:182:[8-15]: definition of 'writeImp@wake' references 'runJobWith@wake' forming an illegal cyclic value
share/wake/lib/system/io.wake:224:[12-16]: definition of 'write@wake' references 'writeImp@wake' forming an illegal cyclic value
share/wake/lib/system/runner.wake:229:[12-25]: definition of 'makeJSONRunner@wake' references 'write@wake' forming an illegal cyclic value
share/wake/lib/system/runner.wake:181:[12-21]: definition of 'fuseRunner@wake' references 'makeJSONRunner@wake' forming an illegal cyclic value
share/wake/lib/system/runner.wake:188:[12-24]: definition of 'defaultRunner@wake' references 'fuseRunner@wake' forming an illegal cyclic value
Segmentation fault (core dumped)This is a very different result than a more typical recursive definition which does return properly (and is reported successfully by the LSP):
package build_wake
def foo = bar
def bar = foo
$ wake -x Unit
mvp.wake:3:[5-7]: definition of 'foo@build_wake' references 'bar@build_wake' forming an illegal cyclic value
mvp.wake:6:[5-7]: definition of 'bar@build_wake' references 'foo@build_wake' forming an illegal cyclic value
>>> Aborting without execution <<<As I said, I'm still unsure what is causing the difference. The particular reproducer there is suggestive of it involving the Job mechanisms, but even if that does turn out to be the case, we should still try to identify and head off the segfault. More telling, though, is that I encountered very similar crashes while working on a private repo -- admittedly I think they were still rather close to the Runner framework, but not anything which wake itself should be relying on and certainly not the LSP.
I had hoped to have a more minimal reproducer to report, but have been rather distracted these couple weeks and wasn't able to experiment beyond the above; I wanted to at least get that down before I forgot even more over the weekend.