The data race can lead to reads of partially
initialized concurrently mutated symbol data.
The change also adds a simple sanity test
for Caller() and FuncForPC().
R=rsc
CC=golang-dev
https://golang.org/cl/4817058
Not all BSDs have the same pipe() syscall implementation - move the Darwin/FreeBSD specific implementation into their respective OS syscall files. This will be needed to add OpenBSD syscall support.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4823057
- create a pair of "Must" functions, one for templates, one for sets
- regularize the return values of the parsers so they can be wrapped by Must
- delete all the old Must functions and methods.
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4826052
serveFile was using absolute redirects, which didn't work under StripPrefix.
Now it uses relative redirects.
R=golang-dev, rsc, bradfitz
CC=golang-dev, kevlar
https://golang.org/cl/4789042
This brings them into line with the Template.MustParse* methods
and makes it possible to use them in global variable initializations.
R=r
CC=golang-dev
https://golang.org/cl/4798059
The RowsPerStrip tag is mandatory according to the spec. However,
Mac OS sometimes (?) omits it. I managed to create such an image
by applying "tiffutil -none" on a compressed image.
If RowsPerStrip is 0, there was a division by zero in the decoder.
Assume that the image is a single strip in this case.
R=nigeltao, bradfitz
CC=golang-dev
https://golang.org/cl/4815061
Hurray!
Also fix the mystical U+0345 COMBINING GREEK YPOGEGRAMMENI,
so everyone is satisfied.
Also add a -local flag to use local files for faster turnaround
when debugging.
R=rsc
CC=golang-dev
https://golang.org/cl/4825054
Undo CL 4254056 now that enough time has elapsed
that people with old trees have all built and removed
those files (which are no longer generated in that location).
Fixes#1581.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4802059
We must keep memory used by syscall.WSARecvFrom away from
garbage collector until after overlapped call is completed.
Fixes#2094.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4817050
ld/data.c:
. Format specifier with corresponding cast to cater for all
architectures (llux and vlong).
ld/ldelf.c:
ld/ldmacho.c:
. Missing "pn" argument in diag() calls.
ld/ldpe.c:
. Dropped "sym->sectnum" in diag() call.
. Typo in a comment.
ld/lib.h:
. Added varargck pragma for "O".
R=rsc
CC=golang-dev
https://golang.org/cl/4749042
When rnd is called with a second argument of 1, it simply
returns the first argument anyway.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4820045
Still need to write tests for new syntax
and fix bugs that the tests find, but this
is a good check point.
All tests pass.
Compared against existing regexp:
benchmark old ns/op new ns/op delta
regexp.BenchmarkLiteral 1869 620 -66.83%
regexp.BenchmarkNotLiteral 9489 7823 -17.56%
regexp.BenchmarkMatchClass 10372 8386 -19.15%
regexp.BenchmarkMatchClass_InRange 10800 7750 -28.24%
regexp.BenchmarkReplaceAll 13492 8519 -36.86%
regexp.BenchmarkAnchoredLiteralShortNonMatch 747 339 -54.62%
regexp.BenchmarkAnchoredLiteralLongNonMatch 599 335 -44.07%
regexp.BenchmarkAnchoredShortMatch 2137 917 -57.09%
regexp.BenchmarkAnchoredLongMatch 2029 917 -54.81%
R=r, r
CC=golang-dev, sam.thorogood
https://golang.org/cl/4820046
goinstall: report every newly installed package to the dashboard
This makes "goinstall -a" work on systems with GOROOTs that are
not user-writable, as is the case with Debian's Go packages.
This also makes goinstall.log the canonical list of installed
packages, in that only packages new to goinstall.log are reported to
the dashboard.
A side-effect is that writing to goinstall.log is now mandatory.
(A bug in the original implementation meant this was the case, anyway.)
The principal benefit of this change is that multiple packages from the
same repository can now be reported to the dashboard. It is also less
likely for a user to report multiple installations of the same package
to the dashboard (they would need to remove the package from
goinstall.log first).
R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/4786041
Previously comparisons with NaN led to contradictory results if it was
compared to anything not NaN, since Less always returned false, thus
breaking monotonicity of ordering.
This fix makes NaN less than anything else and adds NaN and (+-)Inf to
testcases.
Fixes#2092.
R=golang-dev, r, rsc, r
CC=golang-dev
https://golang.org/cl/4805051
Replace cas with xadd in scheduler.
Suggested by Dmitriy in last code review.
Verified with Promela model.
When there's actual contention for the atomic word,
this avoids the looping that compare-and-swap requires.
benchmark old ns/op new ns/op delta
runtime_test.BenchmarkSyscall 32 26 -17.08%
runtime_test.BenchmarkSyscall-2 155 59 -61.81%
runtime_test.BenchmarkSyscall-3 112 52 -52.95%
runtime_test.BenchmarkSyscall-4 94 48 -48.57%
runtime_test.BenchmarkSyscallWork 871 872 +0.11%
runtime_test.BenchmarkSyscallWork-2 481 477 -0.83%
runtime_test.BenchmarkSyscallWork-3 338 335 -0.89%
runtime_test.BenchmarkSyscallWork-4 263 256 -2.66%
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4800047
This is the last piece (I hope) of the set creation code.
These helpers create sets from files containing individual
template definitions, free of {{define}} clauses. This
design is helpful if the templates live one per file,
undecorated.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4801052
Fixes a problem where Readdir would always return
empty directories (Readdir is only called by godoc
if the usual directory handler is commented out
in godoc.go, and if a zip file system is provided;
thus, this bug never manifested itself in godoc).
Also:
- better choice of variable/field names
- simplified error handling a bit
- better comments
R=bradfitz
CC=golang-dev
https://golang.org/cl/4813047
This surprisingly takes 30 seconds on my fast machine
so disabling by default. Need to optimize the Writer
at some point.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4815048
This makes the full file paths recorded by 6g
prefer $PWD over the actual directory name
(relevant when $PWD gets to the current directory
via symlinks). It's what everyone else does, and
what people expect.
R=iant, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4824041
Don't report that a directory was found just because we found
the list index where the directory would be if it were there...
R=iant
CC=golang-dev
https://golang.org/cl/4812051
Also:
- Add parser.SpuriousError flag. If set, the parser reports all (including
spurious) errors rather then at most one error per line.
- Add -e flag to gofmt and gotype: If set, gofmt and gotype report all
(including spurious) errors rather than at most one error per line.
- Updated the respective documentation.
Fixes#2088.
R=rsc
CC=golang-dev
https://golang.org/cl/4803047
- remove calls to print
- make units compile again
- make units.y closer to gofmt style
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4802052
Drops mallocrep1.go back to a reasonable
amount of time. (154 -> 0.8 seconds on my Mac)
Fixes#2085.
R=golang-dev, dvyukov, r
CC=golang-dev
https://golang.org/cl/4811045
Also make the Set.Parse methods variadic so you can parse static lists of files without loops.
R=rsc, dsymonds, r
CC=golang-dev
https://golang.org/cl/4802051
Now handles standard precision specifications, standard interactions of
redundant specifications (such as precision and zero-fill), handles the
special case of precision specified but equal to zero, and generates the
output without recursive calls to format/printf to be clearer and faster.
R=gri, mtj, gri
CC=golang-dev
https://golang.org/cl/4703050
ServeMux depends on having a URL
in order to mux. It might be that the right
fix is to have CONNECT handlers just not
look at URL.
««« original CL description
http: do not parse req.URL for CONNECT
CONNECT's argument is not a URL.
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4808044
»»»
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/4798046
It makes it clear what benchmark is currently running.
Especially useful in case of hangup or crash.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4816043
Something is broken, and investigation is underway.
In the meantime, godoc is broken, so disable sniffing for now
by reverting to the pre-sniffer state.
R=r
CC=golang-dev
https://golang.org/cl/4809046
The C-stdlib heritage of printf/fprintf/sprintf has two odd
aspects for precisions of zero with integers. First, the zero
can be specified in any of these ways, "%4.0d", "%.0d" and
"%.d" which was not previously supported here. Secondly, the
seemingly universal interpretation of precision for integers
is that precision==0 and value==0 means print nothing at all.
The code here now handles this for integers just as the code
in big/int.c does the same for the Int type. New tests are
added to fmt_test.go to verify these changes.
R=r, r
CC=golang-dev
https://golang.org/cl/4717045
This simplifies the API and makes it easier to make the template
invocation statically secure, at the cost of some minor flexibility.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/4794045
As $GOROOT/src/pkg/html/testdata/webkit/README says, we're pulling from
$WEBKITROOT/LayoutTests/html5lib/resources.
R=r
CC=golang-dev
https://golang.org/cl/4810043
This is the "adoption agency" algorithm.
The test case input is "<a><p>X<a>Y</a>Z</p></a>". The correct parse is:
| <html>
| <head>
| <body>
| <a>
| <p>
| <a>
| "X"
| <a>
| "Y"
| "Z"
R=gri
CC=golang-dev
https://golang.org/cl/4771042
This follows draft-ietf-websec-mime-sniff-03 in its intent,
though not its algorithmic specification.
R=rsc
CC=golang-dev
https://golang.org/cl/4746042
Remove complicated PRNG algorithm
(argument is limited by uint16 and can't be <= 1).
Do not require chansend/chanrecv selgen to be bumped with CAS.
R=rsc, ken
CC=golang-dev
https://golang.org/cl/4816041
The dynamic ELF sections were pointing to the proper data,
but that data was already owned by the rodata and text sections.
Some ELF references explicitly prohibit multiple sections from
owning the same data, and strip behaves accordingly.
The data for these sections was moved out and their ranges are
now owned by their respective sections. This change makes strip
happy both with and without -s being provided at link time.
A test was added in debug/elf to ensure there are no regressions
on this area in the future.
Fixes#1242.
Fixes#2022.
NOTE: Tested on Linux amd64/386/arm only.
R=rsc
CC=golang-dev
https://golang.org/cl/4808043
pkg/runtime/Makefile:
. Adjusted so "goc2c.c" is built using the Plan 9 libraries.
pkg/runtime/goc2c.c:
. Added/subtracted #include headers to correspond to Plan 9
toolkit.
. Changed fprintf(stderr,...)/exit() combinations to
sysfatal() calls, adjusted the "%u" format to "%ud".
. Added exits(0) at the end of main().
. Made main() a void-returning function and removed the
"return 0" at the end of it.
Tested on UBUNTU and Plan 9 only.
R=r, rsc
CC=golang-dev
https://golang.org/cl/4626093
Disable the LoadInt32 and LoadUint32 tests, since they fail.
These should be fixed but we want to get through the rest of the build
to see if something else unrelated is broken. The arm build has been
bad for a long time.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4780041
Used to use mcpu+msyscall but that's
problematic for packing into a single
atomic word. The running goroutine count
(where running == Go code or syscall)
can be maintained separately, always
manipulated under lock.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4767041
The package was always GNU/Linux specific, and is no longer
used by anything now that exp/ogle has been removed.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4757049
Reduces number of write+seek's from 88516 to 2080
when linking godoc with 6l.
Thanks to Alex Brainman for pointing out the
many small writes.
R=golang-dev, r, alex.brainman, robert.hencke
CC=golang-dev
https://golang.org/cl/4743043
interface field can be unpacked. We don't have type assertions here so we
must be forthright.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4757047
- Clean and IsAbs to handle paths with drive letter properly.
- Clean to replace / with \.
R=golang-dev, adg
CC=golang-dev, mattn.jp
https://golang.org/cl/4758051
This didn't actually cause a bug, but looks wrong.
There was a lock but there was more shared mutable state not
guarded by it.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/4760047
The previous CL doicumented and diagnosed the old situation.
This one changes it to something more traditional: any action
may declare a variable, and the block structure of scopes
applies only to control seequences.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4748047
Previously, during the anti-zombie test, a
CGI process had to finish within ~625ms.
Now it gets ~5.6 seconds.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4741041
Instead of serving files of the underlying OS file system,
a .zip file may be provided to godoc containing the files
to serve; for instance:
godoc -http=:6060 -zip=go.zip
using a .zip file created from a clean tree as follows:
zip -r go.zip $GOROOT
R=rsc
CC=golang-dev
https://golang.org/cl/4670053
Angle brackets can trigger some browser sniffers, causing
some forms of JSON output to be interpreted as HTML.
Escaping angle brackets closes that security hole.
R=rsc
CC=golang-dev
https://golang.org/cl/4701047
{{range $key, $element := pipeline}}
This CL is smaller than it looks due to some rearrangement and renaming.
R=rsc, r
CC=golang-dev
https://golang.org/cl/4709047
Angle brackets can trigger some browser sniffers,
causing some output to be interpreted as HTML.
Escaping angle brackets closes that security hole.
R=r
CC=golang-dev
https://golang.org/cl/4714044
Move the Signal interface from exec_posix.go to exec.go.
Remove some unsused code from file_plan9.go.
R=fshahriar, rsc
CC=golang-dev
https://golang.org/cl/4683044
<ctype.h> has been moved into <u.h>, specifically to be able to
drop it from these modules.
Will someone check platforms other than UBUNTU/386, please?
R=bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4648078
Russ suggested this technique, making the "and" and "or" functions handier.
But it's hacky, and I can be talked out of it.
R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4698044
ServeFile() pass empty string to serveFile(). serveFile() should get
file extension via joining root and filename.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4654089
NewFile has been fixed to read ELF Program headers into the structs.
Added test coverage.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4628062
The data race is on newly published Itab nodes, which are
both unsafely published and unsafely acquired. It can
break on IA-32/Intel64 due to compiler optimizations
(most likely not an issue as of now) and on ARM due to
hardware memory access reorderings.
R=rsc
CC=golang-dev
https://golang.org/cl/4673055
Without explicitly registering slice types, gob fails to encode
map[string]interface{} instances where the value is a slice,
failing with a message such as:
gob: type not registered for interface: []string
Fixes#2065.
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4672056
- template invocation is by string constant only.
- NewSet is gone.
- no global Funcs
- writer is now first arg to Execute
R=rsc, r
CC=golang-dev
https://golang.org/cl/4700043
Per the TIS ELF spec, if a PHDR entry is present in the
program header table, it must be part of the memory image of
the program. Failure to do this makes elflint complain, and
causes some tools that manipulate ELF to crash.
R=iant, rsc
CC=dave, golang-dev
https://golang.org/cl/4650067
There are no behavioral changes, only some copy-and-pastes.
Before, drawFillOver was next to drawCopyOver.
After, drawFillOver is next to drawFillSrc, which is more similar to
drawFillOver than drawCopyOver is.
Similarly, drawCopyOver is now next to drawCopySrc, etc.
R=r
CC=golang-dev
https://golang.org/cl/4695045
runtime.goidgen can be quite frequently modified and
shares cache line with the following variables,
it leads to false sharing.
50c6b0 b nfname
50c6b4 b nfunc
50c6b8 b nfunc$17
50c6bc b nhist$17
50c6c0 B runtime.checking
50c6c4 B runtime.gcwaiting
50c6c8 B runtime.goidgen
50c6cc B runtime.gomaxprocs
50c6d0 B runtime.panicking
50c6d4 B strconv.IntSize
50c6d8 B src/pkg/runtime/_xtest_.ss
50c6e0 B src/pkg/runtime/_xtest_.stop
50c6e8 b addrfree
50c6f0 b addrmem
50c6f8 b argv
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4673054
This causes the child, if still writing, to get an error or
SIGPIPE and most likely exit so our subsequent wait can
finish.
A more guaranteed fix would be putting a time limit on the
child's overall execution, but this fixes the problem
I was having.
Fixes#2059
R=rsc
CC=golang-dev
https://golang.org/cl/4675081
This is the form as returned by Postgres, as well
as JavaScript.
I've tried and failed to find authorative docs online
about the proper string serialization, if any.
R=golang-dev, gri, r, r, rsc
CC=golang-dev
https://golang.org/cl/4650077
Must keep dot and the receiver separate - variables broke that symmetry.
Also clean up function invocation and rename "data" to "dot" for clarity.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4678048
Replaces "mkdir -p ..." command, as Windows mkdir command
does not support -p flag. Also, is simpler and faster then
launching new process.
R=golang-dev, mattn.jp, adg, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4626087
Not strictly necessary (you could achieve the same, clumsily,
via with blocks) but great to have: $x.Field, $y.Method.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4678047
We can avoid the check against empty constants (''),
which UnquoteChar doesn't handle well, by leaving on
the trailing quote and seeing that's all we have left at the end.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4657090
- suppress the print that -help is not defined.
- return a special error code if -help is set
- do not change behavior if an explict "help" flag is defined.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4641099
of the origin.
image/png and image/jpeg benchmarks show no significant changes.
The image/draw changes suggest to me that making a gofix for this is not
feasible. People are just going to have to make manual fixes.
R=r
CC=golang-dev
https://golang.org/cl/4681044
1) Make the value optional ({{template "foo"}})
2) Allow the template identifier to be a thing of type *Template.
The second makes it easy to drop templates in to a set dynamically
during invocation.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4671056
It was an ill-advised carryover from the previous template package.
Also clean up function evaluation.
Also add a Name method to Template.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4657088