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

syscall: large writes to console fail on Windows #3767

Closed
alexbrainman opened this issue Jun 22, 2012 · 6 comments
Closed

syscall: large writes to console fail on Windows #3767

alexbrainman opened this issue Jun 22, 2012 · 6 comments
Milestone

Comments

@alexbrainman
Copy link
Member

This are the steps to reproduce my problem:

C:\>set GOPATH=C:\a\code

C:\>go get -v -d launchpad.net\goyaml
launchpad.net/goyaml (download)

C:\>cd %GOPATH%\src\launchpad.net\goyaml

C:\a\code\src\launchpad.net\goyaml>

... make small change to decode.go ...

C:\a\code\src\launchpad.net\goyaml>bzr diff
=== modified file 'decode.go'
--- decode.go   2012-03-08 21:50:15 +0000
+++ decode.go   2012-06-22 02:26:31 +0000
@@ -1,6 +1,6 @@
 package goyaml

-// #cgo LDFLAGS: -lm -lpthread
+// #cgo LDFLAGS: -lm
 // #cgo CFLAGS: -I. -DHAVE_CONFIG_H=1
 //
 // #include "helpers.h"


C:\a\code\src\launchpad.net\goyaml>go install -v
launchpad.net/goyaml
# launchpad.net/goyaml
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_alias':
decode.go:34:7: warning: assignment from incompatible pointer type
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_mapping_start':
decode.go:44:7: warning: assignment from incompatible pointer type
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_scalar':
decode.go:54:7: warning: assignment from incompatible pointer type
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_sequence_start':
decode.go:64:7: warning: assignment from incompatible pointer type

C:\a\code\src\launchpad.net\goyaml>go install -x
WORK=C:\DOCUME~1\brainman\LOCALS~1\Temp\go-build480094247
mkdir -p $WORK\launchpad.net\goyaml\_obj\
cd C:\a\code\src\launchpad.net\goyaml
c:\mingw\go\pkg\tool\windows_386\cgo.exe -objdir $WORK\launchpad.net\goyaml\_obj\ -- -I.
-DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\ decode.go encode.go
c:\mingw\go\pkg\tool\windows_386\8c.exe -FVw -I $WORK\launchpad.net\goyaml\_obj\ -I
c:\mingw\go\pkg\windows_386 -o $WORK\launchpad.net\goyaml\_obj\_cgo_defun.8
-DGOOS_windows -DGOARCH_386 $WORK\launchpad.net\goyaml\_obj\_cgo_defun.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\_cgo_main.o -c
$WORK\launchpad.net\goyaml\_obj\_cgo_main.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\_cgo_export.o -c
$WORK\launchpad.net\goyaml\_obj\_cgo_export.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\decode.cgo2.o -c
$WORK\launchpad.net\goyaml\_obj\decode.cgo2.c
# launchpad.net/goyaml
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_alias':
decode.go:34:7: warning: assignment from incompatible pointer type
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_mapping_start':
decode.go:44:7: warning: assignment from incompatible pointer type
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_scalar':
decode.go:54:7: warning: assignment from incompatible pointer type
decode.go: In function '_cgo_e6ee69cb7fed_Cfunc_event_sequence_start':
decode.go:64:7: warning: assignment from incompatible pointer type
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\encode.cgo2.o -c
$WORK\launchpad.net\goyaml\_obj\encode.cgo2.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\api.o -c .\api.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\emitter.o -c .\emitter.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\helpers.o -c .\helpers.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\loader.o -c .\loader.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\parser.o -c .\parser.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\reader.o -c .\reader.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\scanner.o -c .\scanner.c
gcc -I . -g -O2 -m32 -mthreads -I. -DHAVE_CONFIG_H=1 -I $WORK\launchpad.net\goyaml\_obj\
-o $WORK\launchpad.net\goyaml\_obj\writer.o -c .\writer.c
gcc -I . -g -O2 -m32 -mthreads -o $WORK\launchpad.net\goyaml\_obj\_cgo_.o
$WORK\launchpad.net\goyaml\_obj\_cgo_main.o
$WORK\launchpad.net\goyaml\_obj\_cgo_export.o
$WORK\launchpad.net\goyaml\_obj\decode.cgo2.o
$WORK\launchpad.net\goyaml\_obj\encode.cgo2.o $WORK\launchpad.net\goyaml\_obj\api.o
$WORK\launchpad.net\goyaml\_obj\emitter.o $WORK\launchpad.net\goyaml\_obj\helpers.o
$WORK\launchpad.net\goyaml\_obj\loader.o $WORK\launchpad.net\goyaml\_obj\parser.o
$WORK\launchpad.net\goyaml\_obj\reader.o $WORK\launchpad.net\goyaml\_obj\scanner.o
$WORK\launchpad.net\goyaml\_obj\writer.o -lm

C:\a\code\src\launchpad.net\goyaml>

Last gcc link step fails, but it prints no error messages. There are a lot of these
error messages and they all written to stdout by Go together in one write. This write
seems to fail.

We had this problem reported before: https://golang.org/issue/3376.
But Russ hijacked conversation there into something else :-)

I propose we make change in os package. I will find a buffer size that is big enough and
works, and we will change stdout and stderr os.write to do multiple writes if buffer is
bigger then predefined.

Alex
@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 1:

Does your most recent CL fix this, Alex?

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 2:

Labels changed: added priority-later, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 3:

Labels changed: added go1.1.

@alexbrainman
Copy link
Member Author

Comment 4:

@rsc, this is still to be fixed. We have different "write" api (WriteConsole instead of
WriteFile), but, I suspect, the result will be similar.
Alex

@alexbrainman
Copy link
Member Author

Comment 6:

http://golang.org/cl/6523043/

Status changed to Started.

@alexbrainman
Copy link
Member Author

Comment 7:

This issue was closed by revision 28cb9fd.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants