««« original CL description
runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.
Russ Cox [Fri, 15 Feb 2013 21:37:43 +0000 (13:37 -0800)]
build: clang support
This works with at least one version of clang
that existed at one moment in time.
No guarantees about clangs past or future.
To try:
CC=clang all.bash
It does not work with the Xcode clang,
because that clang fails at printing a useful answer
to:
clang -print-libgcc-file-name
The clang that works prints a full path name for
that command, not just "libgcc.a".
Russ Cox [Fri, 15 Feb 2013 19:48:35 +0000 (14:48 -0500)]
runtime: make return from main wait for active panic
Arguably if this happens the program is buggy anyway,
but letting the panic continue looks better than interrupting it.
Otherwise things like this are possible, and confusing:
$ go run x.go
panic: $ echo $?
0
$
Fixes #3934.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7322083
To make sure that Go code will work when moved to a
system with a case-insensitive file system, like OS X or Windows,
reject any package built from files with names differing
only in case, and also any package built from imported
dependencies with names differing only in case.
Russ Cox [Fri, 15 Feb 2013 19:27:16 +0000 (14:27 -0500)]
runtime/pprof: adjust reported line numbers to show call sites
This is the same logic used in the standard tracebacks.
The caller pc is the pc after the call, so except in the
fake "call" caused by a panic, back up the pc enough
that the lookup will use the previous instruction.
Russ Cox [Fri, 15 Feb 2013 19:27:03 +0000 (14:27 -0500)]
runtime: allocate heap metadata at run time
Before, the mheap structure was in the bss,
but it's quite large (today, 256 MB, much of
which is never actually paged in), and it makes
Go binaries run afoul of exec-time bss size
limits on some BSD systems.
Dmitriy Vyukov [Fri, 15 Feb 2013 18:22:13 +0000 (22:22 +0400)]
runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.
Russ Cox [Fri, 15 Feb 2013 17:18:33 +0000 (12:18 -0500)]
runtime: fix build on linux
In addition to the compile failure fixed in signal*.c,
preserving the signal mask led to very strange crashes.
Testing shows that looking for SIG_IGN is all that
matters to get along with nohup, so reintroduce
sigset_zero instead of trying to preserve the signal mask.
Russ Cox [Fri, 15 Feb 2013 16:18:55 +0000 (11:18 -0500)]
runtime: fix running under nohup
There are two ways nohup(1) might be implemented:
it might mask away the signal, or it might set the handler
to SIG_IGN, both of which are inherited across fork+exec.
So two fixes:
* Make sure to preserve the inherited signal mask at
minit instead of clearing it.
* If the SIGHUP handler is SIG_IGN, leave it that way.
Adam Langley [Fri, 15 Feb 2013 15:40:17 +0000 (10:40 -0500)]
crypto/x509: support IP SANs.
Subject Alternative Names in X.509 certificates may include IP
addresses. This change adds support for marshaling, unmarshaling and
verifying this form of SAN.
It also causes IP addresses to only be checked against IP SANs,
rather than against hostnames as was previously the case. This
reflects RFC 6125.
Alex Brainman [Fri, 15 Feb 2013 04:52:12 +0000 (15:52 +1100)]
net: delete TestDialTimeoutHandleLeak
It is too flaky. Tried to make it more reliable,
but that affects other tests (they run too long),
because we do unusual things here, like attempting
to connect to non-existing address and interrupt.
Cosmos Nicolaou [Fri, 15 Feb 2013 04:35:08 +0000 (20:35 -0800)]
cmd/godoc: add support for doc.Package.Notes
Add support for displaying the notes of the form 'MARKER(userid): comment' now collected by the go/doc package. Any two or more uppercase letters are recognised as a marker.
Cosmos Nicolaou [Fri, 15 Feb 2013 04:20:32 +0000 (20:20 -0800)]
go/doc: add support for arbitrary notes
Add support for arbitrary notes of the form // MARKER(userid): comment
in the same vein as BUG(userid): A marker must be two or more upper case [A-Z] letters.
Dave Cheney [Thu, 14 Feb 2013 23:44:29 +0000 (10:44 +1100)]
misc/dashboard/builder: record build result on dashboard
This is part one of two changes intended to make it easier to debug builder failures.
runOutput allows us to control the io.Writer passed to a subcommand. The intention is to add additional debugging information before and after the build which will then be capture and sent to the dashboard.
- use the new AllErrors flag where appropriate
- unless AllErrors is set, eliminate spurious
errors before they are added to the errors list
(it turns out that reporting spurious errors always
leads to too many uninformative errors after all)
Russ Cox [Thu, 14 Feb 2013 20:00:51 +0000 (15:00 -0500)]
cmd/go: fix vet
The IgnoredGoFiles are already listed in allgofiles,
so they were being run twice. Worse, the ones in
IgnoredGoFiles are not fully qualified paths, so they
weren't being found when executed outside the
package directory.
Dmitriy Vyukov [Thu, 14 Feb 2013 08:37:55 +0000 (12:37 +0400)]
runtime: move stack management related code to stack.c
No code changes.
This is mainly in preparation to scheduler changes,
oldstack/newstack are not related to scheduling.
David Symonds [Thu, 14 Feb 2013 04:04:22 +0000 (15:04 +1100)]
sort: use fewer comparisons when choosing pivot.
This is based on rsc's code posted to issue 2585.
Benchmark results are greatly improved:
benchmark old ns/op new ns/op delta
BenchmarkSortString1K 564397 445897 -21.00%
BenchmarkSortInt1K 270889 221249 -18.32%
BenchmarkSortInt64K 2685076521351967 -20.48%
Eyeballing a sampling of the raw number of comparisons shows a drop
on the order of 20-30% almost everywhere. The test input data that
doesn't match that are some of sawtooth/rand/plateau distributions,
where there is no change in the number of comparisons; that is,
there are no situations where this makes *more* comparisons.
Dave Cheney [Wed, 13 Feb 2013 23:11:16 +0000 (10:11 +1100)]
net: remove noisy test for issue 3590
The test for issue 3590 causes an error to be printed to stderr when run (although the error is obscured during go test std). This is confusing for people who get breakage in the net package as the error is harmless and most likely unrelated to their build breakage.
Given the way the test works, by reaching into the guts of the netFD, I can't see a way to silence the error without adding a bunch of code to support the test, therefore I am suggesting the test be removed before Go 1.1 ships.
Robert Griesemer [Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)]
go/types: adjust gcimporter to actual gc export data
Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).
We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.
Alan Donovan [Wed, 13 Feb 2013 05:15:07 +0000 (00:15 -0500)]
exp/ssa: add Instruction.Operands and Value.Referrers methods.
Operands returns the SSA values used by an instruction.
Referrers returns the SSA instructions that use a value, for
some values. These will be used for SSA renaming, to follow.
Alan Donovan [Tue, 12 Feb 2013 18:17:49 +0000 (13:17 -0500)]
test: ensure all failing tests exit nonzero.
Previously merely printing an error would cause the golden
file comparison (in 'bash run') to fail, but that is no longer
the case with the new run.go driver.
Marcel van Lohuizen [Tue, 12 Feb 2013 14:59:55 +0000 (15:59 +0100)]
exp/locale/collate: moved low-level collation functionality
into separate package. This allows this code to be shared
with the search package without the need for these two to use
the same tables.
Adjusted various files accordingly.
Alan Donovan [Tue, 12 Feb 2013 03:12:56 +0000 (22:12 -0500)]
exp/ssa: special-case 'range' loops based on type of range expression.
The lowering of ast.RangeStmt now has three distinct cases:
1) rangeIter for maps and strings; approximately:
it = range x
for {
k, v, ok = next it
if !ok { break }
...
}
The Range instruction and the interpreter's "iter"
datatype are now restricted to these types.
2) rangeChan for channels; approximately:
for {
k, ok = <-x
if !ok { break }
...
}
3) rangeIndexed for slices, arrays, and *array; approximately:
for k, l = 0, len(x); k < l; k++ {
v = x[k]
...
}
In all cases we now evaluate the side effects of the range expression
exactly once, per comments on http://code.google.com/p/go/issues/detail?id=4644.
However the exact spec wording is still being discussed in
https://golang.org/cl/7307083/. Further (small)
changes may be required once the dust settles.
Alan Donovan [Mon, 11 Feb 2013 23:20:52 +0000 (18:20 -0500)]
test: a number of fixes.
Details:
- reorder.go: delete p8.
(Once expectation is changed per b/4627 it is identical to p1.)
- switch.go: added some more (degenerate) switches.
- range.go: improved error messages in a few cases.
- method.go: added tests of calls to promoted methods.
Rob Pike [Mon, 11 Feb 2013 21:33:11 +0000 (13:33 -0800)]
vet: improve flag handling
Simplify the internal logic for flags controlling what to vet,
by introducing a map of flags that gathers them all together.
This change should simplify the process of adding further flags.
Add a test for untagged struct literals.
Delete a redundant test that was also in the wrong file.
Clean up some ERROR patterns that weren't working.
Russ Cox [Mon, 11 Feb 2013 12:48:14 +0000 (07:48 -0500)]
spec: only require parens around ambiguous conversions
This is documenting the status quo. The previous cleanup
added this language as an implementation restriction, but
at least for now it is really part of the language proper.
Fixes #4605.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7305071
Russ Cox [Mon, 11 Feb 2013 12:47:41 +0000 (07:47 -0500)]
spec: document fp rounding during explicit constant conversion
The gc compilers already behave this way. It was an explicit
decision during the very long constant design discussions,
but it appears not to have made it into the spec.
Fixes #4398.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7313069
Volker Dobler [Mon, 11 Feb 2013 00:47:31 +0000 (11:47 +1100)]
exp/cookiejar: implementation of SetCookies
This CL provides the rest of the SetCookies code as well as
some test infrastructure which will be used to test also
the Cookies method. This test infrastructure is optimized
for readability and tries to make it easy to review table
driven test cases.
Tests for all the different corner cases of SetCookies
will be provided in a separate CL.
Dave Cheney [Mon, 11 Feb 2013 00:40:33 +0000 (19:40 -0500)]
doc: update contribute.html
Fixes #4582.
* mentioned hg upload.
* added section on hg file.
* added small mention about being inside $GOROOT.
* added hg revert @NNNN
* reorganise the hg submit section for the common case of a non committer.
* made the Copyright section h2
* added note about leaving copyright years unchanged.
Shane Hansen [Mon, 11 Feb 2013 00:36:29 +0000 (11:36 +1100)]
archive/tar: read/write extended pax/gnu tar archives
Support reading pax archives and applying extended attributes
like long names, subsecond mtime resolutions, etc. Default to
writing pax archives for long file and link names.
Support reading gnu archives using the ././@LongLink extended
header for file name and link target.
Dave Cheney [Sun, 10 Feb 2013 22:39:13 +0000 (17:39 -0500)]
doc: move os specific build instructions to wiki
Fixes #4010.
This proposal avoids cluttering the main install-source.html with OS specific instructions by linking to the wiki for details. See discussion in the comments.
Russ Cox [Sat, 9 Feb 2013 22:36:31 +0000 (17:36 -0500)]
spec: clarify that any unsafe.Pointer type is okay in conversion
The spec is not clear about whether this is allowed or not,
but both compilers allow it, because the reflect implementation
takes advantage of it. Document current behavior.
Fixes #4679.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7303064