summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* crypto/tls: don't select ECDSA ciphersuites with only an RSA certificate.Adam Langley2013-09-173-37/+77
| | | | | | | | | | | 47ec7a68b1a2 added support for ECDSA ciphersuites but didn't alter the cipher suite selection to take that into account. Thus Go servers could try and select an ECDSA cipher suite while only having an RSA certificate, leading to connection failures. R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/13239053
* cmd/cgo: rearrange and update documentationIan Lance Taylor2013-09-171-29/+49
| | | | | | | | | | | | In particular document that the Go tool will look for certain file extensions and compile with them with either the C or the C++ compiler. Fixes issue 6393. R=golang-dev, r CC=golang-dev https://codereview.appspot.com/13733043
* text/template/parse, html/template: copy Tree.text during html template cloneJosh Bleecher Snyder2013-09-174-6/+70
| | | | | | | | | | | | | | | The root cause of the panic reported in https://code.google.com/p/go/issues/detail?id=5980 is that parse's Tree.Text wasn't being copied during the clone. Fix this by adding and using a Copy method for parse.Tree. Fixes issue 5980. R=golang-dev, r CC=golang-dev https://codereview.appspot.com/12420044 Committer: Rob Pike <r@golang.org>
* cmd/6c, cmd/6g, cmd/cc: fix undefined behavior warningsDave Cheney2013-09-173-3/+3
| | | | | | | | | | Update issue 5764 Like Tribbles, the more you kill, the more spring up in their place. R=rsc CC=golang-dev https://codereview.appspot.com/13324049
* runtime: export PCDATA value readerCarl Shapiro2013-09-162-3/+4
| | | | | | | | | | | This interface is required to use the PCDATA interface implemented in Go 1.2. While initially entirely private, the FUNCDATA side of the interface has been made public. This change completes the FUNCDATA/PCDATA interface. R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/13735043
* cmd/gc, runtime: inline append in frontend.R?my Oudompheng2013-09-167-126/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | A new transformation during walk turns append calls into a combination of growslice and memmove. benchmark old ns/op new ns/op delta BenchmarkAppend 141 141 +0.00% BenchmarkAppend1Byte 18 11 -39.56% BenchmarkAppend4Bytes 19 10 -42.63% BenchmarkAppend7Bytes 18 10 -42.16% BenchmarkAppend8Bytes 18 10 -40.44% BenchmarkAppend15Bytes 19 11 -41.67% BenchmarkAppend16Bytes 19 11 -41.97% BenchmarkAppend32Bytes 23 14 -38.82% BenchmarkAppendStr1Byte 14 10 -23.78% BenchmarkAppendStr4Bytes 14 11 -21.13% BenchmarkAppendStr8Bytes 14 10 -25.17% BenchmarkAppendStr16Bytes 19 11 -41.45% BenchmarkAppendStr32Bytes 18 14 -19.44% BenchmarkAppendSpecialCase 62 63 +1.77% R=golang-dev, khr, cshapiro, rsc, dave CC=golang-dev https://codereview.appspot.com/12815046 Committer: Russ Cox <rsc@golang.org>
* cmd/nm: make -S listing a bit more accurateRuss Cox2013-09-161-2/+33
| | | | | | | | | | | Hide container symbols like text and etext so that the individual pieces inside are shown instead. For example, if text and main.init have the same address, it was a toss-up which name was printed. R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/13722046
* build: disable precise collection of stack framesRuss Cox2013-09-1610-14/+80
| | | | | | | | | | | | | | | | | | The code for call site-specific pointer bitmaps was not ready in time, but the zeroing required without it is too expensive to use by default. We will have to wait for precise collection of stack frames until Go 1.3. The precise collection can be re-enabled by GOEXPERIMENT=precisestack ./all.bash but that will not be the default for a Go 1.2 build. Fixes issue 6087. R=golang-dev, jeremyjackins, dan.kortschak, r CC=golang-dev https://codereview.appspot.com/13677045
* crypto/tls: fix TLS 1.2 client certificates.Adam Langley2013-09-164-11/+582
| | | | | | | | | With TLS 1.2, when sending client certificates the code was omitting the new (in TLS 1.2) signature and hash fields. R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/13413050
* cmd/cgo: remove inaccurate commentIan Lance Taylor2013-09-161-2/+0
| | | | | | | | All these features have in fact been implemented. R=rsc CC=golang-dev https://codereview.appspot.com/13419049
* cmd/gc: do not report fields when looking for methodsRuss Cox2013-09-161-1/+1
| | | | | | | | Fixes issue 6395. R=ken2 CC=golang-dev https://codereview.appspot.com/13470046
* runtime: fix uint64 division on 386Russ Cox2013-09-162-3/+6
| | | | | | | | | | | | | | | | | The uint64 divide function calls _mul64x32 to do a 64x32-bit multiply and then compares the result against the 64-bit numerator. If the result is bigger than the numerator, must use the slow path. Unfortunately, the 64x32 produces a 96-bit product, and only the low 64 bits were being used in the comparison. Return all 96 bits, the bottom 64 via the original uint64* pointer, and the top 32 as the function's return value. Fixes 386 build (broken by ARM division tests). R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/13722044
* cmd/gc: fix divide by zero error in compilerRuss Cox2013-09-161-1/+1
| | | | | | | | Fixes issue 6399. R=ken2 CC=golang-dev https://codereview.appspot.com/13253055
* runtime: fix freebsd buildRuss Cox2013-09-161-1/+1
| | | | | | TBR=golang-dev CC=golang-dev https://codereview.appspot.com/13720044
* net: make all.bat run for ordinary Windows usersRuss Cox2013-09-164-0/+16
| | | | | | | | | | | | | | | | | | | This CL is required for all.bat to work out of the box on my Windows 8 laptop. These tests either require the firewall to be turned off or require the user to be in the Administrators group. I don't know which. Alex may follow up with a refinement of the test to allow them to run if the user is in the Administrators group. Fixes issue 6392. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/13421049
* cmd/cgo: allow C.malloc(0) alwaysRuss Cox2013-09-162-0/+4
| | | | | | | | | | | Because we can, and because it otherwise might crash the program if we think we're out of memory. Fixes issue 6390. R=golang-dev, iant, minux.ma CC=golang-dev https://codereview.appspot.com/13345048
* runtime: make ARM integer div-by-zero traceback-friendlyRuss Cox2013-09-161-18/+27
| | | | | | | | | | | | | The implementation of division in the 5 toolchain is a bit too magical. Hide the magic from the traceback routines. Also add a test for the results of the software divide routine. Fixes issue 5805. R=golang-dev, minux.ma CC=golang-dev https://codereview.appspot.com/13239052
* runtime, syscall: work around FreeBSD/amd64 kernel bugRuss Cox2013-09-162-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel implementation of the fast system call path, the one invoked by the SYSCALL instruction, is broken for restarting system calls. A C program demonstrating this is below. Change the system calls to use INT $0x80 instead, because that (perhaps slightly slower) system call path actually works. I filed http://www.freebsd.org/cgi/query-pr.cgi?pr=182161. The C program demonstrating that it is FreeBSD's fault is below. It reports the same "Bad address" failures from wait. #include <sys/time.h> #include <sys/signal.h> #include <pthread.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> static void handler(int); static void* looper(void*); int main(void) { int i; struct sigaction sa; pthread_cond_t cond; pthread_mutex_t mu; memset(&sa, 0, sizeof sa); sa.sa_handler = handler; sa.sa_flags = SA_RESTART; memset(&sa.sa_mask, 0xff, sizeof sa.sa_mask); sigaction(SIGCHLD, &sa, 0); for(i=0; i<2; i++) pthread_create(0, 0, looper, 0); pthread_mutex_init(&mu, 0); pthread_mutex_lock(&mu); pthread_cond_init(&cond, 0); for(;;) pthread_cond_wait(&cond, &mu); return 0; } static void handler(int sig) { } int mywait4(int pid, int *stat, int options, struct rusage *rusage) { int result; asm("movq %%rcx, %%r10; syscall" : "=a" (result) : "a" (7), "D" (pid), "S" (stat), "d" (options), "c" (rusage)); } static void* looper(void *v) { int pid, stat, out; struct rusage rusage; for(;;) { if((pid = fork()) == 0) _exit(0); out = mywait4(pid, &stat, 0, &rusage); if(out != pid) { printf("wait4 returned %d\n", out); } } } Fixes issue 6372. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/13582047
* cmd/go: document that "main" is a reserved import pathRob Pike2013-09-162-10/+20
| | | | | | | | Fixes issue 6312. R=golang-dev, dave CC=golang-dev https://codereview.appspot.com/13391049
* net/rpc: log I/O and internal errors only if debugLog is set.Han-Wen Nienhuys2013-09-163-4/+10
| | | | | | | | | | Fixes issue 6367. R=rsc, r CC=golang-dev https://codereview.appspot.com/13395047 Committer: Rob Pike <r@golang.org>
* cmd/nm: put the -S flag in the usage messageRob Pike2013-09-162-2/+2
| | | | | | | | The -S flag reports symbol size, but is missing from the usage message. R=golang-dev, dsymonds CC=golang-dev https://codereview.appspot.com/13660046
* sort: move example to package level and simplify furtherAndrew Gerrand2013-09-161-7/+7
| | | | | | R=golang-dev, r CC=golang-dev https://codereview.appspot.com/13634044
* cmd/gofmt: document -s transformationsAndrew Gerrand2013-09-161-0/+19
| | | | | | R=golang-dev, dsymonds CC=golang-dev https://codereview.appspot.com/13721043
* encoding/gob: ignore chan and func fields of structuresRob Pike2013-09-166-44/+55
| | | | | | | | | | | | | | Previously, fields of type chan or func caused an error. Now we just treat them like unexported fields and ignore them. This makes it easier to guarantee long-term compatibilty since a substructure from another package cannot break gob encoding by adding a func or chan field. Fixes issue 6071 R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/13693043
* runtime: fix CPU profiling on WindowsRuss Cox2013-09-151-1/+7
| | | | | | | | | | The test 'gp == m->curg' is not valid on Windows, because the goroutine being profiled is not from the current m. TBR=golang-dev CC=golang-dev https://codereview.appspot.com/13718043
* go/build: add ctxt.MatchFileRuss Cox2013-09-152-51/+143
| | | | | | | | Fixes issue 6369. R=dsymonds, r CC=golang-dev https://codereview.appspot.com/13708043
* encoding/xml: document behavior for undefined name space prefixesRuss Cox2013-09-151-0/+4
| | | | | | | | Fixes issue 5626. R=golang-dev, dominik.honnef CC=golang-dev https://codereview.appspot.com/13702043
* fmt: %b for complex64 and complex128Rob Pike2013-09-153-2/+10
| | | | | | | | | Just an oversight they were missing. Fixes issue 6387 R=golang-dev, dominik.honnef, rsc CC=golang-dev https://codereview.appspot.com/13715043
* cmd/gc: don't generate algs for internal map types.R?my Oudompheng2013-09-143-0/+6
| | | | | | | | | | | | | | Fake types describing the internal structure of hashmaps are generated for use by precise GC. Generating hash and eq functions for these fake types slows down the build and wastes space: the go tool binary size is 13MB instead of 12MB, and the package size on amd64 is 48.7MB instead of 45.3MB. R=golang-dev, daniel.morsing, r, khr, rsc, iant CC=golang-dev https://codereview.appspot.com/13698043
* os/exec: add more caveats to StdoutPipe, StderrPipeRuss Cox2013-09-131-4/+16
| | | | | | | | | | (StdinPipe was taken care of by CL 13329043.) Fixes issue 6008. R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/13606046
* runtime: avoid inconsistent goroutine state in profilerRuss Cox2013-09-138-29/+225
| | | | | | | | | | | | | | Because profiling signals can arrive at any time, we must handle the case where a profiling signal arrives halfway through a goroutine switch. Luckily, although there is much to think through, very little needs to change. Fixes issue 6000. Fixes issue 6015. R=golang-dev, dvyukov CC=golang-dev https://codereview.appspot.com/13421048
* reflect: document FieldByName shortcomingRuss Cox2013-09-131-0/+8
| | | | | | | | Fixes issue 4876. R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/13701044
* syscall: add TCIOFLUSH family of constantsDave Cheney2013-09-135-0/+19
| | | | | | | | | | | | Fixes issue 6355. zerrors_linux_{386,amd64,arm}.go were regenerated using mkerrors.sh but I opted to add the three TC.*FLUSH lines by hand to keep the diff smaller and avoid problems with the API checker. I'll check freebsd and darwin, could I ask for help with net/open bsd. R=mikioh.mikioh, jsing, minux.ma, bradfitz CC=golang-dev https://codereview.appspot.com/13660043
* cmd/5l: fix handling of RET.EQ in wrapper functionRuss Cox2013-09-131-0/+9
| | | | | | | | Keith is too clever for me. R=ken2 CC=golang-dev, khr https://codereview.appspot.com/13272050
* goyacc: Fix debug printing of the lexed token's ID and name, and add ↵Jamie Wilkinson2013-09-131-2/+2
| | | | | | | | | | whitespace in the 'stateX saw' message. R=golang-dev, r CC=golang-dev https://codereview.appspot.com/13352048 Committer: Rob Pike <r@golang.org>
* text/template/parse: mostly roll back the error detection for unmatched ↵Rob Pike2013-09-132-5/+4
| | | | | | | | | | | | | | | right delimiters It's too late to change this behavior: it breaks templates with minimized JavaScript. Makes me sad because this common error can never be caught: "{foo}}". Three cheers for compatibility. (Leave in a fix to a broken test.) R=golang-dev, dsymonds, rsc CC=golang-dev https://codereview.appspot.com/13689043
* cmd/go: do not support code.google.com/r/zzz projectsRuss Cox2013-09-121-1/+1
| | | | | | | | | | | | | This reverts CL 13261048. I have just learned that these are no longer supported on code.google.com (that is, it is impossible to create them), so there is little reason to add support in Go 1.2. Update issue 5408 R=golang-dev, dave, r CC=golang-dev https://codereview.appspot.com/13317046
* encoding/xml: add Encoder.FlushRuss Cox2013-09-122-0/+35
| | | | | | | | Fixes issue 6365. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/13627046
* runtime, cmd/gc, cmd/ld: ignore method wrappers in recoverRuss Cox2013-09-1218-80/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #1: Issue 5406 identified an interesting case: defer iface.M() may end up calling a wrapper that copies an indirect receiver from the iface value and then calls the real M method. That's two calls down, not just one, and so recover() == nil always in the real M method, even during a panic. [For the purposes of this entire discussion, a wrapper's implementation is a function containing an ordinary call, not the optimized tail call form that is somtimes possible. The tail call does not create a second frame, so it is already handled correctly.] Fix this bug by introducing g->panicwrap, which counts the number of bytes on current stack segment that are due to wrapper calls that should not count against the recover check. All wrapper functions must now adjust g->panicwrap up on entry and back down on exit. This adds slightly to their expense; on the x86 it is a single instruction at entry and exit; on the ARM it is three. However, the alternative is to make a call to recover depend on being able to walk the stack, which I very much want to avoid. We have enough problems walking the stack for garbage collection and profiling. Also, if performance is critical in a specific case, it is already faster to use a pointer receiver and avoid this kind of wrapper entirely. Bug #2: The old code, which did not consider the possibility of two calls, already contained a check to see if the call had split its stack and so the panic-created segment was one behind the current segment. In the wrapper case, both of the two calls might split their stacks, so the panic-created segment can be two behind the current segment. Fix this by propagating the Stktop.panic flag forward during stack splits instead of looking backward during recover. Fixes issue 5406. R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/13367052
* go/token: rename RemoveLine to MergeLine, improve documentationJosh Bleecher Snyder2013-09-122-6/+20
| | | | | | | | | | | | This is a follow-up to feedback from gri in https://codereview.appspot.com/12837044/. Most of the wording and naming improvements are lifted shamelessly from him. R=gri CC=golang-dev https://codereview.appspot.com/13670043 Committer: Robert Griesemer <gri@golang.org>
* crypto/x509: allow ECDSA public keys to be marshaled.Nicholas Sullivan2013-09-121-39/+41
| | | | | | | | | | | | The public key serialization from CreateCertificate is factored out to be used in MarshalPKIXPublicKey. Testcode with one P224 ECDSA keypair has been added. R=golang-dev, agl CC=agl, golang-dev https://codereview.appspot.com/13427044 Committer: Adam Langley <agl@golang.org>
* net/rpc: document thread safety requirements of codec types.Han-Wen Nienhuys2013-09-122-0/+2
| | | | | | | | | | Fixes issue 6306. R=golang-dev, bradfitz, r CC=golang-dev https://codereview.appspot.com/13474043 Committer: Rob Pike <r@golang.org>
* net/http: document ServeMux handling of pattern "/"Brad Fitzpatrick2013-09-122-0/+22
| | | | | | | | Fixes Issue 4799 R=golang-dev, dave, rsc CC=golang-dev https://codereview.appspot.com/13457047
* text/template: catch unmatched right delimiterRob Pike2013-09-123-1/+8
| | | | | | | | | It was simply a missing error case: when scanning plain text outside of an action, a right delimiter should be an error. R=golang-dev, dsymonds CC=golang-dev https://codereview.appspot.com/13468045
* net: move mock ICMP into separate fileMikio Hara2013-09-122-110/+116
| | | | | | | | This is in prepartion for fixing issue 6320. R=golang-dev, dave CC=golang-dev https://codereview.appspot.com/13611043
* net: make TestDialFailPDLeak shorterMikio Hara2013-09-121-7/+20
| | | | | | | | | | | | Reduces a number of trials but it still can detect memory leak when we make blunders in runtime-integarted network poller work, like just forgetting to call runtime_pollClose in code paths. Also disables the test on windows/386. R=alex.brainman, r CC=golang-dev https://codereview.appspot.com/13022046
* cmd/8l: fix 386 buildsDave Cheney2013-09-121-2/+1
| | | | | | | | Remove set but unused variable. R=rsc CC=golang-dev https://codereview.appspot.com/13490047
* cmd/5l, cmd/6l, cmd/8l: refactor stack split codeRuss Cox2013-09-113-575/+650
| | | | | | | | | | Pull the stack split generation into its own function. This will make an upcoming change to fix recover easier to digest. R=ken2 CC=golang-dev https://codereview.appspot.com/13611044
* undo CL 13348045 / 43675523c526Russ Cox2013-09-111-7/+5
| | | | | | | | | | | | | | | | | | There is no reason to do this, and it's more work. ??? original CL description net: make channel-based semaphore depend on receive, not send R=r, dvyukov CC=golang-dev https://codereview.appspot.com/13348045 Committer: Rob Pike <r@golang.org> ??? R=golang-dev, r CC=golang-dev https://codereview.appspot.com/13632047
* net/http: explain the "1.1" in the default User-AgentRuss Cox2013-09-111-0/+5
| | | | | | R=golang-dev, adg CC=golang-dev https://codereview.appspot.com/13263052