-
Notifications
You must be signed in to change notification settings - Fork 12.8k
[2.8.0-rc] Segfault when running compiler with --d or --watch (out of memory) #22826
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
Comments
Correction - it actually fails with 2.8.0-dev.20180216 as well, but now, it just takes forever for the initial compilation with |
The application does a heavy use of mixins if that matters. |
Potentially a duplicate of #21140, but @sheetalkamat can you take a look? |
@samuraijack can you please share your project so i can repro and investigate this. So far we haven't gotten repro on this issue so its hard to predict without looking at it what might be going wrong. Thanks. |
@sheetalkamat Ok, I'll prepare the reproducible test case, on Monday already.. |
Unfortunately, preparing a test case is not easy - I can't share the code. But you should check the code, that performs the initial compilation during |
I've seen this too. |
Nope, we don't use cnpm. I believe its some algorithm with quadratic behavior in "watch" compilation mode. At certain project size it becomes noticeable and process crashes with OOM. @sheetalkamat To reproduce this, you could try to generate huge dummy project, based on the template like:
The idea is that |
@samuraijack can you try the nightly build that would be published tonight and see if it still repros for you. I have been playing around with various number of files with the contents from the files you shared and it seem to be comparable:
Without watch:
I got OOM for 20000 files with and without --watch option and works for both modes with 5000 files. |
Tried with 2.9.0-dev.20180329 - no changes, did you mean 2.9.0-dev.20180330 perhaps? I have only 54 TS files. The internal typing references are a lot more complex than in the example I posted of course.. |
Tried with 2.9.0-dev.20180330 - no change. |
@sheetalkamat I'm happy to do a screenshare session at your convenience if that is possible. |
@samura Are you still able to repro this issue with typescript@next? If yes, can you please check if you see this when you run tsc --d (ensure emit is not disabled)? I am guessing this has to do with the declaration emit (which is used to build incrementally in watch mode) but would like to confirm that. Thank you. |
wrong username? I'm not @samuraijack |
@sheetalkamat Tried with 3.0.0-dev.20180626 - seems there's no difference, I see
And then nothing. |
Sorry about that.
Were you able to check if this repros when emit is not disabled and emitting declarations? |
@sheetalkamat How do you mean? Some particular command line switch? I'm just launching |
@samuraijack run it as |
Seems like this is extremely nontrivial to fix. @weswigham may have some time to review this. |
Any updates on this? Still present in 3.1.6 |
Hello,
I was using 2.8.0-dev-20180216 and recently switched to 2.8.0-rc. I immediately noticed, that, when launching compiler with
--watch
it started to take a lot longer for the initial compilation. The subsequent compilations on file change were working fine.But now, after some code refactoring, launching with
--watch
segfaults with out of memory error (after a long wait). Running w/o--watch
works just fine (and fast enough).So there's definitely some regression related to the initial compilation of the project in
--watch
mode.Here's an output from the shell session. Note, how compilation w/o
--watch
worked fine (3rd command):The text was updated successfully, but these errors were encountered: