id
int64
393k
2.82B
repo
stringclasses
68 values
title
stringlengths
1
936
body
stringlengths
0
256k
labels
stringlengths
2
508
priority
stringclasses
3 values
severity
stringclasses
3 values
51,285,786
go
encoding/xml: Allow ",any" elements to be unmarshalled as raw xml
<pre>It would be nice if the encoding/xml package would allow to unmarshal unknown / not explicitly mapped XML elements as raw XML. This could be achieved by either allowing to combine the &quot;,innerxml&quot; and &quot;,any&quot; tags for struct fields or by introducing a new tag &quot;,anyxml&quot; or something similar. Example: type MyStruct struct { Name string `xml:&quot;name&quot;` Rest []string `xml:&quot;,any,innerxml&quot;` }</pre>
NeedsInvestigation
low
Major
51,285,814
go
x/tools/present: support sub-section headings
by **sathishvj**: <pre>go version 1.2rc5 Multiple issues with sub sections in go.talks/present. Please see attached partial screenshot. * A subsection has a title numbering system that a section does not have * Size and formatting of sub section is much larger than section * Content under subsection is not showing * 2 subsections overwrite one another priority: low, but still would be nice to get done sometime.</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/6846/0/go.talks-present%20subsection%20issues.png">go.talks-present subsection issues.png</a> (110139 bytes)
help wanted
medium
Major
51,285,824
go
all: binaries too big and growing
<pre>As an experiment, I build &quot;hello, world&quot; at the release points for go 1.0. 1.1, and 1.2. Here are the binary's sizes: % ls -l x.1.? -rwxr-xr-x 1 r staff 1191952 Nov 30 10:25 x.1.0 -rwxr-xr-x 1 r staff 1525936 Nov 30 10:20 x.1.1 -rwxr-xr-x 1 r staff 2188576 Nov 30 10:18 x.1.2 % size x.1.? __TEXT __DATA __OBJC others dec hex 880640 33682096 0 4112 34566848 20f72c0 x.1.0 1064960 94656 0 75952 1235568 12da70 x.1.1 1429504 147896 0 177440 1754840 1ac6d8 x.1.2 % A near-doubling of the binary size in two releases is a bug of a kind. I will hold on to the files so they can be analyzed more, but am filing this issue to get the topic registered. We need to develop a better understanding of the problem and how to address it. Marking this 1.3 (not maybe) because I consider it a priority. A few months ago I exchanged mail with Russ about this topic regarding a different, much larger binary. To avoid him having to redo the analysis, here is what he said at the time: ==== i sent CL 13722046 to make the nm -S output a bit more useful. for the toy binary i now get 4a2280 1898528 D symtab 26f3a0 1405936 D type.* 671aa0 1058432 D pclntab 3c6790 598056 D go.string.* 4620c0 49600 D gcbss 7a7c20 45496 B runtime.mheap 46e280 21936 D gcdata 7a29e0 21056 b bufferList 1ed600 16480 T crypto/tls.(*Conn).clientHandshake 79eb20 16064 b semtable 1b3d90 14224 T net/http.init that seems plausible to me. some notes: symtab is the plan 9 symbol table. it in the binary but never referenced at run time. it supports things like nm -S only. it needs to move into an unmapped section of the binary, but it is only costing at most 8k at run time right now due to fragmentation and it just wasn't worth the effort to try to move. the new linker will make this easier. of course, moving it in the file doesn't shrink the file. the thing named pclntab is a reencoding of the original pclntab and the parts of the plan 9 symbol table that we did need at run time (mostly just a list of functions and their names and addresses). as you can see, it is much smaller than the old form (the symbol table dominates). type.* is the reflect types and go.string.* is the static go string data. the * indicates that i coalesced many symbols into one, to avoid useless individual names bloating the symbol table. if we tried we could probably cut the reflect types by 2-4x. it would mean packing the data a bit more compactly than an ordinary go data structure would and then using unsafe to get it back out. gcbss and gcdata are garbage collection bits for the bss and data segments. that's what atom symbol did, and it's not clear whether it will last (probably not) and whether what will replace it will be smaller. time will tell. i have a meeting with dmitriy, carl, and keith next week to figure out what the plan is. runtime.mheap, bufferList, and semtable are bss. you're not seeing the gdb dwarf debug information here, because it's not a runtime symbol. g% otool -l $(which toy) | egrep '^ segname|filesize' segname __PAGEZERO filesize 0 segname __TEXT filesize 7811072 segname __DATA filesize 126560 segname __LINKEDIT filesize 921772 segname __DWARF filesize 2886943 g% there's another 3 MB. you can build with -ldflags -w to get rid of that at least. if you read the full otool -l output you will find Load command 6 cmd LC_SYMTAB cmdsize 24 symoff 10825728 nsyms 22559 stroff 11186924 strsize 560576 looks like another 1 MB or so (560576+11186924-10825728 or 22559*16+560576) for the mach-o symbol table. when we do the new linker we can make recording this kind of information in a useful form a priority.</pre>
NeedsFix,binary-size,umbrella
high
Critical
51,285,836
go
gccgo tests: running a 'runoutput' test can hang the testsuite
<pre>I'm not sure if this is the right place to report this, but anyway: Some of the gccgo tests are use a &quot;runoutput&quot; model where the test code is compiled and run, generating more go code which is then run to be the 'real' test. If the code generating code hangs, though, the whole testsuite hangs -- the timeout that protects the overall test suite execution from most hanging tests does not kick in.</pre>
NeedsInvestigation
low
Minor
51,285,886
go
proposal: net/v2: add SetDeadline to Listener interface
<pre>Probably it has been overlooked. It would be nice if we can avoid unnecessary type assertion in the loop of accepting incoming connections. Both TCPListener and UnixListener already implemented this method.</pre>
v2,Proposal
low
Minor
51,285,887
go
x/pkgsite: specifying a file's language
<pre>Go source files are UTF-8 so there is, in principle, no need to specify its encoding or language. However, I think there is one case when it would be very convenient to specify in which language are the comments written. When using CJK (Chinese, Japanese and Korean), there are different variations of some ideograms that are written with different glyphs (sometimes differences are minor, sometimes not so minor). However, in Unicode, some of these varied glyphs share the same codepoint, so it is not possible to choose the right glyph if the language is unknown. This is called the Han Unification: <a href="https://en.wikipedia.org/wiki/Han_unification">https://en.wikipedia.org/wiki/Han_unification</a> HTML code can include the &lt;lang&gt; label to inform the browser which font should it use to render a text. If it is not included, the browser usually will use a default font. For example, Google Chrome on a non-CJK system will usually choose a Chinese font, and Japanese ideograms will be rendered with Chinese glyphs. So my suggestion would be to include some kind of label for godoc to include the right &lt;lang&gt; label in the HTML generated, so it will be rendered correctly in most systems. Ideally, it should be possible to modify it inside a file, so you could write Chinese and Japanese in the same file. What do you think?</pre>
Thinking,pkgsite
low
Minor
51,285,924
go
x/pkgsite: comments in [][]T are omitted in doc rendering
<pre>What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. 1. mkdir foo &amp;&amp; cd foo 2. curl <a href="http://play.golang.org/p/MdnYIPw4Ee.go">http://play.golang.org/p/MdnYIPw4Ee.go</a> &gt; foo.go 3. godoc . What is the expected output? PACKAGE DOCUMENTATION package foo import &quot;.&quot; VARIABLES var NUC_4 = [][]int{ /* - A C G T */ /* - */ {0, 0, 0, 0, 0}, /* A */ {0, 5, -4, -4, -4}, /* C */ {0, -4, 5, -4, -4}, /* G */ {0, -4, -4, 5, -4}, /* T */ {0, -4, -4, -4, 5}, } What do you see instead? PACKAGE DOCUMENTATION package foo import &quot;.&quot; VARIABLES var NUC_4 = [][]int{ {0, 0, 0, 0, 0}, {0, 5, -4, -4, -4}, {0, -4, 5, -4, -4}, {0, -4, -4, 5, -4}, {0, -4, -4, -4, 5}, } Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Linux Which version are you using? (run 'go version') go1.2 go.tools 25a7477727f3 Please provide any additional information below.</pre>
NeedsInvestigation,pkgsite
low
Minor
51,285,925
go
database/sql: provide optional way to mitigate convT2E allocations
<pre>In debugging the performance of Camlistore start-up (which slurps the index from disk to memory), I compared two popular MySQL drivers' allocations. Even the one that was being careful to not allocate (go-mysql-driver) was still allocating memory proportional to the data size (169.55 bytes in MysQL and 153.36 allocated): 2013/12/09 03:32:55 2512532 rows, 177786156 bytes; took 2.375200197s, 945ns each, 71.38 MB/s 2013/12/09 03:32:55 allocated = 160809408 I look into where the allocations were coming from. In the go-mysql-driver's Rows.Next (<a href="http://golang.org/pkg/database/sql/driver/#Rows)">http://golang.org/pkg/database/sql/driver/#Rows)</a> call: . 153.5 597: dest[i], isNull, n, err = readLengthEncodedString(data[pos:]) .... . . 45d2bd: MOVQ AX,18(SP) . 153.5 45d2c2: CALL runtime.convT2E(SB) It's exclusively from runtime.convT2E calls, assigning a []byte to an interface{} (driver.Value) 160809408 bytes / 2512532 rows / 2 columns = 32 bytes allocated per scanned string []byte column, even when the user of database/sql is trying to reduce allocations with sql.RawBytes. Proposal: Right now, the <a href="http://golang.org/pkg/database/sql/driver/#Rows">http://golang.org/pkg/database/sql/driver/#Rows</a> Next method's dest []Value slice is purely an output that the driver is expected to write into. If we change it to also be an optional input to the driver, we could supply it with *[]byte and drivers can either work as they do today and write to dest, or new/updated drivers can notice a *[]byte in dest and instead using that pointer to assign directly, and signal that they've done so with a sentinel value: *(dest[i]) = rawByteSlice dest[i] = driver.SentinelValue driver.SentinelValue can be a pointer, so it fits into the empty interface without allocation. The only other driver.Value type (<a href="http://golang.org/pkg/database/sql/driver/#Value)">http://golang.org/pkg/database/sql/driver/#Value)</a> that is bigger than a word is time.Time. If we care about that (and perhaps we should), we could extend this and say that instead of a *[]byte being supplied in the dest slice of []driver.Value, we instead populate it with *Sink pointers. package driver type Sink struct { .... } func (s *Sink) SetBytes(b []byte) { ... } func (s *Sink) SetTime(t time.Time) And then calling a Set method on a Sink replaces the need to have a sentinel value. If we do this, all existing drivers are still compatible. New drivers can type-assert for the *driver.Sink and call the Set method instead.</pre>
NeedsInvestigation
low
Critical
51,285,932
go
proposal: spec: asymmetry between const and var conversions
<pre>This is not a request for a language change; I am just documenting a weakness of the current const conversion rules: it confuses people that one can convert -1 to a uint, but only if the -1 is stored in variable. That is, var s = uint(-1) is illegal: constant -1 overflows uint That is clear, but it's also clear what I mean when I write this and it's a shame that I can't express what I mean as a constant, especially since var m = -1 var s = uint(m) works. There is a clumsy workaround for this case, involving magic bit operations, but the problem can turn up in other less avoidable ways: const N int = 1234 const x int = N*1.5 fails yet const N = 1234 const x int = N*1.5 succeeds. (Note the missing &quot;int&quot; in the declaration of N.) This can be rewritten as const x int = N*3/2 but if the floating point constant is itself named (as with the -1 in the uint example), it becomes impossible to express the constant value in Go even though its value seems clear. Again, not asking for a change, just pointing out a clumsy result of the existing rules</pre>
LanguageChange,Proposal,LanguageChangeReview
medium
Major
51,285,962
go
cmd/cgo: gdb on darwin cannot find symbols for cgo compiled objects
<pre>What steps will reproduce the problem? 1. Compile a program using Go 1.2 on Mac OS 10.9 that uses CGO. Set CC = a version of GCC from home brew - <a href="http://brew.sh">http://brew.sh</a> 2. Launch the program with gdb for debugging What is the expected output? gdb loads the symbols from the file and is able to step through the file What do you see instead? Following output from GDB: GNU gdb (GDB) 7.6.2 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html&gt">http://gnu.org/licenses/gpl.html&gt</a>; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot; and &quot;show warranty&quot; for details. This GDB was configured as &quot;x86_64-apple-darwin13.0.2&quot;. For bug reporting instructions, please see: &lt;<a href="http://www.gnu.org/software/gdb/bugs/&gt">http://www.gnu.org/software/gdb/bugs/&gt</a>;... Reading symbols from /Users/lukemauldin/dev/goexternal/src/tf/vncclient/vncclient... warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build264520081/tf/vncclient/vncrecord/_obj/_cgo_export.o': can't open to read symbols: No such file or directory. warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build264520081/tf/vncclient/vncrecord/_obj/vnccallback_c.o': can't open to read symbols: No such file or directory. warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build264520081/tf/vncclient/vncrecord/_obj/vncrecord.cgo2.o': can't open to read symbols: No such file or directory. warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_amd64.o': can't open to read symbols: No such file or directory. warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_darwin_amd64.o': can't open to read symbols: No such file or directory. warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_setenv.o': can't open to read symbols: No such file or directory. warning: `/var/folders/d7/x2znfx9505gfcq8cr05c56nm0000gn/T/go-build825245175/runtime/cgo/_obj/gcc_util.o': can't open to read symbols: No such file or directory. (no debugging symbols found)...done. Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Mac OS X 10.9 Which version are you using? (run 'go version') go version go1.2 darwin/amd64 Please provide any additional information below. Debugging a program that does not directly use CGO works as expected. GDB is able to debug the same program on a Linux environment.</pre>
Suggested,OS-Darwin
low
Critical
51,285,969
go
os, runtime: CTRL_CLOSE_EVENT should generate SIGHUP on Windows
<pre>On Windows, the CTRL_C_EVENT and CTRL_BREAK_EVENT control signals are converted to SIGINT in the runtime package for Windows for use by the os/signal package. After some investigation, I believe CTRL_CLOSE_EVENT should be emulated as SIGHUP. SIGHUP is already invented for compatibility purposes in the syscall package, in the same way that SIGINT is, and then actively used by the existing handlers installed for CTRL_C_EVENT and CTRL_BREAK_EVENT above. Relevant lines in tip's source: runtime·stdcall(runtime·SetConsoleCtrlHandler, 2, runtime·ctrlhandler, (uintptr)1); // This registers Go's control event handler to convert control events into unix-like signals /* in the handler these events are converted to SIGINT */ case CTRL_C_EVENT: case CTRL_BREAK_EVENT: s = SIGINT; /* invented values for important signals */ SIGHUP = Signal(0x1) SIGINT = Signal(0x2) Please also see: <a href="http://stackoverflow.com/q/20511182/149482">http://stackoverflow.com/q/20511182/149482</a> <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms685049%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms685049%28v=vs.85%29.aspx</a> <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms683242(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms683242(v=vs.85).aspx</a></pre>
Suggested,OS-Windows
low
Major
51,286,042
go
cmd/gofmt: remove leading/trailing blank lines from function bodies
<pre>What steps will reproduce the problem? 1. <a href="http://play.golang.org/p/Np4vGQFcqA">http://play.golang.org/p/Np4vGQFcqA</a> 2. Hit Format. What is the expected output? What do you see instead? Want: Lines 6 and 13 removed. Have: No change. Please use labels and text to provide additional information. Discussed with the community in <a href="https://groups.google.com/forum/#">https://groups.google.com/forum/#</a>!topic/golang-nuts/Z_s_tLTazJU Based on that feedback, I propose that gofmt: * remove trailing blank lines from function bodies * remove leading blank lines when the function declaration is a single line If this (or some variant thereof) gets an official blessing, I'd be happy to implement.</pre>
Thinking
medium
Critical
51,286,102
go
proposal: net/v2: receiving IPv4 header on raw IPv4 socket
<pre>// BUG(mikio): On every POSIX platform, reads from the &quot;ip4&quot; network // using the ReadFrom or ReadFromIP method might not return a complete // IPv4 packet, including its header, even if there is space // available. This can occur even in cases where Read or ReadMsgIP // could return a complete packet. For this reason, it is recommended // that you do not uses these methods if it is important to receive a // full packet. // // The Go 1 compatibility guidelines make it impossible for us to // change the behavior of these methods; use Read or ReadMsgIP // instead.</pre>
v2,Proposal
low
Critical
51,286,104
go
cmd/cgo: pointers of Objective-C classes compatibility
<pre>What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. A pointer of an Objective-C class can't be assigned to a variable as a pointer of another Objective-C class. For example: package main // #cgo CFLAGS: -x objective-c // // @class Foo; // @class Bar; import &quot;C&quot; func main() { var foo *C.Foo var bar *C.Bar foo = bar // ? print(foo) print(bar) } What is the expected output? Compile Error What do you see instead? Compile succeeded (&quot;0x00x0&quot; was printed) Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Mac OS X 10.9 Which version are you using? (run 'go version') go version go1.2 darwin/amd64 Please provide any additional information below.</pre>
NeedsInvestigation
low
Critical
51,286,112
go
proposal: fmt/v2: State Flag(int) should be Flag(rune)
<pre>This issue is really just a note. The Flag method of fmt.State takes an int argument but represents a 'character'. Probably it should have been changed from int to rune when the rune alias was introduced (or byte - given all flags are ASCII). Which version are you using? (run 'go version') go1.2</pre>
v2,Proposal
low
Minor
51,286,119
go
x/playground: Maybe warn user if import of "time" or "net" is seen
<pre>The playground just keeps confusing people. Here's an idea to make it's intentional limitations more discoverable: - add a content slot just before output, that is marked up with e.g. background color that differentiates it from output, that can contain messages; make it invisible if empty - if the code imported &quot;time&quot;, add message like &quot;Playground is frozen in time to 2009.&quot; - if the code imported &quot;net&quot;, add message like &quot;Playground has fake networking that can only communicate within the application.&quot; - if either of the two messages triggered, add a link &quot;See About for more.&quot;</pre>
help wanted
low
Minor
51,286,176
go
runtime: runtime_test execution of nm uses system go, not go in tree
<pre>check out tree cd go/src ./make.bash ../bin/go test runtime -short --- FAIL: TestRuntimeGogoBytes (0.10 seconds) runtime_test.go:113: go tool nm: exit status 1 usage: nm [-aghnsSTu] file ... FAIL It's picking up the system-wide go (and thus nm) which is Go 1.2, not the one from ../bin/go which is tip. Setting GOROOT before building fixes it. This used to work, although I guess mostly by accident (the system and tip nm's were compatible). Any way we can fix this, or do I have to start setting GOROOT all the time now?</pre>
NeedsInvestigation
low
Major
51,286,225
go
proposal: go/ast: deprecate MergePackageFiles (it's not used, and buggy)
by **[email protected]**: <pre>The parser.ParseComments option to parser.ParseFile causes ast.MergePackageFiles to create a broken merge. What steps will reproduce the problem? This code reproduces the problem: <a href="http://play.golang.org/p/63LsxcrpWi">http://play.golang.org/p/63LsxcrpWi</a> You can also run godoc with --src option for a package with multiple source files, like strings. What is the expected output? // Package foo does bar and baz. package foo type string struct{} // Foo is a structure. type Foo struct{} // String outputs Foo in a human-readable way. func (f *Foo) String() string { return string{} } // Error method for Foo. func (f *Foo) Error() string { return f.String() } What do you see instead? package // Foo is a structure. foo type string struct{} type Foo struct{} // String outputs Foo in a human-readable way. // Package foo does bar and baz. // Error method for Foo. func (f *Foo) String() string { return string{} } func (f *Foo) Error() string { return f.String() }</pre>
Proposal
low
Critical
51,286,226
go
net/http/cookiejar: figure out canonicalization resposibility
<pre>Nigel's comments on <a href="https://golang.org/cl/47560044/">https://golang.org/cl/47560044/</a> : &quot;&quot;&quot; OK, but this means that e.g., in the code.google.com/p/go.net/publicsuffix implementation, it's perfectly valid thatPublicSuffix(&quot;example.com.au&quot;) is &quot;com.au&quot; but PublicSuffix(&quot;EXAMPLE.COM.AU&quot;) is &quot;AU&quot;. What happens if, somewhere out there in the wild internet, a anchor's href contains a domain in ALL.CAPS? A naive HTTP client implementation might end up associating any returned cookies with the wrong public suffix, unless somewhere along the line the domains are canonicalized to lower case. Is this a cookie security problem, and a particularly insidious one since it 'works' 99.999% of the time? This particular CL says that the PublicSuffixList is not responsible for canonicalization (lower-casing, punycode), but the bigger question of who *is* responsible is left unanswered. Having different parts of a program each do their own ad hoc canonicalization can be precarious, e.g. if some separate part of the program then lower-cases the &quot;AU&quot; to &quot;au&quot;. It's not exactly related to cookie jars, but I am reminded of <a href="http://labs.spotify.com/2013/06/18/creative-usernames/">http://labs.spotify.com/2013/06/18/creative-usernames/</a> Personally, I would not have removed the TODO without first building consensus (presumably as a new discussion on golang-dev) about how to approach domain canonicalization and cookies so that it's always right, not just almost always right. &quot;&quot;&quot;</pre>
NeedsInvestigation
low
Minor
51,286,299
go
x/net/ipv6: add support for windows
<pre>It might be easy on both dragonfly and solaris, but not sure whether plan9 is an ipv6 compliant implementation.</pre>
help wanted,OS-Windows,FeatureRequest
low
Major
51,286,300
go
x/net/ipv4: add support for windows
<pre>For now they are full of shims and spacers.</pre>
help wanted,OS-Windows
low
Major
51,286,330
go
go/printer: match indentation when returning multiple composite literals
<pre><a href="http://play.golang.org/p/IxtYF1rXe9">http://play.golang.org/p/IxtYF1rXe9</a> ----- package main type T struct { x int y string } func f() (*T, *T) { return &amp;T{ x: 1, y: &quot;foo&quot;, }, &amp;T{ x: 2, y: &quot;bar&quot;, } } ----- This doesn't happen when there's only one return value, or when one of the return values is &quot;nil&quot;.</pre>
Suggested
low
Major
51,286,336
go
go/printer: wonky alignment when mixing embedded and typed fields along with struct tags in a struct definition
by **cudmore.mb**: <pre>*What steps will reproduce the problem?* 1. Format <a href="http://play.golang.org/p/jzmwwldMwt">http://play.golang.org/p/jzmwwldMwt</a> 2. Format *What is the expected output?* {{{ type Field struct { ID `json:&quot;UID&quot;` // comment Label ID `json:&quot;Lbl&quot;` // comment *N // comment Value string `json:&quot;Val&quot;` Inheritable `json:&quot;Inh&quot;` // comment a int // comment b string c int // comment } }}} *What do you see instead?* {{{ type Field struct { ID `json:&quot;UID&quot;` // comment Label ID `json:&quot;Lbl&quot;` // comment *N // comment Value string `json:&quot;Val&quot;` Inheritable `json:&quot;Inh&quot;` // comment a int // comment b string c int // comment } }}} *Which version are you using?* go1.2 I opened a discussion on this here: <a href="https://groups.google.com/d/topic/golang-nuts/5RlC11J7XNE/discussion">https://groups.google.com/d/topic/golang-nuts/5RlC11J7XNE/discussion</a> It would be great if go fmt would align the parts of field definitions by kind (type, tag, comment), rather than by index (first parts align, second parts), across contiguous field definitions until an intermittent newline or comment. The type of anonymous fields would be regarded as the field name, and would not contribute to computing the alignment of the types. All types in a contiguous list of fields would align to the rightmost, and then all tags, and then all comments. However, this does get tricky: <a href="http://play.golang.org/p/Z_OPEbej-v">http://play.golang.org/p/Z_OPEbej-v</a></pre>
NeedsInvestigation
low
Minor
51,286,391
go
x/net/html: ParseFragment fails to parse sub-table elements in the root position
by **algorithmicimperative**: <pre>1. Use `html.ParseFragment` to parse a fragment of HTML where the root elements are `&lt;tbody&gt;`, `&lt;tr&gt;` or `&lt;td&gt;` (and probably other table sub-elements) For example: s := `&lt;td&gt;first&lt;/td&gt; &lt;td&gt;second&lt;/td&gt; &lt;td&gt;third&lt;/td&gt; ` doc, err := html.ParseFragment(strings.NewReader(s), &amp;html.Node{ Type: html.ElementNode, Data: &quot;body&quot;, DataAtom: atom.Body, }) 2. Check the result `fmt.Printf(&quot;%#v\n&quot;, doc)` What is the expected output? `[]*html.Node` of 3 `td` elements What do you see instead? `[]*html.Node` of a single text node containing the `first second third` text. Which operating system are you using? Linux Which version are you using? 1.2 ParseFragment works fine with other semantically incorrect structures, like `&lt;option&gt;` elements. Has trouble with table sub-elements though. If this isn't a bug and is failing by design, perhaps we need something like `atom.DocumentFragment` that will receive any arbitrary HTML.</pre>
NeedsInvestigation
low
Critical
51,286,393
go
encoding/xml: omit parent tags if value is empty #2
<pre>What steps will reproduce the problem? <a href="http://play.golang.org/p/m2rU4cPOBo">http://play.golang.org/p/m2rU4cPOBo</a> What is the expected output? &lt;OmitEmpty&gt;&lt;/OmitEmpty&gt; What do you see instead? &lt;OmitEmpty&gt;&lt;Vars&gt;&lt;/Vars&gt;&lt;/OmitEmpty&gt; Please provide any additional information below. <a href="https://golang.org/cl/6569067/">https://golang.org/cl/6569067/</a> This was originally: <a href="https://golang.org/issue/4168">https://golang.org/issue/4168</a> Ran into this issue today making a restful API service. Ended up having to make my own custom Marshaller.</pre>
NeedsFix,early-in-cycle
medium
Major
51,286,451
go
cmd/cgo: doesn't properly recognize a typedef'd C array type when it's a const C function argument
by **[email protected]**: <pre>I ran into an issue with cgo, when integrating Go with some C code. The attached tarball contains a minimal example that reproduces the problem. Basicaly, passing a variable of a typedef'd array type to a function accepting a const argument results in a &quot;type mismatch&quot; compilation error. C: typedef unsigned char Bar[12]; void foo(Bar* f); // this works void foo2(const Bar* f); // this confuses cgo Go: func main() { var v C.Bar C.foo(&amp;bar) // this works C.foo2(&amp;bar) // error, pasted below } This doesn't happen on Mac OS, go version go1.2 darwin/amd64, I don't know about Windows builds. What steps will reproduce the problem? 1. tar zxf const-bug.tar.gz &amp;&amp; cd const-bug &amp;&amp; make What is the expected output? Program should compile. What do you see instead? src/kg/constbug/main.go:12: cannot use &amp;bar (type *_Ctype_Bar) as type *[12]_Ctype_unsignedchar in function argument Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Ubuntu 12.04 Which version are you using? (run 'go version') go version go1.2 linux/amd64 Installed from <a href="https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz">https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz</a></pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/7270/0/const-bug.tar.gz">const-bug.tar.gz</a> (1144 bytes)
Suggested
low
Critical
51,286,499
go
cmd/asm: add neon, vector instructions for arm
by **byron.rakitzis**: <pre>go1.2 In contrast to the amd64 port, the arm port of the Go assembler does not recognize SIMD instructions (&quot;V…&quot;) or vector registers (D or Q). It would be useful for us (we are writing custom speedups for a project using Intel SSE, and would care to do the same for ARM), but it would also be useful for the Go library itself if the library functions which have SIMD speedups in xxx_amd64.s had analogous speedups in xxx_arm.s Thank you, Byron Rakitzis.</pre>
NeedsFix
medium
Major
51,286,576
go
misc/makerelase: wrong icon for Windows command prompt
by **golubdr**: <pre>Installing Go on a Windows computer causes any 32-bit command prompt windows (opened by running C:\Windows\SysWOW64\cmd.exe) to have the Go icon instead of the command prompt icon. A similar issue existed for the Windows version of Git and has already been fixed there. See <a href="https://github.com/msysgit/msysgit/issues/71">https://github.com/msysgit/msysgit/issues/71</a>.</pre>
help wanted,OS-Windows
low
Major
51,286,661
go
database/sql: Support for database, catalog, schema and table level metadata
by **glen.newton**: <pre>database/sql does not offer the ability to dynamically peruse databases, catalogs, schemas and tables and their underlying metadata at runtime. Without this, it is not possible to make, for example, a Go program that can copy arbitrary tables from a database, by examining their metadata at runtime. What is needed is the equivalent of Java JDBC's DatabaseMetaData <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html</a> While JDBC's DatabaseMetaData may seem be overkill, being able to examine a table's metadata in the same manner as the table's data is attractive. In order to support rich and complex interactions with sql databases, emulating JDBC would not be a bad idea. As an initial step however, I would suggest the following minimum extensions to the sql package: func (db *DB) GetSchemas() (*Rows, error) JDBC equivalent &amp; explanation: ResultSet getSchemas() <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getSchemas%28%29">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getSchemas%28%29</a> func (db *DB) GetCatalogs() (*Rows, error) JDBC equivalent &amp; explanation: ResultSet getCatalogs() <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getCatalogs%28%29">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getCatalogs%28%29</a> func (db *DB) GetTables(catalog String, schemaPattern String, tableNamePattern String, types String[]) (*Rows, error) JDBC equivalent &amp; explanation: ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getTables%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getTables%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String</a>[]%29 func (db *DB) getColumns(catalog String, schemaPattern String, tableNamePattern String, columnNamePattern String) (*Rows, error) JDBC equivalent &amp; explanation: ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getColumns%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getColumns%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29</a> The following are important and should also be considered: getAttributes(...) <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getAttributes(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getAttributes(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)</a> getCrossReference(...) <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getCrossReference%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getCrossReference%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29</a> getIndexInfo(...) <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getIndexInfo(java.lang.String,%20java.lang.String,%20java.lang.String,%20boolean,%20boolean)">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getIndexInfo(java.lang.String,%20java.lang.String,%20java.lang.String,%20boolean,%20boolean)</a> getPrimaryKeys(...) <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getPrimaryKeys(java.lang.String,%20java.lang.String,%20java.lang.String)">http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getPrimaryKeys(java.lang.String,%20java.lang.String,%20java.lang.String)</a> I would also suggest that bug <a href="https://golang.org/issue/5606">https://golang.org/issue/5606</a> be solved in a similar and consistent fashion with something like <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSetMetaData.html">http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSetMetaData.html</a> Apologies for using Java as an example, but JDBC has done its homework and I think it represents best practices. How it maps into a Go context is of course to be debated and I am willing to accept that my very direct mapping suggestion may not be the best or the most acceptable to the community.</pre>
NeedsInvestigation
medium
Critical
51,286,680
go
cmd/gofmt: gofmt -r should preserve attached comments through a rewrite
<pre>$ cat test.go package p var x = (foo /* foo */ + bar /* bar */) $ gofmt -r 'foo-&gt;bla' test.go package p var x = (bla + bar /* bar */) Instead it should print: package p var x = (bla /* foo */ + bar /* bar */)</pre>
NeedsFix
low
Minor
51,286,696
go
proposal: spec: file and package scope interact in odd ways
<pre>This is just a reminder to revisit the interactions between file and package scope at some point in the future. At the moment we have the following rule: &quot;... no identifier may be declared in both the file and package block.&quot; ( <a href="http://tip.golang.org/ref/spec#Declarations_and_scope">http://tip.golang.org/ref/spec#Declarations_and_scope</a> ) The reason for this rule is that we don't want to, say, import package math, and also have a - in the same file - a package level variable math, and the import would then hide the variable because the file block is inside the package block, and not have any visible nesting (in fact the nesting is &quot;inside out&quot; in this case). However, as a consequence, other odd behavior follows. Assume a package p consisting of two files a.go, b.go, with a.go importing package math, and b.go not importing anything. In b.go, the identifier math is not visible (it is in a.go's file scope), yet it is not possible to declare a package-level variable math in b.go w/o an error because of the above-cited rule. This is counter-intuitive. One could imagine an alternative approach that satisfies the same intent, namely avoids that both an import of an identifier x hides a package-level identifier x in the same file: - File blocks are nested inside the package block as before. - Each import and also each top-level declaration in a file go into the file block. - Additionally, each non-imported identifier also goes into the package block. This way, all non-imported top-level identifiers are visible in all files. Imports remain only visible in the file containing the import. Imports and file-level declarations cannot conflict (this is the main purpose of the above rule). Implementation-wise there may be different approaches to obtain the desired behavior. A direct implementation of these new rules might lead to the (possibly undesired) property that non-import file-level declarations end up both in a compiler's file and package scope, that is, an object belongs to two scopes simultaneously. The new rules would be a backward-compatible language change.</pre>
LanguageChange,Proposal,LanguageChangeReview
low
Critical
51,286,747
go
testing: add ratcheting variants
<pre>For some testing and benchmark purposes, a ratchet is better suited than an average. <a href="https://golang.org/cl/67870053/">https://golang.org/cl/67870053/</a> bumps up the number of AllocsPerRun runs of an http test to avoid flakiness. This test would be more reliable using a lower number of runs if it could measure the best run rather than the average. In addition, it could set an explicit (rather than comparative) goal for the number of allocs, which would allow it to catch other regressions. With care, MinAllocsPerRun could even use heuristics to avoid requiring the user to pass an explicit number of runs. For benchmarking tightly CPU-bound code with minimal scheduler/OS interactions, a ratcheting benchmark will often yield more stable, useful results than an averaging benchmark.</pre>
NeedsInvestigation,FeatureRequest
low
Minor
51,286,772
go
x/tools/cmd/cover or cmd/yacc: go tool cover -html shows all lines in yacc generated code as "not tracked"
by **hwang.dev**: <pre>What steps reproduce the problem? 1. run ./test.sh in the attachment: go tool yacc -p expr -o expr_auto.go expr.y go test -coverprofile profile.cov go tool cover -html profile.cov 2. In the opened browser, select &quot;parser.go&quot; in the drop-down list. What happened? All the code lines are grey (&quot;not tracked&quot;). What should have happened instead? Some lines are green (covered) or red (not covered). Please provide any additional information below: If I modified each comment from &quot;//line xxx&quot; to &quot;// line xxx&quot; (add an extra space between &quot;//&quot; and &quot;line&quot;, then it can be tracked correctly. So I guess that the comments like &quot;//line xxx&quot; somehow is a way to tell the cover tool not to track, but why?</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/7483/0/expr.zip">expr.zip</a> (5480 bytes)
NeedsInvestigation
low
Major
51,286,848
go
encoding/xml: Encoder duplicates namespace tags
by **seanerussell**: <pre>== What does 'go version' print? go version go1.2.1 darwin/amd64 == What steps reproduce the problem? <a href="http://play.golang.org/p/3_oUruPYhq">http://play.golang.org/p/3_oUruPYhq</a> == What happened? Encoder.EncodeToken duplicates namespace attributes. == What should have happened instead? The encoded document should have had a single namespace attribute. == Please provide any additional information below. Attribute names on an element must be unique; this is a well-formedness constraint per the XML 1.0 specification (<a href="http://www.w3.org/TR/xml/#uniqattspec)">http://www.w3.org/TR/xml/#uniqattspec)</a>. Per the specification, both validating and non-validating parsers must report well-formedness violations (<a href="http://www.w3.org/TR/xml/#sec-conformance)">http://www.w3.org/TR/xml/#sec-conformance)</a>. Encoding and decoding XML documents should be idempotent and produce equivalent documents. This issue means that not only that decoding and encoding the result produces a non-equivalent document, but that the document it generates is not-well-formed. This issue only occurs with namespaces. Normal attributes are handled correctly.</pre>
NeedsFix,early-in-cycle
medium
Major
51,286,860
go
cmd/vet: warn of cyclic closures that cause Finalizers not to run
<pre>What does 'go version' print? go version devel +08dcdcdb757b Thu Mar 13 14:04:29 2014 -0700 linux/amd64 What steps reproduce the problem? 1. <a href="http://play.golang.org/p/QWn904819Y">http://play.golang.org/p/QWn904819Y</a> What happened? A tricky case with Finalizers and closures can be created where the Finalizer will not run due to the cyclic structure created (not a bug). Go vet does not complain about suck tricky cases which could be useful. What should have happened instead? Go vet should warn of such tricky cases.</pre>
Analysis
low
Critical
51,286,944
go
unicode: decrease binary size
<pre>Currently, the generated unicode tables.go sets up a separate slice for each R16/R32 in each RangeTable, each with its own backing array. Rearranging the code generated by maketables.go (in a way that is invisible to the exported API) so that the RangeTable slices point into a big, shared R16/R32 array reduces the contribution of the unicode tables to binary size by ~35k. If <a href="https://golang.org/issue/7599">issue #7599</a> were fixed as well, the space savings would be ~45k to ~60k. Details on the savings below. Questions: (1) Are these space savings significant enough to warrant possible inclusion in Go 1.3, or should I wait to polish + mail the CL until Go 1.4? (2) Is there a reason not to do this rearrangement? (3) Is there a fix to the toolchain that achieves these reductions in a better / cleaner / deeper way? (For example, instead of creating a separate backing array symbol and slice header symbol for staticly initialized slices, one could just create a single slice symbol containing the slice header followed by the array. That would prove some space savings.) Details on the size changes: $ cat radical.go package main import &quot;unicode&quot; func main() { _ = unicode.Radical } Build with 6g. Binary size before: 733664 bytes. Binary size after: 699296 bytes. Largest symbols before: $ go tool nm -size -sort size radical | head -n 50 4e0c0 101365 R _esymtab 4e0c0 101365 R _pclntab 4e0c0 101365 R _etypelink 4e0c0 101365 R _symtab 87200 56984 B runtime.mheap 3d340 49024 R _gcbss 319f8 47372 R go.string.* 265a0 46168 R _rodata 265a0 46168 R type.* 81fc0 21056 B _bufferList 492c0 18192 R _gcdata 492c0 18192 R _egcbss 7e100 16064 B _semtable 22920 15088 T unicode.init Largest symbols after: $ go tool nm -size -sort size radical | head -n 50 4efa0 102141 R _pclntab 878c0 56984 B runtime.mheap 3e420 52360 R _gcbss 33c18 42956 R go.string.* 2a5c0 38488 R type.* 2a5c0 38488 R _rodata 22920 31504 T unicode.init 82680 21056 B _bufferList 6a740 20904 D unicode.allRange16 7e7c0 16064 B _semtable 4b0c0 14856 R _gcdata 68020 10016 D unicode.allRange32 7c7a0 8192 B _pdesc 7a800 8096 B _hash The main size savings here come from a reduction in the number of small symbols generated to hold staticly initialized autotmp values, each with their own overhead (name, padding, etc.). The increase in the size of unicode.init is addressable via <a href="https://golang.org/issue/7599">issue #7599</a>.</pre>
NeedsInvestigation,binary-size
low
Major
51,286,953
go
cmd/cgo: cgo breaks multiple cgo packages linked with libgcc
by **jim.deng**: <pre>What does 'go version' print? go version devel +358e2b416518 Wed Mar 19 09:00:58 2014 -0700 darwin/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Create a source tree that can be downloaded below: src/main/main.go <a href="http://play.golang.org/p/3y44TXNfEf">http://play.golang.org/p/3y44TXNfEf</a> src/hello/hello.go <a href="http://play.golang.org/p/iJZL_tuvDm">http://play.golang.org/p/iJZL_tuvDm</a> src/world/world.go <a href="http://play.golang.org/p/V7m4penOiv">http://play.golang.org/p/V7m4penOiv</a> 2. Install android standalone ndk 49d following 4/ Invoking the compiler (the easy way): <a href="http://www.kandroid.org/ndk/docs/STANDALONE-TOOLCHAIN.html">http://www.kandroid.org/ndk/docs/STANDALONE-TOOLCHAIN.html</a> <a href="https://developer.android.com/tools/sdk/ndk/index.html">https://developer.android.com/tools/sdk/ndk/index.html</a> 3. Run the following command to build export PATH=/path/to/android/toolchain-r9d/bin:$PATH CGO_CFLAGS='-I /Users/jim_deng/workspace/android/toolchain-r9d/include -march=armv7-a -mfloat-abi=softfp' \ CGO_LDFLAGS='-Wl,--fix-cortex-a8' \ CC=arm-linux-androideabi-gcc \ CXX=arm-linux-androideabi-g++ \ GOOS=linux \ GOARCH=arm \ CGO_ENABLED=1 \ go build -tags android -x What happened? Got multiple definition of '__aeabi_dcmpge' errors ... <a href="http://hastebin.com/sodekeqibi.mel">http://hastebin.com/sodekeqibi.mel</a> What should have happened instead? go build should succeed Please provide any additional information below. * Background discussion: <a href="https://groups.google.com/forum/#">https://groups.google.com/forum/#</a>!topic/golang-nuts/73NvFzLZpSY * android tool chain cannot be linked with -lpthread. I have to patch cgo not to add -lpthread in the linker. --- a/src/pkg/runtime/cgo/cgo.go Wed Mar 19 09:00:58 2014 -0700 +++ b/src/pkg/runtime/cgo/cgo.go Thu Mar 20 17:31:16 2014 -0700 @@ -14,7 +14,7 @@ -#cgo linux LDFLAGS: -lpthread +#cgo linux,!android LDFLAGS: -lpthread</pre>
Suggested
low
Critical
51,286,963
go
sort: superior SymMerge-based algorithm available
by **[email protected]**: <pre>Someone on the mailing list told me to file a bug for this, but the SymMerge-based sort used in the sort.go file has since been surpassed by a new algorithm created by the same authors (Pok-Son Kim and Arne Kutzner): <a href="http://golang.org/src/pkg/sort/sort.go?m=text">http://golang.org/src/pkg/sort/sort.go?m=text</a> I have a GitHub page up with working implementations available, but no Go version right now. <a href="https://github.com/BonzaiThePenguin/WikiSort">https://github.com/BonzaiThePenguin/WikiSort</a></pre>
help wanted
low
Critical
51,286,990
go
gdb: cannot debug windows/386 binaries in wine/gdb due to internal gdb assert failure
<pre>What does 'go version' print? go version devel +26aa53304a48 Fri Mar 07 16:08:12 2014 -0500 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Build a Go program emdash any Go program emdash for windows/386. 2. wine --gdb program.exe 3. Alternatively, wine --gdb --no-start program.exe, then attach the resultant gdb server to a debugging frontend; same effect. What happened? xe: gdbproxy.c:2494: gdb_init_context: Assertion `gdbctx-&gt;process == ((void *)0) &amp;&amp; de.dwProcessId == dbg_curr_pid' failed. winedbg: Internal crash at 0xf7746430 /tmp/winegdb.2uyltD:2: Error in sourced command file: Remote communication error. Target disconnected.: Connection reset by peer. If attaching to a frontend, the &quot;Connection reset&quot; line will appear in the frontend and the others in the terminal where winedbg is being run. What should have happened instead? (standard gdb prompt and session) Please provide any additional information below. Not sure if this affects windows/amd64 as well; that has its own problems working in wine/winedbg.</pre>
OS-Windows
low
Critical
51,286,994
go
x/net/websocket: messages not exposed in package API
by **[email protected]**: <pre>WebSocket peers exchange messages. A message is composed of one or more frames. The (*Conn).Read and (Codec).Receive methods return a single frame. There is no mechanism to detect message boundaries or otherwise compose frames into a message. To use this package, an application must provide its own framing or assume that the peer sends single frame messages. My guess is that most applications assume that the peer sends single frame messages because that's what browsers and the websocket package do. This assumption is not true of all peers.</pre>
NeedsInvestigation
low
Major
51,287,001
go
cmd/compile: combine slice header and backing array for static slices into a single symbol
<pre>Static slices generate two symbols, one for the slice header and one for the backing array. These could be combined into a single symbol, laid out with the slice header followed by the backing array. This would reduce binary size, particularly for the unicode tables. This does not make sense to do unless <a href="https://golang.org/issue/7599">issue #7599</a> is also done, otherwise the backing array will be needlessly loaded during init. See <a href="https://golang.org/cl/78870047/">https://golang.org/cl/78870047/</a> for more discussion. Something similar could probably profitably be done for strings and string headers, although there is a different approach under discussion at <a href="https://golang.org/issue/7384">issue #7384</a>.</pre>
binary-size
low
Minor
51,287,008
go
misc/gdb: gdb "l" command displays wrong source file/line
<pre>I'm no windows/386 tip. C:\go\path\mine\src\a&gt;type main.go package main import &quot;fmt&quot; func main() { fmt.Println(&quot;Hello&quot;) } C:\go\path\mine\src\a&gt;go build main.go C:\go\path\mine\src\a&gt;gdb main.exe GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html&gt">http://gnu.org/licenses/gpl.html&gt</a>; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot; and &quot;show warranty&quot; for details. This GDB was configured as &quot;mingw32&quot;. For bug reporting instructions, please see: &lt;<a href="http://www.gnu.org/software/gdb/bugs/&gt">http://www.gnu.org/software/gdb/bugs/&gt</a>;... Reading symbols from C:\go\path\mine\src\a/main.exe...done. (gdb) br 'runtime.stdcall' Breakpoint 1 at 0x40c730 (gdb) r Starting program: C:\go\path\mine\src\a/main.exe [New Thread 5524.0x81c] Breakpoint 1, 0x0040c730 in runtime.stdcall () at C:/go/root/src/pkg/runtime/compiler.go:1 1 // Copyright 2012 The Go Authors. All rights reserved. (gdb) l 1 // Copyright 2012 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package runtime 6 7 // Compiler is the name of the compiler toolchain that built the 8 // running binary. Known toolchains are: 9 // 10 // gc The 5g/6g/8g compiler suite at code.google.com/p/go. (gdb)</pre>
NeedsInvestigation
low
Critical
51,287,019
go
cmd/compile: recognize x[:] of global array x as static data
<pre>If an array is defined in the global scope and concerted to a slice in an unused struct literal, it will not get garbage collected by the linker. See code below to reproduce the problem. go version devel +0134c7020c40 Wed Mar 26 15:23:31 2014 -0700 darwin/amd64 ===BEGIN=== package main func main() { } type foo struct { arr []int } var f = foo{ arr: a[:], // Remove this line and a will get collected. } var a = [1000111]int{3} // Removing the 3 will cause the array to be collected. ===END===</pre>
NeedsInvestigation
low
Major
51,287,050
go
x/crypto/ssh: suggested add auth methods from server to error info
by **weyllor**: <pre>What does 'go version' print? go version go1.2.1 windows/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. config a Client only with password method 2. connect to a ssh server reject password method 3. auth fail, but no more info to find out what happened. What happened? not enough error info to known why ssh auth fail. What should have happened instead? show what methods supported by server in error info. Please provide any additional information below. I make a path for this issue, ref the attachment.</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/7670/0/patch.diff">patch.diff</a> (1379 bytes)
NeedsInvestigation
low
Critical
51,287,062
go
cmd/compile: don't use REP prefix for reverse-order copying on amd64, 386
<pre>REP prefixes have a high startup cost. Most were eliminated with CL 81370046. For overlapping source/destinations when we have to copy in descending address order, they are still used. Fix that.</pre>
NeedsInvestigation
low
Minor
51,287,134
go
crypto/x509: add more detail to the error message arising from a missing hash function.
<pre>If a certificate is signed with a hash function that wasn't compiled in the error message isn't bad, but could be better: x509: certificate signed by unknown authority (possibly because of &quot;x509: cannot verify signature: algorithm unimplemented&quot; while trying to verify candidate authority certificate &quot;CA Cert Signing Authority&quot;)</pre>
help wanted,NeedsFix
low
Critical
51,287,158
go
gccgo: crash due to running out of memory (likely)
<pre>Test case: <a href="http://play.golang.org/p/xoT0jSBOci">http://play.golang.org/p/xoT0jSBOci</a> Perhaps it's possible to give a nicer error message. $ gccgo overflow.go terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc go1: internal compiler error: Aborted 0x99a9ef crash_signal /tmp/go-build-release/gccgo-srcdir/gcc/toplev.c:337 0x1063bbc __gnu_cxx::__verbose_terminate_handler() /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/gcc-4_6/libstdc++-v3/libsupc++/vterminate.cc:95 0x10628f5 __cxxabiv1::__terminate(void (*)()) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/gcc-4_6/libstdc++-v3/libsupc++/eh_terminate.cc:40 0x1062922 std::terminate() /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/gcc-4_6/libstdc++-v3/libsupc++/eh_terminate.cc:50 0x1062a55 __cxa_throw /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/gcc-4_6/libstdc++-v3/libsupc++/eh_throw.cc:83 0x1062cfc operator new(unsigned long) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/gcc-4_6/libstdc++-v3/libsupc++/new_op.cc:58 0x104be58 __gnu_cxx::new_allocator&lt;char&gt;::allocate(unsigned long, void const*) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:92 0x104be58 std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_create(unsigned long, unsigned long, std::allocator&lt;char&gt; const&amp;) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:609 0x104cb3a std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_M_clone(std::allocator&lt;char&gt; const&amp;, unsigned long) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:631 0x104cc1f std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::reserve(unsigned long) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:512 0x104cc1f std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::reserve(unsigned long) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:503 0x104d11c std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::append(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) /usr/crosstool/v15/gcc-4.6.x-glibc-2.11.1-grte/x86/debug-src/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:334 0x56ddfd operator+&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; /google/src/files/34541112/depot/google3/third_party/crosstool/v15/release/wrappers/x86/bin/../../../gcc/x86/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.x-google/../../../../include/c++/4.6.x-google/bits/basic_string.h:2310 0x56ddfd Binary_expression::do_lower(Gogo*, Named_object*, Statement_inserter*, int) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/expressions.cc:5327 0x5914ae Expression::lower(Gogo*, Named_object*, Statement_inserter*, int) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/expressions.h:623 0x5914ae Lower_parse_tree::expression(Expression**) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/gogo.cc:1715 0x5914ae Lower_parse_tree::expression(Expression**) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/gogo.cc:1703 0x559595 Expression::traverse(Expression**, Traverse*) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/expressions.cc:54 0x59151c Named_constant::traverse_expression(Traverse*) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/gogo.cc:4992 0x59151c Lower_parse_tree::constant(Named_object*, bool) /tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/gogo.cc:1624 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See &lt;<a href="http://go.ext.google.com/go/&gt">http://go.ext.google.com/go/&gt</a>; for instructions.</pre>
NeedsInvestigation
low
Critical
51,287,168
go
runtime: gc can add clock tick latency when HPETs are not used
<pre>Garbage collector can add latency on the order of clock tick (usually 10ms, 2.5ms, or 1ms) to each run. This is due to some runtime·usleep(1) and runtime·usleep(100) calls, which get rounded up to clock period when HPETs are not used. More details in this thread: <a href="https://groups.google.com/d/topic/golang-codereviews/AxqxYnioBOQ/discussion">https://groups.google.com/d/topic/golang-codereviews/AxqxYnioBOQ/discussion</a> Linux uses HPETs by default, but most ARM machines don't have HPETs. Solaris doesn't use HPETs by default, so this issue affects arm machines and solaris. I'm not sure if we need to do anything (maybe we can just assume &quot;fast&quot; machines), I'm logging it so we can refer to it later.</pre>
NeedsInvestigation
low
Major
51,287,223
go
x/crypto/ssh: TestHandshakeBasic times out on Plan 9
<pre>What steps will reproduce the problem? % cd ssh % go test -run TestHandshakeBasic What is the expected output? What do you see instead? The test is timing out because io.ReadFull in cipher.go:137 (called from handshake_test.go:110) never returns. cpu% go test -v -timeout 30s -run TestHandshakeBasic === RUN TestHandshakeBasic panic: test timed out after 30s goroutine 25 [running]: runtime.panic(0x212240, 0x10570388) /usr/go/src/pkg/runtime/panic.c:279 +0xe3 testing.func·008() /usr/go/src/pkg/testing/testing.go:628 +0xd7 created by time.goFunc /usr/go/src/pkg/time/sleep.go:121 +0x49 goroutine 16 [chan receive]: testing.RunTests(0x320934, 0x413240, 0x57, 0x57, 0x21d01) /usr/go/src/pkg/testing/testing.go:504 +0x74a testing.Main(0x320934, 0x413240, 0x57, 0x57, 0x410a80, 0x5, 0x5, 0x41abc0, 0x0, 0x0) /usr/go/src/pkg/testing/testing.go:435 +0x6d main.main() code.google.com/p/go.crypto/ssh/_test/_testmain.go:229 +0x85 goroutine 19 [finalizer wait]: runtime.park(0x120d0, 0x415618, 0x4141a9) /usr/go/src/pkg/runtime/proc.c:1354 +0x8f runtime.parkunlock(0x415618, 0x4141a9) /usr/go/src/pkg/runtime/proc.c:1370 +0x3e runfinq() /usr/go/src/pkg/runtime/mgc0.c:2624 +0xc3 runtime.goexit() /usr/go/src/pkg/runtime/proc.c:1430 goroutine 21 [chan receive]: code.google.com/p/go.crypto/ssh.TestHandshakeBasic(0x10589260) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake_test.go:110 +0x27c testing.tRunner(0x10589260, 0x41333c) /usr/go/src/pkg/testing/testing.go:422 +0x86 created by testing.RunTests /usr/go/src/pkg/testing/testing.go:503 +0x70e goroutine 22 [syscall]: syscall.Syscall6(0x7, 0x10549000, 0x1000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x0, 0x13658639, 0x3b9aca00, ...) /usr/go/src/pkg/syscall/asm_plan9_386.s:54 +0x5 syscall.Pread(0x7, 0x10549000, 0x1000, 0x1000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x0) /usr/go/src/pkg/syscall/zsyscall_plan9_386.go:118 +0x8f syscall.Read(0x7, 0x10549000, 0x1000, 0x1000, 0x3074fbcc, 0x0, 0x0) /usr/go/src/pkg/syscall/syscall_plan9.go:123 +0x75 os.(*File).read(0x10570528, 0x10549000, 0x1000, 0x1000, 0x178ba1, 0x0, 0x0) /usr/go/src/pkg/os/file_plan9.go:247 +0x6a os.(*File).Read(0x10570528, 0x10549000, 0x1000, 0x1000, 0x7, 0x0, 0x0) /usr/go/src/pkg/os/file.go:95 +0x8b net.(*netFD).Read(0x105b04c0, 0x10549000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/net/fd_plan9.go:134 +0xfa net.(*conn).Read(0x10570538, 0x10549000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/net/net.go:122 +0x8f bufio.(*Reader).fill(0x105d8f00) /usr/go/src/pkg/bufio/bufio.go:97 +0x14d bufio.(*Reader).Read(0x105d8f00, 0x10616250, 0x5, 0x5, 0x5, 0x0, 0x0) /usr/go/src/pkg/bufio/bufio.go:175 +0x193 io.ReadAtLeast(0x3053e908, 0x105d8f00, 0x10616250, 0x5, 0x5, 0x5, 0x0, 0x0, 0x0) /usr/go/src/pkg/io/io.go:289 +0xca io.ReadFull(0x3053e908, 0x105d8f00, 0x10616250, 0x5, 0x5, 0x105880c0, 0x0, 0x0) /usr/go/src/pkg/io/io.go:307 +0x71 code.google.com/p/go.crypto/ssh.(*streamPacketCipher).readPacket(0x10616240, 0x3, 0x3053e908, 0x105d8f00, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/cipher.go:137 +0xd3 code.google.com/p/go.crypto/ssh.(*connectionState).readPacket(0x10586bd0, 0x105d8f00, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/transport.go:110 +0xb1 code.google.com/p/go.crypto/ssh.(*transport).readPacket(0x10586bd0, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/transport.go:106 +0x62 code.google.com/p/go.crypto/ssh.(*handshakeTransport).readOnePacket(0x10586cf0, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake.go:153 +0xc1 code.google.com/p/go.crypto/ssh.(*handshakeTransport).readLoop(0x10586cf0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake.go:133 +0x2d created by code.google.com/p/go.crypto/ssh.newClientTransport /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake.go:101 +0xb5 goroutine 23 [syscall]: syscall.Syscall6(0x9, 0x105e2000, 0x1000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x8, 0x0, 0x0, ...) /usr/go/src/pkg/syscall/asm_plan9_386.s:54 +0x5 syscall.Pread(0x9, 0x105e2000, 0x1000, 0x1000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x0) /usr/go/src/pkg/syscall/zsyscall_plan9_386.go:118 +0x8f syscall.Read(0x9, 0x105e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/syscall/syscall_plan9.go:123 +0x75 os.(*File).read(0x10570548, 0x105e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/os/file_plan9.go:247 +0x6a os.(*File).Read(0x10570548, 0x105e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/os/file.go:95 +0x8b net.(*netFD).Read(0x105b0500, 0x105e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/net/fd_plan9.go:134 +0xfa net.(*conn).Read(0x10570558, 0x105e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0) /usr/go/src/pkg/net/net.go:122 +0x8f bufio.(*Reader).fill(0x105d8f30) /usr/go/src/pkg/bufio/bufio.go:97 +0x14d bufio.(*Reader).Read(0x105d8f30, 0x10589ed0, 0x5, 0x5, 0x5, 0x0, 0x0) /usr/go/src/pkg/bufio/bufio.go:175 +0x193 io.ReadAtLeast(0x3053e908, 0x105d8f30, 0x10589ed0, 0x5, 0x5, 0x5, 0x0, 0x0, 0x0) /usr/go/src/pkg/io/io.go:289 +0xca io.ReadFull(0x3053e908, 0x105d8f30, 0x10589ed0, 0x5, 0x5, 0x14, 0x0, 0x0) /usr/go/src/pkg/io/io.go:307 +0x71 code.google.com/p/go.crypto/ssh.(*streamPacketCipher).readPacket(0x10589ec0, 0xd, 0x3053e908, 0x105d8f30, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/cipher.go:137 +0xd3 code.google.com/p/go.crypto/ssh.(*connectionState).readPacket(0x10586c60, 0x105d8f30, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/transport.go:110 +0xb1 code.google.com/p/go.crypto/ssh.(*transport).readPacket(0x10586c60, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/transport.go:106 +0x62 code.google.com/p/go.crypto/ssh.(*handshakeTransport).readOnePacket(0x10586d80, 0x0, 0x0, 0x0, 0x0, 0x0) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake.go:153 +0xc1 code.google.com/p/go.crypto/ssh.(*handshakeTransport).readLoop(0x10586d80) /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake.go:133 +0x2d created by code.google.com/p/go.crypto/ssh.newServerTransport /mnt/term/home/djc/go/src/code.google.com/p/go.crypto/ssh/handshake.go:108 +0xa5 exit status: 'ssh.test 520875: 2' FAIL code.google.com/p/go.crypto/ssh 31.912s</pre>
OS-Plan9
low
Minor
51,287,230
go
misc/gdb: breakpoints break things
<pre>What steps reproduce the problem? hg clone tip cd $GOROOT/src ./make.bash cd pkg/net/http go test -c gdb ./http.test break strings.Repeat run What happened? Reading symbols from /home/albert/go/src/pkg/net/http/http.test...done. Loading Go Runtime support. (gdb) break strings.Repeat Breakpoint 1 at 0x535cfb: strings.Repeat. (2 locations) (gdb) run Starting program: /home/albert/go/src/pkg/net/http/http.test [Thread debugging using libthread_db enabled] Using host libthread_db library &quot;/lib64/libthread_db.so.1&quot;. [New Thread 0x7ffff7e2b700 (LWP 12059)] runtime: unexpected return pc for flag.(*FlagSet).parseOne called from 0x1a runtime: unexpected return pc for flag.(*FlagSet).parseOne called from 0x1a fatal error: unknown caller pc runtime stack: runtime.throw(0xa0b471) /home/albert/go/src/pkg/runtime/panic.c:520 +0x69 fp=0x7fffffffd8d8 runtime.gentraceback(0x40a962, 0xc2080674a8, 0x0, 0xc208002120, 0xc200000000, 0x0, 0x7fffffff, 0x4090c0, 0x7fffffffdaa0, 0x0) /home/albert/go/src/pkg/runtime/traceback_x86.c:167 +0x819 fp=0x7fffffffd9a0 addstackroots(0xc208002120, 0x7fffffffdaa0) /home/albert/go/src/pkg/runtime/mgc0.c:1676 +0x168 fp=0x7fffffffda30 markroot(0xc20800c900, 0x2b00000005) /home/albert/go/src/pkg/runtime/mgc0.c:1309 +0xbe fp=0x7fffffffdab0 runtime.parfordo(0xc20800c900) /home/albert/go/src/pkg/runtime/parfor.c:88 +0xa3 fp=0x7fffffffdb28 gc(0xc2080674c0) /home/albert/go/src/pkg/runtime/mgc0.c:2387 +0x1d6 fp=0x7fffffffdc58 mgc(0xc208002120) /home/albert/go/src/pkg/runtime/mgc0.c:2329 +0x2e fp=0x7fffffffdc68 runtime.mcall(0x42b587) /home/albert/go/src/pkg/runtime/asm_amd64.s:181 +0x4b fp=0x7fffffffdc78 goroutine 16 [garbage collection]: runtime.gc(0xc200000000) /home/albert/go/src/pkg/runtime/mgc0.c:2309 +0x1b2 fp=0xc2080674d0 runtime.mallocgc(0xbdc000, 0x6ff561, 0x1) /home/albert/go/src/pkg/runtime/malloc.goc:204 +0x1d6 fp=0xc208067538 cnew(0x6ff560, 0xbdb328, 0x1) /home/albert/go/src/pkg/runtime/malloc.goc:835 +0xc1 fp=0xc208067558 runtime.cnewarray(0x6ff560, 0xbdb328) /home/albert/go/src/pkg/runtime/malloc.goc:848 +0x3a fp=0xc208067578 makeslice1(0x6ed6c0, 0x0, 0xbdb328, 0xc2080675d8) /home/albert/go/src/pkg/runtime/slice.goc:55 +0x4d fp=0xc208067590 runtime.makeslice(0x6ed6c0, 0x0, 0xbdb328, 0x0, 0x0, 0xbdb328) /home/albert/go/src/pkg/runtime/slice.goc:36 +0xb3 fp=0xc2080675c0 strconv.quoteWith(0x53605a, 0x7e7770, 0x22, 0x0, 0x0) /home/albert/go/src/pkg/strconv/quote.go:15 +0x79 fp=0xc2080676a8 strconv.Quote(0x53605a, 0x7e7770, 0x0, 0x0) /home/albert/go/src/pkg/strconv/quote.go:91 +0x4d fp=0xc2080676d8 fmt.(*fmt).fmt_q(0xc208026060, 0x53605a, 0x7e7770) /home/albert/go/src/pkg/fmt/format.go:334 +0x11f fp=0xc208067728 fmt.(*pp).fmtString(0xc208026000, 0x53605a, 0x7e7770, 0x71) /home/albert/go/src/pkg/fmt/print.go:517 +0xa2 fp=0xc208067758 fmt.(*pp).printArg(0xc208026000, 0x6ff160, 0xc208000f20, 0x71, 0x0, 0x0) /home/albert/go/src/pkg/fmt/print.go:780 +0xabb fp=0xc2080677d8 fmt.(*pp).doPrintf(0xc208026000, 0x85b1f0, 0x24, 0xc208067dd0, 0x3, 0x3) /home/albert/go/src/pkg/fmt/print.go:1159 +0x2044 fp=0xc208067b20 fmt.Sprintf(0x85b1f0, 0x24, 0xc208067dd0, 0x3, 0x3, 0x0, 0x0) /home/albert/go/src/pkg/fmt/print.go:203 +0x7c fp=0xc208067b70 fmt.Errorf(0x85b1f0, 0x24, 0xc208067dd0, 0x3, 0x3, 0x0, 0x0) /home/albert/go/src/pkg/fmt/print.go:212 +0x6c fp=0xc208067bc8 flag.(*FlagSet).failf(0x5432d1, 0x85b1f0, 0x24, 0xc208067dd0, 0x3, 0x3, 0x0, 0x0) /home/albert/go/src/pkg/flag/flag.go:694 +0x83 fp=0xc208067c68 runtime: unexpected return pc for flag.(*FlagSet).parseOne called from 0x1a flag.(*FlagSet).parseOne(0x5432d1, 0xc20802c120, 0xc208000010, 0x0) /home/albert/go/src/pkg/flag/flag.go:758 +0x76a fp=0xc208067e08 created by _rt0_go /home/albert/go/src/pkg/runtime/asm_amd64.s:97 +0x120 goroutine 17 [runnable]: runtime.MHeap_Scavenger() /home/albert/go/src/pkg/runtime/mheap.c:507 fp=0x7ffff7febfa8 runtime.goexit() /home/albert/go/src/pkg/runtime/proc.c:1430 fp=0x7ffff7febfb0 created by runtime.main /home/albert/go/src/pkg/runtime/proc.c:207 goroutine 18 [runnable]: bgsweep() /home/albert/go/src/pkg/runtime/mgc0.c:1960 fp=0x7ffff7fdcfa8 runtime.goexit() /home/albert/go/src/pkg/runtime/proc.c:1430 fp=0x7ffff7fdcfb0 created by runtime.gc /home/albert/go/src/pkg/runtime/mgc0.c:2249 goroutine 19 [runnable]: runfinq() /home/albert/go/src/pkg/runtime/mgc0.c:2586 fp=0x7ffff7feafa8 runtime.goexit() /home/albert/go/src/pkg/runtime/proc.c:1430 fp=0x7ffff7feafb0 created by runtime.gc /home/albert/go/src/pkg/runtime/mgc0.c:2249 [Thread 0x7ffff7e2b700 (LWP 12059) exited] [Inferior 1 (process 12055) exited with code 02] Please provide any additional information below. Fedora Core 20 x86_64 with most updates installed gdb-7.6.50.20130731-19.fc20.x86_64</pre>
NeedsInvestigation
low
Critical
51,287,253
go
reflect: Call is slow
<pre>reflect.Value.Call is pretty slow. In addition to always allocating a slice for its []reflect.Value result parameters, it also does a lot of prep work on each call. It would be nice to both avoid that allocation and also do the setup checks just once. Maybe a new method to return some sort of 'Caller' type that makes repeated Calls faster, with less paranoia and no allocation. Or just speed up the checks and make a new Call method that also accepts a slice for the result values.</pre>
Performance,GarbageCollector,help wanted
medium
Major
51,287,260
go
x/pkgsite: conditionally expose unexported types
<pre>Currently godoc only exposes the documentation of exported types, vars, etc. However, there are a number of cases where it would be convenient to expose unexported types: when there is a variable or constant of that type and when a function or method takes or returns values of that type. If the unexported type has exported methods, this allows them to be shown in godoc. It is less important if it does not, but it would still allow godoc to render a link to that type, showing its docs, consts, and vars. The same effect, of course, can be generated by exporting the type, but leaving it unexported, if nothing else, is a signal that users should not create arbitrary values of this type, which has to be manually documented if you export the type. This is related, conceptually and likely implementation-wise, to <a href="https://golang.org/issue/5860">issue #5860</a>, <a href="https://golang.org/issue/5397">issue #5397</a> and its duplicate (that contains more information) <a href="https://golang.org/issue/7815">issue #7815</a></pre>
NeedsInvestigation,pkgsite
low
Major
51,287,322
go
x/tools/cmd/eg: No way to rewrite expressions that include unexported identifiers
<pre>Because of the way that eg parses the template files, you can't refer to unexported identifiers inside the before and after functions. Possibility is to include the package files when parsing the template file, so that it can refer to the unexported identifiers.</pre>
NeedsInvestigation
low
Minor
51,287,338
go
encoding/json: Encoder internally buffers full output
<pre>What does 'go version' print? go version devel +2f6b9f80be36 Fri Apr 25 09:46:07 2014 -0600 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Use json.NewEncoder(writer).Encode(value) What happened? Each call to json.Encoder.Encode uses an internal bytes.Buffer to buffer all encoded output prior to writing any of that output. What should have happened instead? Output should use little or no internal buffering. Encoder should be able to efficiently encode (and incrementally output) very large inputs.</pre>
NeedsFix
medium
Critical
51,287,371
go
database/sql: nested transaction or save point support
<pre>It might be useful to consider supporting nested transactions when a particular driver/DB combo is able to support that. #Go 1.4+</pre>
help wanted,Proposal,Proposal-Accepted,FeatureRequest
high
Critical
51,287,376
go
os: add a semaphore in front of the filesystem?
<pre>I'd like to investigate putting a semaphore in front of the pkg/os filesystem operations, so massive numbers of goroutines attempting filesystem I/O don't create threads each and make the operating system cry. There are deadlock concerns, but perhaps we can do it per filesystem id, or learn the limits, etc.</pre>
NeedsInvestigation
medium
Major
51,287,381
go
proposal: net/http/httputil/v2: remove ClientConn, ServerConn
<pre>These have been deprecated in Go1.3 ( <a href="https://golang.org/cl/92790043/">https://golang.org/cl/92790043/</a> ), but cannot be removed because of the compatibility guarantee. This is a bug to track them to be removed from Go2.</pre>
v2,Proposal
low
Critical
51,287,403
go
cmd/compile, bytes: bootstrap array causes bytes.Buffer to always be heap-allocated
<pre>What steps reproduce the problem? 1. Download playground.zip 2. Run go build -gcflags=-m bytes.go 3. Run go build -gcflags=-m bytes2.go playground/bytes: Resembles a simplified version of Go's bytes.Buffer, with the exception that NewBuffer returns Buffer{} instead of &amp;Buffer{}. playground/bytes2: Different implementation that avoids reslicing What happened? $ go build -gcflags=-m bytes.go # playground/bytes bytes/buffer.go:12: can inline NewBuffer bytes/buffer.go:57: can inline (*Buffer).Read bytes/buffer.go:69: can inline (*Buffer).Bytes bytes/buffer.go:12: leaking param: b to result ~anon1 bytes/buffer.go:16: leaking param: b bytes/buffer.go:16: leaking param: b bytes/buffer.go:34: make([]byte, 2 * cap(b.buf) + n) escapes to heap bytes/buffer.go:16: leaking param: b bytes/buffer.go:44: leaking param: b bytes/buffer.go:44: leaking param: b bytes/buffer.go:52: leaking param: b bytes/buffer.go:52: (*Buffer).Write p does not escape bytes/buffer.go:57: (*Buffer).Read b does not escape bytes/buffer.go:57: (*Buffer).Read p does not escape bytes/buffer.go:69: (*Buffer).Bytes b does not escape # command-line-arguments ./bytes.go:9: inlining call to bytes.NewBuffer ./bytes.go:13: inlining call to Read ./bytes.go:18: inlining call to Bytes ./bytes.go:9: moved to heap: myBuf ./bytes.go:11: myBuf escapes to heap ./bytes.go:8: make([]byte, 4) escapes to heap ./bytes.go:14: myBuf escapes to heap ./bytes.go:8: make([]byte, 4) escapes to heap ./bytes.go:11: main []byte literal does not escape ./bytes.go:12: main make([]byte, 2) does not escape ./bytes.go:13: main myBuf does not escape ./bytes.go:14: main []byte literal does not escape ./bytes.go:18: main myBuf does not escape $ go build -gcflags=-m bytes2.go # playground/bytes2 bytes2/buffer.go:13: can inline NewBuffer bytes2/buffer.go:61: can inline (*Buffer).Read bytes2/buffer.go:73: can inline (*Buffer).Bytes bytes2/buffer.go:13: leaking param: b to result ~anon1 bytes2/buffer.go:38: make([]byte, size) escapes to heap bytes2/buffer.go:17: (*Buffer).grow b does not escape bytes2/buffer.go:47: (*Buffer).Grow b does not escape bytes2/buffer.go:54: (*Buffer).Write b does not escape bytes2/buffer.go:54: (*Buffer).Write p does not escape bytes2/buffer.go:61: (*Buffer).Read b does not escape bytes2/buffer.go:61: (*Buffer).Read p does not escape bytes2/buffer.go:73: (*Buffer).Bytes b does not escape # command-line-arguments ./bytes2.go:9: inlining call to bytes2.NewBuffer ./bytes2.go:13: inlining call to Read ./bytes2.go:18: inlining call to Bytes ./bytes2.go:8: main make([]byte, 4) does not escape ./bytes2.go:11: main myBuf does not escape ./bytes2.go:11: main []byte literal does not escape ./bytes2.go:12: main make([]byte, 2) does not escape ./bytes2.go:13: main myBuf does not escape ./bytes2.go:14: main myBuf does not escape ./bytes2.go:14: main []byte literal does not escape ./bytes2.go:18: main myBuf does not escape # command-line-arguments What should have happened instead? This shouldn't be happening with playground/bytes: ./bytes.go:9: moved to heap: myBuf ./bytes.go:11: myBuf escapes to heap ./bytes.go:8: make([]byte, 4) escapes to heap ./bytes.go:14: myBuf escapes to heap ./bytes.go:8: make([]byte, 4) escapes to heap A re-slicing shouldn't cause playground/bytes's Buffer to always be heap allocated. It should be like playground/bytes2, which avoids heap allocation until a resize happens: bytes2/buffer.go:38: make([]byte, size) escapes to heap Please provide any additional information below. If this is working as intended, the implementation of bytes.Buffer should change to allow it to be completely stack allocated. The playground/bytes2 implementation is completely stack allocated until the initial buffer needs to be resized. This allows it to operate on the stack, avoiding a heap allocation if possible.</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/7921/0/playground.zip">playground.zip</a> (5470 bytes)
help wanted,NeedsFix
medium
Critical
51,287,406
go
cmd/compile: rethink temporary names
<pre>package p func conv() { var f float64 _ = float64(uint64(f)) } go version devel +b0443478e712 Thu May 01 16:29:34 2014 -0400 darwin/386 go tool 8g -S conv.go The assembly listing includes: 0x00b7 00183 (conv.go:5) FMOVDP F0,&quot;&quot;.autotmp_0001+20(SP) 0x00bb 00187 (conv.go:5) JMP ,130 0x00bd 00189 (conv.go:5) FSTCW ,&quot;&quot;..utotmp_0004+2(SP) 0x00c1 00193 (conv.go:5) MOVW $3967,&quot;&quot;..utotmp_0005+0(SP) 0x00c7 00199 (conv.go:5) FLDCW &quot;&quot;..utotmp_0005+0(SP), 0x00ca 00202 (conv.go:5) FMOVD $f64.43e0000000000000+0(SB),F0 0x00d0 00208 (conv.go:5) FUCOMIP F0,F1 0x00d2 00210 (conv.go:5) JLS ,225 0x00d4 00212 (conv.go:5) FMOVVP F0,&quot;&quot;.autotmp_0003+12(SP) 0x00d8 00216 (conv.go:5) FLDCW &quot;&quot;..utotmp_0004+2(SP), Note the variable names &quot;&quot;..utotmp_0004 and &quot;&quot;..utotmp_0005. There is downstream code that checks for the &quot;autotmp&quot; prefix, so this name corruption is potentially significant. Not all autotmp names are corrupted (see &quot;&quot;.autotmp_0001). I've not seen name corruption with either 5g or 6g.</pre>
NeedsInvestigation
low
Major
51,287,409
go
runtime: improve goroutine profiler
<pre>Some concrete suggestions: 1. Add goroutine state (waiting, runnable, syscall) as comment in debug more and/or as top frame (so that all waiting goroutines converge in a single &quot;Waiting&quot; block in svg graph. 2. Add &quot;created by&quot; line in debug mode. 3. Dedup stacks, there can be thousands of equal stacks.</pre>
NeedsInvestigation
low
Critical
51,287,413
go
x/net/html: Tokenizer cannot round-trip <script> tag contents
by **[email protected]**: <pre>I'm not sure if this is a bug or working as intended according to the HTML5 parsing algorithm, but it seems at least problematic from a user's perspective. When parsing an HTML document that contains &lt;script&gt; tags, writing out the tokens received will double escape any contained entities, thus &lt;script&gt; tags don't round-trip through the tokenizer. See the attached patch which adds two tests for &lt;script&gt;&quot;&lt;/script&gt; (which leads to &amp;#24; as the contents) and &lt;script&gt;&amp;#34;&lt;/script&gt;, which leads to &amp;amp;#34;. That means re-parsing the output of tokenization adds more and more double escaping. There is a test for &lt;style&gt; just below the one I added that makes this look intentional. But this is a real problem: using go.net/html to parse and re-serialize documents breaks the documents.</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/7929/0/script_tags_test.diff">script_tags_test.diff</a> (494 bytes)
NeedsInvestigation
low
Critical
51,287,429
go
x/crypto/ssh/terminal: does not handle interruptions
by **[email protected]**: <pre>go.crypto/ssh/terminal does not handle interruptions. Instead of ignoring an interruption terminal should return with error allowing the caller to handle interruption e.g. restore terminal state before exiting.</pre>
NeedsInvestigation
low
Critical
51,287,445
go
crypto/tls: tls.Dial get error "local error: unexpected message"
by **webluoye**: <pre>What does 'go version' print? go version go1.2.1 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. cert, err := tls.LoadX509KeyPair(&quot;eeee.crt&quot;, &quot;eeee.pem&quot;) if err != nil { log.Fatalf(&quot;server: loadkeys: %s&quot;, err) } config := tls.Config{Certificates: []tls.Certificate{cert},ClientAuth:tls.VerifyClientCertIfGiven,InsecureSkipVerify: true} conn, err := tls.Dial(&quot;tcp&quot;, &quot;218.241.106.8:4121&quot;, &amp;config) if err != nil { log.Fatalf(&quot;client DialTCP: %s&quot;, err) } What happened? tls.Dial get error message &quot;client DialTCP: local error: unexpected message&quot; What should have happened instead? it can connect use eeee.pem and eeee.crt via openssl Please provide any additional information below. openssl s_client -connect 218.241.106.8:4121 -cert eeee.crt -key eeee.pem -state -showcerts --- SSL handshake has read 19310 bytes and written 1018 bytes --- New, TLSv1/SSLv3, Cipher is EDH-RSA-DES-CBC3-SHA Server public key is 1024 bit Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : EDH-RSA-DES-CBC3-SHA Session-ID: 536B3891C89AACE7E71ACF2D6F3D9D8A723025CD1711863FE075C24F278B7F8D Session-ID-ctx: Master-Key: E895BA788756B389744916D6790AD116CF6B669B2242C880791FAF049D9D22183F1750A2CE60BEFA108B79938007B566 Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None Start Time: 1399535765 Timeout : 300 (sec) Verify return code: 18 (self signed certificate) --- &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</pre>
NeedsInvestigation
low
Critical
51,287,446
go
x/tools/cmd/present: poor experience on Android Chrome
by **[email protected]**: <pre>When trying to view a &quot;present&quot; slide deck (e.g. <a href="http://talks.golang.org/2014/c2go.slide)">http://talks.golang.org/2014/c2go.slide)</a>, chrome on android attempts to do some auto-resizing so that three slides are all completely viewable. This makes the slides very small, and puts a large blank area below the slides. If I attempt to resize the page (via the two-finger resize gesture), I can attempt to fix this. But eventually, while swiping the slides left or right, I'll hit the beginning or end of the deck, and either the slide will be resized, or the current slide will be partially off-screen.</pre>
Suggested
low
Minor
51,287,502
go
spec: Go spec method expressions/values - tidy up
by **xunfin**: <pre>As per note at Golang Nuts <a href="https://groups.google.com/forum/#">https://groups.google.com/forum/#</a>!topic/golang-nuts/6ltLyMGuAS8 The two sections <a href="http://golang.org/ref/spec#Method_expressions">http://golang.org/ref/spec#Method_expressions</a> and <a href="http://golang.org/ref/spec#Method_values">http://golang.org/ref/spec#Method_values</a> are a little verbose (much more than a full verticle screen each - in contrast to most/all other sections in spec) and maybe have too many examples. I suggested that stating &quot;if t is a variable of type T and M(x) is in the method set of T then: T.M(t,x) is the same as t.M(x)&quot; Could help in clarifying (see original post) There is no issue with behaviour or specification - just length/clarity of text.</pre>
Documentation,NeedsInvestigation
low
Minor
51,287,518
go
x/arch/x86/x86asm: Mem.Disp is positive for negative displacements
<pre>The instruction 48 8b 0c 25 c0 5c 07 80 is disassembled as MOVQ 0x80075cc0, CX. It should be disassembled as MOVQ 0xffffffff80075cc0, CX. Addresses are signed, and should be sign-extended. See the discussion in <a href="https://golang.org/issue/7980">issue #7980</a> for details. To reproduce, run 'go tool objdump addr31 0x2000 0x2012'. addr31 is attached. It was created by stripping a binary built from the code in <a href="https://golang.org/issue/7980">issue #7980</a>.</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/8000/0/addr31.gz">addr31.gz</a> (153196 bytes)
NeedsInvestigation
low
Minor
51,287,615
go
image: decode / resize into an existing buffer
<pre>The image/foo packages currently provide foo.Decode functions that allocate a new image buffer. It would be nice, especially when decoding a moving image, to decode into an existing buffer. Also, it would be nice to be able to resize an image during (and not after) decoding, which can obviously allocate a smaller buffer but can also be faster. Apparently Imagemagick can do this for JPEGs, and <a href="https://groups.google.com/forum/#">https://groups.google.com/forum/#</a>!topic/golang-nuts/13Gr_AmBAKY claims a 50% speedup for generating a thumbnail. The two concerns are superficially separate, but the API (if any) to do this should probably consider both use cases.</pre>
Thinking
low
Major
51,287,629
go
encoding/xml: empty namespace prefix definitions should be illegal
<pre>What does 'go version' print? go version go1.2 linux/amd64 What steps reproduce the problem? <a href="http://play.golang.org/p/f8UWfdF7Hb">http://play.golang.org/p/f8UWfdF7Hb</a> What happened? No-error. What should have happened instead? Should generate an error. Per <a href="http://www.w3.org/TR/REC-xml-names/#dt-prefix">http://www.w3.org/TR/REC-xml-names/#dt-prefix</a> a prefix must refer to a namespace name, not the empty string. Please provide any additional information below. Ran into this in implementing webdav, the litmus tests test this error condition [and due to xml.Token hiding prefixing it is impossible to detect otherwise]</pre>
NeedsInvestigation
low
Critical
51,287,633
go
crypto/tls: a timeout error on tls.Conn.Write is confusing
<pre>SetWriteDeadline of tls.Conn describes &quot;A zero value for t means Write will not time out. After a Write has timed out, the TLS state is corrupt and all future writes will return the same error.&quot; but the returned value on timeout is marked Temporary and it may be confusing. A suggestion: <a href="https://groups.google.com/d/msg/golang-nuts/UChb8wv6gvA/9R_g4ScTMiYJ">https://groups.google.com/d/msg/golang-nuts/UChb8wv6gvA/9R_g4ScTMiYJ</a></pre>
NeedsDecision
low
Critical
51,287,651
go
proposal: spec: represent interfaces by their definition and not by package and name
<pre>An interface is a collection of method names and signatures. Say, we have: package a type Writer interface { Write([]byte) (int, error) } type WriterTo interface { WriteTo(Writer) (int64, error) } type WriterTo2 interface { WriteTo(w interface{Write([]byte) (int, error)} (int64, error) } From the perspective of the one writing an implementation, the a.Writer and io.Writer are the same: As long as the Write method has the right signature they are both fulfilled. However a.WriterTo and io.WriterTo are not, simply because they refer to Writers of different packages although they have the same definition. Even WriterTo2 would only be compatible with io.WriterTo if they later had an anonymous interface too. see <a href="http://play.golang.org/p/kOH11TOlsE">http://play.golang.org/p/kOH11TOlsE</a> Since interfaces are all about reusable code this behaviour must be considered an artifact of the way, interfaces are represented and treated during compilation. Since interfaces have no methods and no values, their only value is to help the programmers via the type constraints. From the implementation perspective a.WriterTo, io.WriterTo and a.WriterTo2 must be treated as being the same, a contraint to have a method WriteTo(w interface{Write([]byte) (int, error)} (int64, error). The names (and packages) of the interfaces should not be relevant for the compiler. Instead the definition should be the representation and the names just shortcuts to refer to them.</pre>
LanguageChange,Proposal,LanguageChangeReview
high
Critical
51,287,662
go
cmd/gofmt: gofmt doesn't ignore directories prefixed with _
by **[email protected]**: <pre>go test ./... ignores directories prefixed with _. This is convenient and seems like a reasonable rule of thumb. gofmt -w . does *not* honor this &quot;rule&quot; With the ascendance of Godeps there are now Godeps/_workspace folders vendoring dependencies all over the place. Having gofmt -w . rewrite my dependencies is painful. Any change the &quot;ignore _&quot; rule could be ported over to gofmt sometime soon? Would be happy to work on a pull request for this.</pre>
Thinking
low
Minor
51,287,666
go
cmd/compile: report all missing methods on failed interface satisfaction
<pre>If a type does not implement an interface, the compiler currently only reports one error. It would be nice if it reported more errors. <a href="http://play.golang.org/p/ayvTDLAJiZ">http://play.golang.org/p/ayvTDLAJiZ</a></pre>
NeedsInvestigation
low
Critical
51,287,678
go
cmd/compile: does not understand old linker flags
<pre>liblink/obj6.c uses ctxt-&gt;debugstack to emit stack underflow checks. The flag was meant to be initialized from -K 6l flag. But now liblink is invoked from the compiler. And the compiler does not initialize ctxt-&gt;debugstack. Moreover the compiler already uses -K flag for a different purpose. I suspect this relates to a bunch of other flags as well. We need to choose some other names for the old linker flags and read them in all users of liblink.</pre>
NeedsInvestigation
low
Critical
51,287,696
go
cmd/cgo: Allow C code to use structures defined in Go
by **fuzxxl**: <pre>There are some C structures that cannot be correctly accessed from Go code as Go does not provide the features needed to access them. Examples are unions, bitfields and structures that are affected by issue #7560. Therefore, C code is needed to unmarshall and marshall these structures into Go code. Sadly, this is very uggly to do right now as there seems to be no sane way of having a C function operate on types defined in Go code. Right now, I have to define the structure I'm marshalling into on the C side of code which requires me to marshall the already marshalled structure again if I want to provide that structure as an interface to other packages. Ideally, something like this is possible: package example /* #include &quot;go.h&quot; // struct I want to marshall struct something { // ... } void marshall_something(struct something *s, GoSomething *g) { // unmarshall s into g } */ import &quot;C&quot; //export type something struct { // corresponding Go type that is visible to C // ... }</pre>
NeedsInvestigation
low
Minor
51,287,756
go
spec: define "interface value"
by **[email protected]**: <pre>The spec mentions &quot;interface value&quot; seven times but does not define the term. Defining the term carefully would help to avoid some common misunderstandings, most notably <a href="http://golang.org/doc/faq#nil_error">http://golang.org/doc/faq#nil_error</a>. The spec says &quot;Two interface values are equal if they have identical dynamic types and equal dynamic values or if both have value nil.&quot; from which we can infer: 1. An interface value may have a dynamic type, and 2. An interface value may have a dynamic value, and either 3a. An interface value may have value nil, or 3b. An interface value may be nil. I think the spec sentence should really say &quot;Two interface values are equal if [...] or if both are nil.&quot; which would imply 3b rather than 3a. The spec also says &quot;The static type (or just type) of a variable is the type defined by its declaration. Variables of interface type also have a distinct dynamic type, which is the actual type of the value stored in the variable at run time. The dynamic type may vary during execution but is always assignable to the static type of the interface variable. For non-interface types, the dynamic type is always the static type.&quot; from which we can additionally infer (assuming a variable of interface type always contains an interface value): 4. An interface value has a static type which is the interface type of the value. Notice that 4 doesn't appear to be true for nil interface values, so I think the above paragraph needs fixing too (&quot;[...] Non-nil variables of interface type also have a distinct dynamic type, [...]&quot;) Although I suspect the FAQ isn't normative, it provides a helpful insight, &quot;[...] the return value is an error interface value holding (*MyError, nil)&quot;, from which we can infer: 5. The interface value may have a nil dynamic value. Here is a speculative description of an interface value, with some educated guesses thrown in, to give an impression of where all this might lead: An interface value is the value of a variable of interface type. An interface value is either nil or has both a dynamic type and a dynamic value. A nil interface value always results from [is assigned from, passed as a parameter, returned, etc.] a literal nil value since any other value has a non-nil dynamic type. The static type of an interface value is an interface type [and it would be nice to spell out *which* interface type!]. If a non-nil interface value has a non-nil dynamic value, then the actual type of the dynamic value is equal to the dynamic type of the interface value. The dynamic value of a non-nil interface value may be nil. The dynamic type of a non-nil interface value is never nil. The dynamic type of a non-nil interface value implements the static type of the interface value. An interface value compares (==) equal to nil if and only if it is nil; a non-nil interface value never compares (==) equal to nil. [This latter statement may be out of place in the definition of interface value, but should at least be linked to from the definition. But given <a href="http://golang.org/doc/faq#nil_error">http://golang.org/doc/faq#nil_error</a>, it may be worth having some repetition of this point.]</pre>
Documentation,NeedsInvestigation
low
Critical
51,287,787
go
encoding/xml: disallow attributes named xmlns:*
by **opennota**: <pre>The Encoder will add namespaced to the elements, even if there are the same namespaces in the parent element: <a href="http://play.golang.org/p/LDRJCxUJHX">http://play.golang.org/p/LDRJCxUJHX</a> // Output: // &lt;p xmlns=&quot;<a href="http://www.gribuser.ru/xml/fictionbook/2.0&quot">http://www.gribuser.ru/xml/fictionbook/2.0&quot</a>; xmlns:l=&quot;<a href="http://www.w3.org/1999/xlink&quot">http://www.w3.org/1999/xlink&quot</a>;&gt;&lt;a xmlns=&quot;<a href="http://www.gribuser.ru/xml/fictionbook/2.0&quot">http://www.gribuser.ru/xml/fictionbook/2.0&quot</a>; xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink&quot">http://www.w3.org/1999/xlink&quot</a>; xlink:href=&quot;<a href="http://google.com&quot">http://google.com&quot</a>;&gt;google.com&lt;/a&gt;&lt;/p&gt; I expect it to not repeat the namespaces: // &lt;p xmlns=&quot;<a href="http://www.gribuser.ru/xml/fictionbook/2.0&quot">http://www.gribuser.ru/xml/fictionbook/2.0&quot</a>; xmlns:l=&quot;<a href="http://www.w3.org/1999/xlink&quot">http://www.w3.org/1999/xlink&quot</a>;&gt;&lt;a l:href=&quot;<a href="http://google.com&quot">http://google.com&quot</a>;&gt;google.com&lt;/a&gt;&lt;/p&gt;</pre>
NeedsFix,early-in-cycle
low
Major
51,287,791
go
cmd/vet: check for verb errors for fmt.Scanf
<pre>What does 'go version' print? go version go1.2.2 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Printf(&quot;test %d&quot;, f) where f is float is deemed a type error 2. Scanf(&quot;test %d&quot;, f) where f is float passes all type checking 3. <a href="http://play.golang.org/p/3OkpJ-RQeU">http://play.golang.org/p/3OkpJ-RQeU</a> 4. code sample will compile and pass go vet but fail at runtime What happened? Simple demo program using fmt.Scanf compiles and passes go vet check but error found at runtime. Analogous program using fmt.Printf with same error does not pass go vet check. What should have happened instead? go vet should produce similar checks in fmt.Scanf as is does for fmt.Printf Please provide any additional information below.</pre>
Analysis
low
Critical
51,287,838
go
cmd/vet: handle embedded fields in structtags check
<pre>The change at <a href="https://code.google.com/p/go/source/detail?r=dfa149f4c2fc&amp">https://code.google.com/p/go/source/detail?r=dfa149f4c2fc&amp</a>;repo=tools may need to be updated after <a href="https://golang.org/issue/7363">issue #7363</a> is resolved. Marking Go1.4 to match <a href="https://golang.org/issue/7363">issue #7363</a>.</pre>
Analysis
low
Minor
51,287,839
go
os: TestGetppid fails on plan9
<pre>--- FAIL: TestGetppid (0.02 seconds) os_test.go:1318: Child process reports parent process id '0', expected '917122' Alex</pre>
OS-Plan9,NeedsInvestigation
low
Major
51,287,863
go
cmd/vet: No warning for some statements with no effect
by **[email protected]**: <pre>What does 'go version' print? go version go1.2 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. In this toy example (which represents a pattern of bugs that crops up fairly frequently for our team), I have forgotten to make err a named return value in my deferred function. The intent was to propagate any error that occurred during execution of the deffered function, but since I forgot to make err a named return value, the error gets dropped. <a href="http://play.golang.org/p/MD8tetH4ZI">http://play.golang.org/p/MD8tetH4ZI</a> What happened? The program compiled and ran without error. What should have happened instead? The compiler should have errored that the statement &quot;err = e&quot; had no effect. Bonus points if it suggested that I might have meant to use a named return value.</pre>
Analysis
low
Critical
51,287,922
go
gdb: Wrong values for local variables
by **andreas.nusser**: <pre>What does 'go version' print? Tried with .)go version go1.3 linux/amd64 and .)go version devel +e0ad7e329637 Thu Jun 19 22:19:56 2014 -0700 linux/amd64 As gdb I'm using &quot;GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1.1+b1)&quot; What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Write a short test program similar to the one attached. (You can find it here too: <a href="http://play.golang.org./p/Y5b-t2iobd)">http://play.golang.org./p/Y5b-t2iobd)</a> 2. Compile it with go build -gcflags &quot;-N -l&quot; to prevent inlining 3. Run the resulting binary with gdb and observe as gdb reports wrong values for the local variables. It even doesn't report the changed value of &quot;z&quot; in line 13. What happened? - Instead of the values of the variables, gdb shows garbage. What should have happened instead? - gdb should show the correct values. Thanks for your help! Andreas</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/8256/0/gdb_fail.go">gdb_fail.go</a> (276 bytes)
NeedsInvestigation
low
Major
51,287,968
go
sync: per-cpu storage
<pre>Provide a way to create/access cpu local objects. This may make it easy to batch data per-CPU to reduce global locking. This is a feature request. Potential use case: scalable stats across many goroutines - stat updates are batched in the per-CPU stat object. Periodically or on-demand, the stat batches are aggregated to a global stat object. This is similar to sync.Pool in that it will help reducing lock contention, but different in that the object lifetime should be explicit and the per-CPU objects need to be accessible from other CPUs if necessary.</pre>
Thinking
medium
Critical
51,287,981
go
spec: unspecified or unclear behavior for arithmetic operators on named types
by **arnaud.porterie**: <pre>It seems that the following code is not fully specified: type MyType int [...] var m MyType m += 0 I understand that 0 being an untype constant, it can be used in a binary operation with a `MyType` operand. However, I cannot find what specifies that binary operations can be used on operands of type `MyType` (&quot;Arithmetic operators&quot; paragraph isn't really clear on that).</pre>
NeedsInvestigation
low
Minor
51,288,023
go
net: Checking errors for EPIPE and ECONNRESET requires syscall
<pre>Reading and writing can cause EPIPE and ECONNRESET to be returned in addition to io.EOF. _, err := conn.Write(data) if oe, ok := err.(*net.OpError); ok &amp;&amp; (oe.Err == syscall.EPIPE || oe.Err == syscall.ECONNRESET) { return fmt.Errorf(&quot;Connection closed&quot;) } _, err := conn.Read(data) oe, ok := err.(*net.OpError) if err == io.EOF || ok &amp;&amp; oe.Err == syscall.ECONNRESET { return fmt.Errorf(&quot;Connection closed&quot;) } This isn't the neatest solution, and if we're going to freeze and possibly internalize syscall, this is going to have to go. Perhaps something similar to os.IsExist? I'm thinking net.IsReset or net.IsClosed. Or we could simply return io.EOF for both. I don't know. And what about other operating systems? Do they have similar problems?</pre>
Thinking
low
Critical
51,288,035
go
x/net/tcp: provide a way to set keepalive time and interval separately
by **redforks**: <pre>func setKeepAlivePeriod() in net/tcpsockopt_unix.go is the back end of TCPConn.SetKeepAlivePeriod() on linux platform. It set both TCP_KEEPINTVL and TCP_KEEPIDLE to the period passed in: func setKeepAlivePeriod(fd *netFD, d time.Duration) error { if err := fd.incref(); err != nil { return err } defer fd.decref() // The kernel expects seconds so round to next highest second. d += (time.Second - time.Nanosecond) secs := int(d.Seconds()) err := os.NewSyscallError(&quot;setsockopt&quot;, syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, secs)) if err != nil { return err } return os.NewSyscallError(&quot;setsockopt&quot;, syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPIDLE, secs)) } Linux has three socket option affects keep alive: tcp_keepalive_time the interval between the last data packet sent (simple ACKs are not considered data) and the first keepalive probe; after the connection is marked to need keepalive, this counter is not used any further tcp_keepalive_intvl the interval between subsequential keepalive probes, regardless of what the connection has exchanged in the meantime tcp_keepalive_probes the number of unacknowledged probes to send before considering the connection dead and notifying the application layer If I am not wrong, first kernel waits for TCP_KEEPIDLE seconds than send a keep alive package (first probe), if not receive response from peer, wait TCP_KEEPINTVL seconds send keep alive package again until TCP_KEEPCNT times, then close the tcp connection. Linux default parameters is: TCP_KEEPIDLE: 7200 // 2 hours TCP_KEEPINTVL: 75 // 75 seconds TCP_KEEPCNT: 9 // try 9 times So default a connection will closed after 7200+75*9 seconds, about 2 hours and 11 minutes. Set both TCP_KEEPINTVL and TCP_KEEPIDLE to the same value normally is not we want. Such as: conn.SetKeepAlivePeriod(time.Hour) The actual effect is: 1 hour + 9 hour, after 10 hours kernel close the connection, it is much longer than OS default settings. I guess for compatible reason, SetKeepAlivePeriod() can not support all the three parameters that linux use, but at least not set TCP_KEEPINTVL.</pre>
NeedsInvestigation
low
Critical
51,288,047
go
cmd/vet: add hook for file level checker short-circuits
<pre>Some vet checks could be short-circuited at the file level. For example, the unsafe pointer checker could avoid running if unsafe has not been imported. Something similar holds for the atomic check, the cyclic finalizer test, and the template check (if it goes in). The asm check could probably be run only on .s files.</pre>
Performance,Analysis
low
Minor
51,288,059
go
cmd/compile: Opportunity for de-pessimization in provably const range loops
<pre>What does 'go version' print? go version go1.3 linux/amd64 What steps reproduce the problem? Using the 2-return 'range' over a slice of structs will copy each struct, even if the struct is provably not modified in the loop. This is a premature pessimization that the compiler could and should eliminate. Ideally the spec would guarantee this optimization (a la RVO in C++) so people could count on it and maybe even warn when it is not true. The for-each construct is much nicer to read and write, but this behavior sort of makes it a non-starter for large data. This is discussed in many places on the web, with the general recommendation of &quot;just iterate on index&quot;. This is unfortunate for the language. Alternatively: some syntax to say explicitly &quot;iterate by reference&quot; or by pointer. Ian asked me to file this issue.</pre>
Suggested
low
Major
51,288,069
go
go/types: confusing behaviour of Selection.Indirect() for Kind()==MethodVal
<pre>In go/types/selection.go, the intended significance of the Indirect flag (for MethodVal) is hard to tell from the example. I was assuming that is means whether there are any pointer indirections between the type of the receiver and the declared type of the method, but that doesn't seem to explain it: I instrumented recordSelection: % cat sel.go package main type T struct {} func (T)f() {} func (*T)g() {} func main() { var x T x.f() x.g() var p *T p.f() p.g() } % ./ssadump sel.go sel.go:11:2: SEL method (main.T) f() indirect=false sel.go:12:2: SEL method (main.T) g() indirect=false sel.go:15:2: SEL method (*main.T) f() indirect=true sel.go:16:2: SEL method (*main.T) g() indirect=true In the last selection, there is no actual indirection between the receiver type *T and the method type *T, yet the indirect flag is reported as true. (The indirect flag seems to record only the pointerness of the receiver, which is redundant information.) I think, by analogy with field selections, the indirect bit should be set iff there was an implicit pointer indirection between the actual receiver type and the formal receiver type, e.g a (T) method was called with an expression of type (*T), or in this example: type A struct {} func (*A) f() {} type B struct {*A} ... B{}.f() // indirect, since method (*A).f An (A) method is called with an expression of type B.</pre>
NeedsInvestigation
low
Major
51,288,073
go
cmd/compile: Debug information missing : no stack info , no variables info using gdb
by **guybrandw**: <pre>Since version 1.3 , I cant get debugging information . using both linux64 , windows64/32 : 1. the variables displays values with no correlation to the real value (fmt.Print() displays the right values) . 2. the call stack displays only the last step of the stack , other steps are displayed as ???? . I have uninstalled Go 1.3 , installed 1.21 and both problems were &quot;solved&quot; . reinstalled 1.3 , the problem returned . attached prinshots of simple code , the variables displayed in LiteIde , the stack , and print function of the gdb . to make sure , I have tried the same installing the Zues IDE , same problems reproduced .</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/8357/0/debugIssue.png">debugIssue.png</a> (37441 bytes)
NeedsInvestigation
medium
Critical
51,288,130
go
go/doc: incorrect href link for dot import
by **fgmarand**: <pre>What does 'go version' print? go version go1.3 linux/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. 1. unpack the archive in src/ 2. start godoc -http=:6060 3. go to <a href="http://localhost:6060/pkg/outer/inner">http://localhost:6060/pkg/outer/inner</a> 4. examine the link to OuterA within InnerA What happened? The link points to <a href="http://localhost:6060/pkg/outer/inner/#OuterA">http://localhost:6060/pkg/outer/inner/#OuterA</a> What should have happened instead? The link should have pointed to <a href="http://localhost:6060/pkg/outer/#OuterA">http://localhost:6060/pkg/outer/#OuterA</a> Additional information This appears to be because of the default import alias: when using a normal import, even aliased (like: import o &quot;outer&quot;), the link is built correctly.</pre> Attachments: 1. <a href="https://storage.googleapis.com/go-attachment/8394/0/outer.tgz">outer.tgz</a> (10240 bytes)
NeedsInvestigation
low
Minor
51,288,138
go
cmd/vet: check for useless assignments to struct fields
<pre>Implement this TODO from the assignment checker: // TODO: should also check for assignments to struct fields inside methods // that are on T instead of *T. Discussion at <a href="https://groups.google.com/forum/#">https://groups.google.com/forum/#</a>!topic/golang-nuts/rSTE4G75QQU/discussion. This might also be extended to range loops -- see <a href="http://play.golang.org/p/FMsMT0dnhf">http://play.golang.org/p/FMsMT0dnhf</a>, linked from <a href="https://golang.org/issue/8356">issue #8356</a>.</pre>
Analysis
low
Minor
51,288,145
go
cmd/compile: Wrong type reported for constant in type mismatch report
<pre>In the following code: func Foo() []float64 { return 0 } gc reports &quot;cannot use 0 (type int) as type []float64 in return argument&quot;. However, 0 is not an integer, 0 is a constant. <a href="http://play.golang.org/p/hyUix7H8aX">http://play.golang.org/p/hyUix7H8aX</a></pre>
NeedsInvestigation
low
Minor
51,288,165
go
cmd/cgo: build failed when any code have CFLAGS: -Werror=unused-vairable
by **Snyh1010**: <pre>1. What is a short input program that triggers the error? package main //#cgo CFLAGS: -Werror=unused-variable //void test(){} import &quot;C&quot; func main() { C.test() } 2. What is the full compiler output? snyh:shm$go build # _/run/shm ./a.go: In function ‘_cgo_043ca501ac1f_Cfunc_test’: ./a.go:32:49: error: unused variable ‘a’ [-Werror=unused-variable] cc1: some warnings being treated as errors ------------------------------------------ I have fixed this by a CL <a href="https://golang.org/cl/118890044/">https://golang.org/cl/118890044/</a> The CL(<a href="https://golang.org/cl/109640045)">https://golang.org/cl/109640045)</a> had fix this problem under gcc. The first time I hasn't notice clang, so when the CL has been submitted, it broken freebsd because clang. And the CL has been undo. The broken problem is not caused by my code, it's appeared upon the submission because the CL contains the test code let the problem appeared. I have fixed the problem both clang and gcc. But it seems no one have confidence to submit it this time, I have send the CL request. Anyway I want the problem be fixed, with or without my CL.</pre>
help wanted,NeedsInvestigation
low
Critical
51,288,188
go
x/net/ether: create package that supports raw ethernet sockets
by **[email protected]**: <pre>It would be useful if Go supported raw ethernet sockets. It is indicated that this was planned in a TODO on net.go: // TODO(rsc): // support for raw ethernet sockets Is this still planned? Thanks!</pre>
help wanted
low
Major
51,288,204
go
runtime: TestStackMem needs to be run in isolation to be accurate
<pre>See CL 119330044 TestStackMem measures the amount of stack used, which can change due to other tests running simultaneously. We see instances of the amount of stack used going negative. This bug requests a way of running this test in isolation so it isn't degraded by other nearby tests.</pre>
NeedsInvestigation
low
Critical
51,288,235
go
testing/quick: generate NaN and +/-Inf for float and complex parameters
<pre><a href="http://play.golang.org/p/sc5S0sZorl">http://play.golang.org/p/sc5S0sZorl</a> quick's default generator never produces NaN or +/-Inf. These are commonly-missed edge cases.</pre>
NeedsInvestigation
low
Minor
51,288,262
go
cmd/compile: Manually calling init should provide a better error message, currently says "undefined: init"
<pre>Attempting to manually call an init() function fails with the somewhat cryptic compiler error &quot;undefined: init&quot;. It should indicate that init is a special symbol (automatically run) and cannot be manually called. <a href="http://play.golang.org/p/d2A2m56Fvp">http://play.golang.org/p/d2A2m56Fvp</a></pre>
NeedsFix
low
Critical
51,288,278
go
runtime: fatal error: cannot map pages in arena address space on Windows
by **kaixinlaoshu2008**: <pre>What does 'go version' print? go 1.3 windows/386 What steps reproduce the problem? file, handler, err := r.FormFile(&quot;file&quot;) ... defer file.Close() Use FormFile to receive documents. When i upload a flie(100M) 4 or 5 times will get errors. What happened? fatal error: runtime: cannot map pages in arena address space What should have happened instead? go free memory after the FormFile receive a document.</pre>
OS-Windows
medium
Critical
51,288,294
go
reflect: Add UnderlyingType(reflect.Type)
<pre>The go spec refers to the underlying type of a given type T: Each type T has an underlying type: If T is one of the predeclared boolean, numeric, or string types, or a type literal, the corresponding underlying type is T itself. Otherwise, T's underlying type is the underlying type of the type to which T refers in its type declaration. Discussion: <a href="https://groups.google.com/d/msg/golang-nuts/BJEuegjQtEA/q2S3b6JxY1MJ">https://groups.google.com/d/msg/golang-nuts/BJEuegjQtEA/q2S3b6JxY1MJ</a></pre>
NeedsDecision,FeatureRequest
low
Minor
51,288,354
go
gdb: Gdb doesn't show strings values
by **ignatovs**: <pre>Mac OS X 10.9.4 What does 'go version' print? go version go1.3.1 darwin/amd64 (via brew) GNU gdb (GDB) 7.7.1 (via brew) Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html&gt">http://gnu.org/licenses/gpl.html&gt</a>; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot; and &quot;show warranty&quot; for details. This GDB was configured as &quot;x86_64-apple-darwin13.3.0&quot;. Type &quot;show configuration&quot; for configuration details. For bug reporting instructions, please see: &lt;<a href="http://www.gnu.org/software/gdb/bugs/&gt">http://www.gnu.org/software/gdb/bugs/&gt</a>;. Find the GDB manual and other documentation resources online at: &lt;<a href="http://www.gnu.org/software/gdb/documentation/&gt">http://www.gnu.org/software/gdb/documentation/&gt</a>;. For help, type &quot;help&quot;. Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;. (gdb) show configuration This GDB was configured as follows: configure --host=x86_64-apple-darwin13.3.0 --target=x86_64-apple-darwin13.3.0 --with-auto-load-dir=:${prefix}/share/auto-load --with-auto-load-safe-path=:${prefix}/share/auto-load --with-expat --with-gdb-datadir=/usr/local/Cellar/gdb/7.7.1/share/gdb (relocatable) --with-jit-reader-dir=/usr/local/Cellar/gdb/7.7.1/lib/gdb (relocatable) --without-libunwind-ia64 --without-lzma --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7 --with-separate-debug-dir=/usr/local/Cellar/gdb/7.7.1/lib/debug (relocatable) --with-zlib --without-babeltrace (&quot;Relocatable&quot; means the directory can be moved with the GDB installation tree, and GDB will still find it.) 1. Build a sample <a href="http://play.golang.org/p/n2L68VzRen">http://play.golang.org/p/n2L68VzRen</a> as a binary m (via go build m.go) 2. Run gdb m 3. Setup a new breakpoint at line 9 4. Run the executable 5. Try to view local variables via info locals What happened? (gdb) info locals x = map[string]string&lt;error reading variable: Cannot access memory at address 0x10&gt; z = []string = {&lt;error reading variable: Cannot access memory at address 0x0&gt;, &lt;error reading variable: Cannot access memory at address 0x15fb60&gt;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;} y = []int What should have happened instead? I'd like to see something more readable :) Please provide any additional information below.</pre>
NeedsInvestigation
low
Critical