microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.28k stars 29.31k forks source link

Crash when running overnight #508

Closed Tyriar closed 8 years ago

Tyriar commented 8 years ago

Ubuntu 12.04, VSCode 0.10.1

Several times VS Code has become unresponsive overnight on the above configuration (locked). Here is the program output:

$ code .
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

<--- Last few GCs --->

173527197 ms: Scavenge 1397.0 (1457.6) -> 1397.0 (1457.6) MB, 1.8 / 0 ms [allocation failure] [incremental marking delaying mark-sweep].
173527199 ms: Scavenge 1397.0 (1457.6) -> 1397.0 (1457.6) MB, 1.9 / 0 ms [allocation failure] [incremental marking delaying mark-sweep].
173529040 ms: Mark-sweep 1397.0 (1457.6) -> 1396.9 (1457.6) MB, 1841.7 / 98 ms [last resort gc].
173530775 ms: Mark-sweep 1396.9 (1457.6) -> 1396.1 (1457.6) MB, 1735.0 / 5 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x8a48933a859 <String[7]: file://>
    1: _completed [file:////home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.main.js:~1544] [pc=0x23ff9b465433] (this=0x1a37262790b1 <JS Object>,e=0x1cd36e9041b9 <undefined>)
    2: arguments adaptor frame: 0->1
    6: bound  [native v8natives.js:1208] [pc=0x23ff99a26270] (this=0x8a489346089 <JS Global Object>)

==== Details =============================...

Failed to get crash dump id.
Report Id: 
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: channel closed
    at process.target.send (internal/child_process.js:509:16)
    at Console.console.error (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/bootstrap.js:5:937)
    at process.<anonymous> (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/bootstrap.js:5:1340)
    at emitOne (events.js:77:13)
    at process.emit (events.js:169:7)
    at process._fatalException (node.js:223:26)
[VS Code]: detected unresponsive

This has never occurred with Atom.

gwynjudd commented 8 years ago

@bpasero I had enabled salsa and left it running over the weekend. This morning it had crashed.

nojvek commented 8 years ago

Installed typescript

$ npm install -g typescript@next
C:\Users\mapatel\AppData\Roaming\npm\tsserver -> C:\Users\mapatel\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
C:\Users\mapatel\AppData\Roaming\npm\tsc -> C:\Users\mapatel\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\mapatel\AppData\Roaming\npm

I've set settings.json to be

{
    "typescript.tsdk": "C:/Users/mapatel/AppData/Roaming/npm/node_modules/typescript/lib"
}

and the environment setting

$ setx VSCODE_TSJS 1

SUCCESS: Specified value was saved.

I don't still see salsa in the footer of VS code insider.

gwynjudd commented 8 years ago

@nojvek I did basically what you did, and I do see Salsa in the footer, but only when a .js file is open and visible in the editor

bpasero commented 8 years ago

@gwynjudd I assume you got the crash dialog and now with 0.10.8 out were able to reopen the window?

gwynjudd commented 8 years ago

@bpasero yes I got the new crash dialog and could restart

Gwyn Judd

-------- Original message -------- From: Benjamin Pasero Date:02/09/2016 19:13 (GMT+12:00) To: Microsoft/vscode Cc: Gwyn Judd Subject: Re: [vscode] Crash when running overnight (#508)

@gwynjuddhttps://github.com/gwynjudd I assume you got the crash dialog and now with 0.10.8 out were able to reopen the window?

Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/vscode/issues/508#issuecomment-181726111.

bpasero commented 8 years ago

@gwynjudd is this a JS only workspace or other file types like PHP included?

gwynjudd commented 8 years ago

@bpasero there are many file types including typescript, java script, css, less, aspx, cs

Gwyn Judd

-------- Original message -------- From: Benjamin Pasero Date:02/09/2016 22:49 (GMT+12:00) To: Microsoft/vscode Cc: Gwyn Judd Subject: Re: [vscode] Crash when running overnight (#508)

@gwynjuddhttps://github.com/gwynjudd is this a JS only workspace or other file types like PHP included?

Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/vscode/issues/508#issuecomment-181786273.

gwynjudd commented 8 years ago

With the new build it has crashed each morning when leaving it running overnight. I have only these extensions installed (in the new build, in the release build I had different extensions):

image

gwynjudd commented 8 years ago

This morning when I came into work, it hadn't crashed. I didn't do anything different before I left work on friday.

bpasero commented 8 years ago

Should try to reproduce with the Chromium workspace using Ubuntu as it seems @Tyriar had a setup like that when it happened.

Tyriar commented 8 years ago

Follow instructions here to get the code https://www.chromium.org/developers/how-tos/get-the-code

cwadrupldijjit commented 8 years ago

I've also noticed a lag in Code after some time using it, and eventual crashes. I've noticed that when it gets laggy, I am able to get it to run smoother if I press F1 and type in 'Reload Window'. That seems to clear up the issue for the moment and then I am able to work around it for now. I'm definitely interested to see this fixed.

From reading through this thread, I'm also guessing it's due to the render process, though I haven't done any testing with it, and it seems to happen regardless of the amount of working files in the list in the explorer panel, whether or not a file is open when Code is loaded, perhaps the sizes of the files currently being worked on, and I'm not sure if it has anything to do with the git diff checker or not, but I doubt it would be the culprit.

I'm also on Mac OS X El Capitan 10.11.3 and hadn't really seen the issue on Windows when I've used it at home, but I don't have a humongous working tree for any projects at home, only the massive folder I work from at work.

bpasero commented 8 years ago

I would hope that both issues are related but I fear that they might not: Most people here see Code crashing when leaving it running without any user interaction, which seems very suspicious. Getting Code to eventually crash with an out of memory exception while using it for a long time might be caused by other memory leaks though. Ideally both issues are the same :)

cwadrupldijjit commented 8 years ago

Technically, it seems to slow and crash even if I am not using it, too, but I'm not sure if they also experience the same, in that case. Either way, the symptoms seem similar at the least. If it's found that my issue isn't related, I could create a separate issue instead.

bpasero commented 8 years ago

@cwadrupldijjit if you see the issue with crashing overnight it would be helpful to get access to the workspace if possible.

cwadrupldijjit commented 8 years ago

I'll see what I can do. I usually put the mac to sleep at night, so nothing happens during that time. I'll try keeping it on at night and let you know in the morning if something happens. I'll also keep you posted on if you can access my workspace.

bpasero commented 8 years ago

Sounds good, thanks!

cwadrupldijjit commented 8 years ago

K. So I left the instance of code running overnight, and didn't have a problem with it crashing or feeling immediately laggy. I continued work today, and even took a tiny bit of a break from using it while doing other things, and it started to be laggy again. It almost seems that maybe the problem isn't from actively using it, but it also sounds like something else triggered it during the time I've been working on it.

I'll run the profiler to keep my eye on it, and I'll create a new issue if there are other findings different than those explained above.

I haven't checked to see if you can have access to my workspace, though I'd suspect I can't share that with you, unfortunately.

cwadrupldijjit commented 8 years ago

I tried to run the profiler yesterday when it was getting particularly slow and when I was taking a heap snapshot, the computer maxed out of available RAM, and I could hardly do anything at all, not even force close Code, so I had to restart the computer. I'll try to run it sooner than I had before to avoid that happening again.

This is a little off-topic, but you posted the link for the insiders build, which I visited. I wanted to download the windows version (as I use that at home), and whenever I try to get to that link, it redirects first to the usual download page, but then promptly redirects me to the main page without initiating a download. In fact, it overwrites the history for the download page I was on, so I can't even go back in history to get to it. Is there any other way I could get the insiders build?

egamma commented 8 years ago

@cwadrupldijjit

This is a little off-topic, but you posted the link for the insiders build, which I visited. I wanted to download the windows version (as I use that at home), and whenever I try to get to that link, it redirects first to the usual download page, but then promptly redirects me to the main page without initiating a download.

Sorry about this, but some users reported some strange issue on the insiders build and we temporarily took it down until we understand this issue.

cwadrupldijjit commented 8 years ago

@egamma I wondered if it might have been inaccessible because of that. I'll keep an eye out for when it works, then.

bpasero commented 8 years ago

@Tyriar I tried the chromium workspace over night on Linux, Windows and Mac and could not reproduce a crash. Could you try it again please?

ZombieProtectionAgency commented 8 years ago

I am not sure if this is related but I have noticed that VS Code tends to crash during my work day if I open it and forget about it for awhile. I am at work for 11 hours and I generally open code first thing in the morning. At some point during the day my computer will slow down and start hanging until either it crashes or I force-kill it.

Just in case it might help...

The primary project I have open in VS Code is a relatively unmodified version of a shopping cart called BVCart (version 2004.7). I have around 25-30 working files right now and even just opening VS Code and not touching it all day leads to a crash.

The project is 1836 files and 130 folders totaling around 35MB and it is contained in a small git repository.

bpasero commented 8 years ago

@ZombieProtectionAgency is it possible to share this workspace with me?

ZombieProtectionAgency commented 8 years ago

@bpasero Sorry, I definitely couldn't share it :( I haven't looked but you might be able to find it online somewhere. It is just a mostly-flat old-fashioned ASP VB.Net shopping cart. The large majority of the files are .vb with aspx, ascx, and a small handful of css files.

ritcoder commented 8 years ago

I'm having the exact same error. VS Code just crashes every few minutes. I'm using it with elm. It does not clash when it is left on. It clashes within minutes after I start ending the file. It has been like this for the past three days making VS Code unusable. How do I check what is going on? I'm using version 0.10.10.

bpasero commented 8 years ago

Another thought I had: We do have a service that can receive output from various end points (git, tasks, extensions) and this is something that can happen in the background and add up. We did quite some fixes in this area for GA that are not in previous releases.

If anyone with overnight crashes could just briefly check if there is any output logged from the background? You can see that from View > Toggle Output and then switching through the channels from the dropdown.

gushie commented 8 years ago

@bpasero In the 'Tasks' output I'm just seeing output I would expect from my own compile task. In the 'Git' output I'm seeing a fair few git fetch's, interspersed with a few git show's. I'm not sure how frequently though as there isn't a time stamp. No other output though.

bpasero commented 8 years ago

We do auto fetch every now and then but the main output you see there is probably from the work you do within VS Code. Would be interesting if the output adds up when VS Code is in the background. Is the task running constantly or only when you explicitly invoke the compile task?

gushie commented 8 years ago

The task is just when I ctrl+shift+B and ends shortly thereafter. I've had crashes however when I haven't run a task.

I get two identical git show's when I switch between files and yes the git fetch's occur automatically once every couple of minutes.

Note that I don't do any checkouts etc within VSCode, I use SourceTree for all git related tasks.

gwynjudd commented 8 years ago

@bpasero I will leave the output window up today and see if anything appears. Currently it has been open for an hour or so of normal use and I don't see anything in the tasks or git views. We do not use git, so I wouldn't expect to see anything in that as a general rule.

bpasero commented 8 years ago

Our latest insiders build is out and I would appreciate if people could give it a try on this issue: https://code.visualstudio.com/insiders

gwynjudd commented 8 years ago

@bpasero I still had the previous insiders build, can I just run that and do "check for updates", or do I have to update the build from the link you gave?

nojvek commented 8 years ago

Will try and get back to you. To be honest I am seeing less of the VSCode crashes nowadays. Atleast it doesn't crash everyday.

I can make it crash by openening a huge file with million plus lines minified js and scrolling up and down repeatedly. But I know what is pushing the limits of editor.

Whatever you have been adding as magic sauce is working for me.

On Wed, Mar 16, 2016 at 12:29 PM, Benjamin Pasero notifications@github.com wrote:

Our latest insiders build is out and I would appreciate if people could give it a try on this issue: https://code.visualstudio.com/insiders

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Microsoft/vscode/issues/508#issuecomment-197503185

bpasero commented 8 years ago

@gwynjudd you should be able to update if the VS Code logo shows up as green logo:

image

bpasero commented 8 years ago

@nojvek yes that is pushing the limits a bit. for the march release we did explicit memory testing to find areas where we can improve. the insiders build includes some of those fixes (not all, we did some changes yesterday and today that are not yet in). so just curious if it makes any difference for people that see this...

gwynjudd commented 8 years ago

@bpasero thanks I've done that and I'll let you know how it goes

gwynjudd commented 8 years ago

@bpasero still got the same crash overnight with the march insiders build. Do you want me to to try getting a heap dump from the developer tools during normal use? I can try to keep an eye on the memory usage for code and grab a dump if it appears to be going up

bpasero commented 8 years ago

Yes please, thanks.

gwynjudd commented 8 years ago

Here is a heap snapshot immediately after launching code (memory usage about 100MB at that time)

Heap-20160318T115937.zip

I'll try again in an hour or two. The tricky bit seems to be getting it at a point where the memory has increased somewhat, but not so much that taking the snapshot triggers it to crash out of memory.

cwadrupldijjit commented 8 years ago

I saw the same kind of results when I tried taking a heap snapshot (ran out of memory), and it’s not fun.

I feel like there are still some memory issues in the latest insiders build (for mac).  I’ll see if I can get another heap snapshot without sacrificing my computer.

gwynjudd commented 8 years ago

@bpasero sorry I haven't been able to successfully get a heap snapshot yet. Either the memory is very low such as for the one I captured before, or it jumps up to say around 500MB or more and grabbing the snapshot triggers a crash.

vincent-ly commented 8 years ago

I have to restart vscode 1-2 times a day because the memory usage climbs over 1GB and things start feeling sluggish. It's using the amount of memory that a full blown IDE would, so there's definitely some leak going on.

bpasero commented 8 years ago

@vincent-ly can you share more details about the workspace you see this with?

vincent-ly commented 8 years ago

@bpasero There are about 30-40 js/scss/html files that uses a couple of bower components with gulp (without the vscode task runner). I work with 2 editor panes and frequently use the file search, pretty standard. The memory usage is under 100mb on startup, but builds up over time, even when minimized.

Does intellisense play a factor? I have Angular and jQuery type definitions installed.

bpasero commented 8 years ago

You can try our insider build where we worked on reduced memory pressure to see if that makes it better: http://code.visualstudio.com/download?insiders=true

Do you have extensions installed?

vincent-ly commented 8 years ago

@bpasero Just angular snippets https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular1

I'll try the insider build and report back, thanks!

alanwright commented 8 years ago

+1

Seeing the same issue on VSCode for Windows 0.10.11. It typically crashes every night consistently when not in use. Given steps to collect info I'd be glad to help.

Running on a TypeScript git repo with 28,438 Files, 4,812 Folders. Has gulp watchers as well, with many TypeSript defs.

I have the following extensions installed:

bpasero commented 8 years ago

@alanwright could you try if it still reproduces with our latest insider build (http://code.visualstudio.com/Download#insiders). If so, can you share the workspace with me?

alanwright commented 8 years ago

@bpasero It reproduced over night with insider build. I tried in both our private larger enlistment and our open source enlistment, and only the larger private enlistment seemed to cause the problem, which I unfortunately can't share (it is Microsoft internal though so maybe we can get you access? My alias is alanwri)

Is there anything I can do on my machine to capture logs and share with you?

image