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

Terminal process terminates during build task when output is too large #51163

Closed
joemm1 opened this issue Jun 5, 2018 · 10 comments
Closed

Terminal process terminates during build task when output is too large #51163

joemm1 opened this issue Jun 5, 2018 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities *not-reproducible Issue cannot be reproduced by VS Code Team member as described tasks Task system issues terminal General terminal issues that don't fall under another label upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@joemm1
Copy link

joemm1 commented Jun 5, 2018

If I hook up a build task to build my project then it causes the build terminal to exit with "The terminal process terminated with exit code: 1". This seems to be because the output is too long.

If I change build flags to reduce the size of the output then the problem goes away. Similarly, if I reduce the size of "terminal.integrated.scrollback" it seems to happen less.

(Of course both of these workarounds are not ideal).

The exact same build command run in a terminal window inside Visual Studio Code has no such problems.

Thanks in advance. Let me know if there's anything I can provide to help.
Joe

@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Jun 5, 2018
@Tyriar Tyriar assigned dbaeumer and unassigned Tyriar Jun 6, 2018
@Tyriar Tyriar added tasks Task system issues and removed terminal General terminal issues that don't fall under another label labels Jun 6, 2018
@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Jun 6, 2018
@dbaeumer
Copy link
Member

dbaeumer commented Jun 6, 2018

@joemm1 can you please provide me with a GitHub repository I can clone that demos this.

@joemm1
Copy link
Author

joemm1 commented Jun 6, 2018

It happens in an empty workspace if I eg just create a task to echo incrementing digits:

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "echo",
			"type": "shell",
			"command": "for i in `seq 1 10000`; do echo $i; done",
			"group": {
				"kind": "build",
				"isDefault": true
			}
		}
	]
}

If I run that multiple times it gives up at varying points but always before 6000.

This is with "terminal.integrated.scrollback": 50000. If I reduce my scrollback size to 1000 it completes fine.

Whereas if I run that command directly from the integrated terminal, it completes fine whatever the scrollback size.

Thanks,
Joe

@joemm1
Copy link
Author

joemm1 commented Jun 6, 2018

(Note this is on macOS)

@dbaeumer
Copy link
Member

dbaeumer commented Jun 7, 2018

@Tyriar can you please have a look. I don't do anything special in this case. Simply launching a terminal with the command passed with -c. This seems to be related to terminal.integrated.scrollback and it works fine for a value of 1000.

@dbaeumer dbaeumer assigned Tyriar and unassigned dbaeumer Jun 7, 2018
@dbaeumer dbaeumer added terminal General terminal issues that don't fall under another label and removed info-needed Issue requires more information from poster labels Jun 7, 2018
@Tyriar
Copy link
Member

Tyriar commented Jun 9, 2018

I had a look, it's an interesting bug which I don't fully understand. The process should run completely independently of the UI and it's the UI which appears to be affecting the process. It repro's far less with large scrollbacks when the buffer is full (which means no HTML layouts need to happen to adjust the scroll bar - this slows down the UI significantly).

My current guess is it's a race condition related to microsoft/node-pty#85?

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Jun 9, 2018
@Tyriar Tyriar added this to the Backlog milestone Jun 9, 2018
@Tyriar Tyriar added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Sep 17, 2018
@tksuoran
Copy link

tksuoran commented Nov 2, 2018

The issue has become more serious recently. I use tasks which cat (or sed) files to terminal, and that gets parsed to problems. Now that output is truncated, effectively for all such tasks, as result not all problems get parsed to Problems window.

Issue name is not quite accurate as is:

  • Terminal output truncation issue is not specific to build tasks.
  • Output from my tasks is not very large. Even small file (30 lines) output gets truncated. I only get 19 complete lines, and only half of 20th line can be seen in terminal window.

It is possibly my issue is different, but my original issue #51844 was considered a duplicate and locked so I am reporting here for now.

@Tyriar
Copy link
Member

Tyriar commented Oct 8, 2019

Seems to be fixed?

@Tyriar Tyriar added the *not-reproducible Issue cannot be reproduced by VS Code Team member as described label Oct 8, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 8, 2019

We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our issue reporting guidelines might help you with that.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Oct 8, 2019
@x432ph
Copy link

x432ph commented Nov 4, 2019

I still have this problem in vscode 1.39.2.

If my task executes a program that prints many numbers to the console (e.g. numbers from 0 to 4999), then the output in the built in console will sometimes (not always!) stop too soon, sometimes after 4000, sometimes even before 2000.

If I execute the same program in my normal console on my system, instead of in the integrated vscode terminal, then this problem never occurs, so it's not a bug in my program.

I tested this under Debian 11.

@x432ph
Copy link

x432ph commented Nov 4, 2019

Screenshot from 2019-11-04 16-56-31

As you can see in this screenshot, even if this bug occurs, the bold text Press any key to close the terminal. still appears after the output cuts off. Maybe this information is useful to track down the location of the bug?

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities *not-reproducible Issue cannot be reproduced by VS Code Team member as described tasks Task system issues terminal General terminal issues that don't fall under another label upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

5 participants