-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Repeated 'Error: "toString()" failed' on launch. #1818
Comments
@rivermont The stack trace doesn't point to anything in the GitHub Desktop source code, so let's see if we can get a repro together.
So on launch there's a good chance that it's doing a fetch against the repository. Does that sound like what you're seeing?
We shouldn't be doing a push unless it's user-initiated. You should be able to open the Dev Tools before you quit the app - anything interesting in there? |
I believe, from looking at this stack trace, that we're dealing with reading of data from a git shell command. Looking at your repositories they themselves doesn't seem to be of a size that would cause any problems. Is there any chance you have a large file lying in one of the repositories? Committed or otherwise? |
@shiftkey How can I open the developer tools window? I have maybe 10 seconds on launch before crash. @niik There are some possibly troublesome files in my spidy folder:
but they've been bigger and it's never had a problem with them before. I haven't touched the other repo - which *is actually https://github.com/rivermont/instagram-graph - in a while and it's pretty small. |
@niik nice call on the Git shell output being to blame! @rivermont Node processes set a limit on the output it will accept - we're setting it to 10MB currently by default whenever we invoke Git but clearly there's some places where this still isn't enough. Looking at the published repository, I see |
Thanks guys! So moving the large files out of the folder before starting Desktop allowed it to sync properly. I could then place the files back in and it could process them. It seems that one needs to do this after restarting or force-quitting Desktop; once launched it can be opened just fine. |
Thank you so much for confirming the theory @rivermont. I'm gonna keep this issue open for a little bit as we try to get to the bottom of what's happening.
@shiftkey I don't understand why that limit would produce this particular error though. Reading through some issues online it seems to me that the most likely cause of this particular error is us hitting the maximum string length as defined by V8 (256mb). Our stdout buffer cap should kick in way before that and I wouldn't expect it to throw this particular error either. In trying to reproduce this I intentionally triggered the max stdout buffer case and got this error which is what I would expect. (Note that the fact that we're not catching this is pretty terrible in itself but it's not directly related to the stack provided by @rivermont) I think this is related to #1524 @rivermont I'd really like to be able to reproduce this but so far I haven't been able to. Is there anything else you can tell us about your environment? How's your memory consumption? Are you running close to your maximum memory? Would you be willing to zip up your entire repository with the offending files and let me have a look at it? I imagine since you're mostly dealing with textual content that they'd compress fairly well. We can arrange for you to send it to us privately if that would help. |
@niik yeah, the stack trace is very different to our typical error handling for the process output - I've not dug into recreating this yet but this thread from Node core does feel relevant nodejs/node#3175 |
Here is a screencast of the crash in action, along with Task Manager watching: It seems that if anything I'm running out of CPU power first; it stops before memory usage climbs above 60%, around 30% at idle. |
@rivermont if you still have the repository in that weird state, could you open it in a To get the number of lines in the file:
To get the total size (in bytes) of the file:
This will help give an idea of the file we need to recreate to trigger this issue. |
Your first command (run both in Powershell and vanilla command prompt) gave me a I am going to try some tests with files of different sizes using |
It seems that the problem is not with the file size but with the contents of the file...?
has no effect. GitHub Desktop will launch just fine. I tried to upload |
Update: |
@rivermont thanks for the link. I'll try it out here and see if I can get the same issue.
I'm seeing the same thing here. Very interesting... |
Running this up against a debug version of Node 7.4 (the one that ships with Electron) I can get a similar error by just reading the contents of the file:
That's this code. It's following the EDIT: looks like we're deep into node_buffer.cc to fix this. Tweaking this to drop the
I'm trying to get VS to break into |
So I've nailed this down to the file contents and how we handle this in the app. To begin with, let's just read the file in using
Changing this up to use
For reference, on MacOS this problem file is detected as binary:
I've traced this behaviour through to
As this isn't doing any encoding detection, and just failing quietly when it encounters the corrupted bytes, we have a couple of options:
|
For reference, I was able to trigger #1524 just now on macOS using this file. So at least we know these are inter-related... |
I've mirrored the problem file on Dropbox for those who want to play around with it in the app with the |
It seems like this is something we'll have to do eventually anyways, to support different encodings (cc #1607). So I'd certainly lean towards this. |
@joshaber yeah, that's the way I'm heading right now to make the crashes go away sooner 😛 |
Description
As of yesterday, whenever I try to open Desktop, it tries to sync and then crashes.
Version
GitHub Desktop version:
Unknown - (Latest I think?)
OS version:
Windows 10 (Home), Version 1703, Build 15063.296
Steps to Reproduce
I have two repos cloned in Desktop; https://github.com/rivermont/spidy and https://github.com/rivermont/instagram-graph.
It opens to spidy, and it appears that there is a push that it never manages to send before crashing.
Expected behaviour:
Open GitHub Desktop without problems.
Actual behaviour:
After opening, Desktop tries to sync and then crashes.
Reproduces how often:
100% of the time.
Attempted Debugging
Update.exe
from\AppData\Local\GitHubDesktop\
###Logs
Crash Report
Displayed in a nice red box with a single
Quit
button:Crash Logs
Stolen from
\AppData\Roaming\GitHub Desktop\logs\
:The text was updated successfully, but these errors were encountered: