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

net/http/cgi: don't show black terminal on Windows when CGI is run #23270

Closed
leoxiaoping opened this issue Dec 28, 2017 · 8 comments
Closed

net/http/cgi: don't show black terminal on Windows when CGI is run #23270

leoxiaoping opened this issue Dec 28, 2017 · 8 comments
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@leoxiaoping
Copy link

cgi package in std lib
show balck terminal everytime when use a “cgi.ServeHTTP(ctx.ResponseWriter, ctx.Request)”

@davecheney
Copy link
Contributor

I’m sorry there is not enough information in this issue report to determine if this is a bug in Go.

Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process.

Please see https://golang.org/wiki/Questions for good places to ask questions.

@bradfitz
Copy link
Contributor

I imagine this is a Windows issue where we're not setting some windows flag to suppress the CMD.EXE box when running a child process?

@bradfitz bradfitz reopened this Dec 28, 2017
@as
Copy link
Contributor

as commented Dec 28, 2017

For informational purposes here's a relevant experience I had with this problem:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx

Creating a process with CREATE_NO_WINDOW was a huge rat hole that didn't work, but using the DETACHED_PROCESS flag suppressed conhost.exe/cmd.exe on Windows 7 and Windows 2008R2. Conhost is the text buffer for things that spill into and out of the cmd.exe (this can be verified by changing the screen buffer size in cmd.exe to a large number and then running a command with a lot of output. The conhost.exe process will begin to use up more memory linear to the screen buffer size).

@bradfitz bradfitz changed the title show balck terminal everytime when use cgi net/http/cgi: don't show black terminal on Windows when CGI is run Dec 29, 2017
@bradfitz bradfitz added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows labels Dec 29, 2017
@bradfitz bradfitz added this to the Go1.11 milestone Dec 29, 2017
@bradfitz
Copy link
Contributor

/cc @johnsonj @alexbrainman

@leoxiaoping
Copy link
Author

leoxiaoping commented Dec 29, 2017

I have resolved the issue.

modify the std lib \src\net\http\cgi\host.go

add a new line "cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}" at line 230

then dont forget a rebuild
tim 20171229123324

@as
Copy link
Contributor

as commented Dec 29, 2017

@MiniCase

This doesn't prevent the Window from being created, on this particular Windows machine (2012R2), it just moves the window to an off-screen coordinate.

@alexbrainman
Copy link
Member

I imagine this is a Windows issue where we're not setting some windows flag to suppress the CMD.EXE box when running a child process?

I am not sure we want to do that.

@MiniCase how do I run your program to see the issue you are having? What code do I run? How do I run it?

Thank you.

Alex

@bradfitz
Copy link
Contributor

ETIMEOUT.

@golang golang locked and limited conversation to collaborators May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
None yet
Development

No branches or pull requests

6 participants