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

Large composite project crashes tsserver.js with "Debug Failure. False expression." #26546

Closed
leemhenson opened this issue Aug 20, 2018 · 17 comments
Assignees
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output

Comments

@leemhenson
Copy link

TypeScript Version: 3.1.0-dev.20180818

Search Terms: Debug Failure False Expression

Code

My project contains a single package which is built from:

/src
  /directoryA
  /... 29 other directories
/tests
  /tsconfig.json 
  /directoryA
  /... 29 other directories
/tsconfig.json

Each directory under src has it's own composite tsconfig.json, and they form a DAG. There is also a tsconfig under tests that references each and every directory under src. The root directory contains a tsconfig that references every tsconfig under src and tests.

Expected behavior:

tsc --build should succeed and I should be able to browse the code in vscode without issue.

Actual behavior:

tsc --build succeeds, and I can browse code under src in vscode without issue. However, when I open up a file inside tests, the following error is emitted in the tsserver.log:

Debug Failure. False expression.

    Error: Debug Failure. False expression.
    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29937:26)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30033:49
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30032:20)
    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29957:21)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30033:49
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30032:20)
    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29962:21)
    at mergeModuleAugmentation (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30061:34)
    at initializeTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:54898:25)
    at Object.createTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29781:9)
    at Object.getTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:83198:79)
    at synchronizeHostData (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:111305:21)
    at Object.getProgram (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:111378:13)
    at ConfiguredProject.Project.updateGraphWorker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:115433:53)
    at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:115381:42)
    at ConfiguredProject.updateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:115751:61)
    at ProjectService.addFilesToNonInferredProjectAndUpdateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:116821:25)
    at ProjectService.createConfiguredProject (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:116837:22)
    at ProjectService.openClientFileWithNormalizedPath (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:117243:44)
    at IOSession.Session.openClientFile (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118832:37)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118037:31)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:88
    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119487:28)
    at IOSession.Session.executeCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:33)
    at IOSession.Session.onMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119516:35)
    at Interface.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120770:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
Info 1390 [12:54:10.751] response:
    {"seq":0,"type":"response","command":"open","request_seq":2,"success":false,"message":"Error processing request. Debug Failure. False expression.\nError: Debug Failure. False expression.\n    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29937:26)\n    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30033:49\n    at Map.forEach (<anonymous>)\n    at mergeSymbolTable (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30032:20)\n    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29957:21)\n    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30033:49\n    at Map.forEach (<anonymous>)\n    at mergeSymbolTable (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30032:20)\n    at mergeSymbol (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29962:21)\n    at mergeModuleAugmentation (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:30061:34)\n    at initializeTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:54898:25)\n    at Object.createTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:29781:9)\n    at Object.getTypeChecker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:83198:79)\n    at synchronizeHostData (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:111305:21)\n    at Object.getProgram (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:111378:13)\n    at ConfiguredProject.Project.updateGraphWorker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:115433:53)\n    at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:115381:42)\n    at ConfiguredProject.updateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:115751:61)\n    at ProjectService.addFilesToNonInferredProjectAndUpdateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:116821:25)\n    at ProjectService.createConfiguredProject (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:116837:22)\n    at ProjectService.openClientFileWithNormalizedPath (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:117243:44)\n    at IOSession.Session.openClientFile (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118832:37)\n    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118037:31)\n    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:88\n    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119487:28)\n    at IOSession.Session.executeCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:33)\n    at IOSession.Session.onMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119516:35)\n    at Interface.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120770:27)\n    at emitOne (events.js:116:13)\n    at Interface.emit (events.js:211:7)\n    at Interface._onLine (readline.js:282:10)\n    at Interface._normalWrite (readline.js:424:12)\n    at Socket.ondata (readline.js:141:10)\n    at emitOne (events.js:116:13)\n    at Socket.emit (events.js:211:7)\n    at addChunk (_stream_readable.js:263:12)\n    at readableAddChunk (_stream_readable.js:250:11)\n    at Socket.Readable.push (_stream_readable.js:208:10)\n    at Pipe.onread (net.js:594:20)"}

The typescript process is then dead on that file, not even a Loading... hover. The following process in process explorer seems to be stuck:

electron_node electronForkStart.js tsserver.js
  electron_node typingsInstaller.js tsserver.js typesMap.js
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Aug 20, 2018
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.1 milestone Aug 20, 2018
@RyanCavanaugh
Copy link
Member

@leemhenson we'll likely need a lot more information to be able to fix this; call stacks alone aren't enough for us to root-cause this particular kind of bug. Is there a repo we can look at?

@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Aug 20, 2018
@sheetalkamat
Copy link
Member

Also apart from that you should submit tsserver log to be able to understand the issue.
You can also upload logs using

  1. With "typescript.tsserver.log": "verbose" enabled
  2. Restart vscode or vscode insiders
  3. Reproduce the problem
  4. Run code --upload-logs on the command line (or code-insiders --upload-logs if using vscode insiders) and follow instructions
  5. Share the log file ID

@leemhenson
Copy link
Author

A smidge more data:

$ tsc --diagnostics
Files:           934
Lines:        114371
Nodes:        597497
Identifiers:  222348
Symbols:      357365
Types:        126168
Memory used: 457463K
I/O read:      0.12s
I/O write:     1.01s
Parse time:    3.00s
Bind time:     0.97s
Check time:    6.17s
Emit time:    13.48s
Total time:   23.63s

@sheetalkamat Upload successful! Log file ID: 2797946071

@RyanCavanaugh This project is private so I can't share it, and as you can see from the diagnostics it's pretty big! If the data in the uploaded log files isn't enough to figure out the issue I'll try to recreate it on a smaller scale.

@sheetalkamat
Copy link
Member

@leemhenson From the shared log, nothing stood out. From the log it seems project has 1343 files being added to it (compared to tsc 934 as per your shared data) That's the only thing standing out as such. We would need repro to investigate this and tsserver log is not enough.

@sandersn
Copy link
Member

@leemhenson One option would be for us to sign an NDA, if that would allow us to look at your original code.

@leemhenson
Copy link
Author

I'm a bit snowed under at the moment but I'll try to work up a repro. If not I'll see about the NDA route.

@drew-y
Copy link

drew-y commented Oct 8, 2018

I am also having this problem on a similar project. It's private as well but I'd be more than willing to provide access to the project.

@sandersn
Copy link
Member

sandersn commented Oct 8, 2018

@drew-y Thanks! I'll contact you over e-mail to talk about how to get access.

@DanielRosenwasser DanielRosenwasser added the Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output label Oct 30, 2018
@earthlyreason
Copy link

I have also run into this on a large composite project. The build will work fine one minute then it will get into this state, and reverting my most recent change doesn't restore the build. I will put together a repro case as soon as possible.

In the meantime, I have been able to work around it by doing a clean (removing existing build artifacts) and building again. If that is the case for the OP, it may be a clue. In any case, it may help others hitting this.

@RyanCavanaugh RyanCavanaugh removed the Needs More Info The issue still hasn't been fully clarified label Mar 8, 2019
@wolcotts
Copy link

wolcotts commented May 4, 2019

Here's a 100% repro w/two .ts and three tsconfig files running tsc version 3.4.5. Cmdline: "tsc --build src"

ts_throw_e.zip

@sandersn
Copy link
Member

@wolcotts your error is fixed in typescript@next. It's a duplicate of #30591. However, that code didn't exist when this issue was filed, so I don't think it's the same cause.

@sandersn
Copy link
Member

Looking back at my e-mail, @drew-y's problem was fixed in 3.1.4. It's just @leemhenson's bug that is outstanding. I could be wrong, though, and maybe the code did exist already, so it could in fact be the same issue that @wolcotts saw.

@leemhenson can you test with typescript@next or typescript@rc?

@leemhenson
Copy link
Author

Hey @sandersn, I no longer work at that company so don't have access to that project to test. I'm 99% certain it's the same problem I reported here:

#30429

I just updated the repro project listed there to typescript@next, but that has not helped:

leemhenson/project-refs-oom-repro@97c5491

@sandersn
Copy link
Member

Thanks. You've done a lot of work on this one. I'll close this as a duplicate of #30429 since it looks like the oomemory is the blocker now, not the mergeSymbol assertion.

@zpdDG4gta8XKpMCd
Copy link

we just got bitten by this very issue when we tried to switch to composite builds

@sandersn
Copy link
Member

@zpdDG4gta8XKpMCd Which issue? An assert with a stack ending in mergeSymbol? Or does the build run out of memory?

@zpdDG4gta8XKpMCd
Copy link

zpdDG4gta8XKpMCd commented May 21, 2019

build runs out of memory, no matter how much we give it via node --max_old_space_size=XXXXX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Projects
None yet
Development

No branches or pull requests

9 participants