1. 02 Mar, 2011 2 commits
    • Russ Cox's avatar
      runtime: record goroutine creation pc and display in traceback · 324cc3d0
      Russ Cox authored
      package main
      
      func main() {
              go func() { *(*int)(nil) = 0 }()
              select{}
      }
      
      panic: runtime error: invalid memory address or nil pointer dereference
      
      [signal 0xb code=0x1 addr=0x0 pc=0x1c96]
      
      runtime.panic+0xac /Users/rsc/g/go/src/pkg/runtime/proc.c:1083
              runtime.panic(0x11bf0, 0xf8400011f0)
      runtime.panicstring+0xa3 /Users/rsc/g/go/src/pkg/runtime/runtime.c:116
              runtime.panicstring(0x29a57, 0x0)
      runtime.sigpanic+0x144 /Users/rsc/g/go/src/pkg/runtime/darwin/thread.c:470
              runtime.sigpanic()
      main._func_001+0x16 /Users/rsc/g/go/src/pkg/runtime/x.go:188
              main._func_001()
      runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:150
              runtime.goexit()
      ----- goroutine created by -----
      main.main+0x3d /Users/rsc/g/go/src/pkg/runtime/x.go:4
      
      goroutine 1 [4]:
      runtime.gosched+0x77 /Users/rsc/g/go/src/pkg/runtime/proc.c:598
              runtime.gosched()
      runtime.block+0x27 /Users/rsc/g/go/src/pkg/runtime/chan.c:680
              runtime.block()
      main.main+0x44 /Users/rsc/g/go/src/pkg/runtime/x.go:5
              main.main()
      runtime.mainstart+0xf /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:77
              runtime.mainstart()
      runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:150
              runtime.goexit()
      ----- goroutine created by -----
      _rt0_amd64+0x8e /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:64
      
      Fixes #1563.
      
      R=r
      CC=golang-dev
      https://golang.org/cl/4243046
      324cc3d0
    • Brad Fitzpatrick's avatar
      http: initialize request Header for the transport · 9733f96b
      Brad Fitzpatrick authored
      Fixes #1558
      
      R=rsc, r, bradfitzwork
      CC=golang-dev
      https://golang.org/cl/4260042
      9733f96b
  2. 01 Mar, 2011 9 commits
  3. 28 Feb, 2011 7 commits
  4. 26 Feb, 2011 1 commit
    • Nigel Tao's avatar
      compress/lzw: don't use a closure in NewReader, which avoids having · fdbbb066
      Nigel Tao authored
      to move some variables from the stack to the heap.
      
      Sorted benchmark runs on my 2007-era Mac Mini (GOARCH=amd64, GOOS=linux):
      
      Before:
      lzw.BenchmarkDecoder        2000        878176 ns/op
      lzw.BenchmarkDecoder        2000        878415 ns/op
      lzw.BenchmarkDecoder        2000        880352 ns/op
      lzw.BenchmarkDecoder        2000        898445 ns/op
      lzw.BenchmarkDecoder        2000        901728 ns/op
      
      After:
      lzw.BenchmarkDecoder        2000        859065 ns/op
      lzw.BenchmarkDecoder        2000        859402 ns/op
      lzw.BenchmarkDecoder        2000        860035 ns/op
      lzw.BenchmarkDecoder        2000        860555 ns/op
      lzw.BenchmarkDecoder        2000        861109 ns/op
      
      The ratio of before/after median times is 1.024.
      
      The runtime.MemStats.Mallocs delta per loop drops from 109 to 104.
      
      R=r, r2, dfc
      CC=golang-dev
      https://golang.org/cl/4253043
      fdbbb066
  5. 25 Feb, 2011 17 commits
  6. 24 Feb, 2011 4 commits
    • Nigel Tao's avatar
      compress/lzw: implement an encoder. · 741eab4e
      Nigel Tao authored
      R=rsc, nigeltao_gnome
      CC=golang-dev
      https://golang.org/cl/4209043
      741eab4e
    • Russ Cox's avatar
      reflect: add pointer word to CommonType · 8d36a784
      Russ Cox authored
      The pointer will eventually let us find *T given T.
      This CL just makes room for it, always storing a zero.
      
      R=r, r2
      CC=golang-dev
      https://golang.org/cl/4221046
      8d36a784
    • Russ Cox's avatar
      runtime: fix signal stack bug · 820dc9ff
      Russ Cox authored
      In CL 4188061 I changed malg to allocate the requested
      number of bytes n, not n+StackGuard, so that the
      allocations would use rounder numbers.
      
      The allocation of the signal stack asks for 32k and
      then used g->stackguard as the base, but g->stackguard
      is StackGuard bytes above the base.  Previously, asking
      for 32k meant getting 32k+StackGuard bytes, so using
      g->stackguard as the base was safe.  Now, the actual base
      must be computed, so that the signal handler does not
      run StackGuard bytes past the top of the stack.
      
      Was causing flakiness mainly in programs that use the
      network, because they sometimes write to closed network
      connections, causing SIGPIPEs.  Was also causing problems
      in the doc/progs test.
      
      Also fix Makefile so that changes to stack.h trigger rebuild.
      
      R=bradfitzgo, r, r2
      CC=golang-dev
      https://golang.org/cl/4230044
      820dc9ff
    • Russ Cox's avatar
      ld: weak symbols · d94bf762
      Russ Cox authored
      A reference to the address of weak.foo resolves at link time
      to the address of the symbol foo if foo would end up in the
      binary anyway, or to zero if foo would not be in the binary.
      
      For example:
      
              int xxx = 1;
              int yyy = 2;
              int weak·xxx;
              int weak·yyy;
      
              void main·main(void) {
                      runtime·printf("%p %p %p\n", &xxx, &weak·xxx, &weak·yyy);
              }
      
      prints the same non-nil address twice, then 0 (because yyy is not
      referenced so it was dropped from the binary).
      
      This will be used by the reflection tables.
      
      R=iant
      CC=golang-dev
      https://golang.org/cl/4223044
      d94bf762