1. 05 Sep, 2014 11 commits
    • Alex Brainman's avatar
      net: temporarily skip TestAcceptIgnoreSomeErrors · 0f9b6aff
      Alex Brainman authored
      Update #8662
      
      LGTM=bradfitz
      R=golang-codereviews, bradfitz
      CC=golang-codereviews
      https://golang.org/cl/138120043
      0f9b6aff
    • Keith Randall's avatar
      runtime: convert panic/recover to Go · 8217b4a2
      Keith Randall authored
      created panic1.go just so diffs were available.
      After this CL is in, I'd like to move panic.go -> defer.go
      and panic1.go -> panic.go.
      
      LGTM=rsc
      R=rsc, khr
      CC=golang-codereviews
      https://golang.org/cl/133530045
      8217b4a2
    • Russ Cox's avatar
      runtime: use cas loop to coordinate with sigprof · e0f08b93
      Russ Cox authored
      sigprof and setcpuprofilerate coordinate the enabling/disabling
      of the handler using a Mutex. This has always been a bit dodgy:
      setcpuprofilerate must be careful to turn off signals before acquiring
      the lock to avoid a deadlock.
      
      Now the lock implementations use onM, and onM isn't okay on the
      signal stack. We know how to make it okay, but it's more work than
      is probably worth doing.
      
      Since this is super-dodgy anyway, replace the lock with a simple
      cas loop. It is only contended if setcpuprofilerate is being called,
      and that doesn't happen frequently enough to care about the
      raw speed or about using futexes/semaphores.
      
      TBR to fix freebsd/amd64 and dragonfly/amd64 builds.
      Happy to make changes in a follow-up CL.
      
      TBR=dvyukov
      CC=golang-codereviews
      https://golang.org/cl/141080044
      e0f08b93
    • Russ Cox's avatar
      syscall: in linux/arm Syscall, zero R3, R4, R5 · 83824639
      Russ Cox authored
      The general kernel system call interface
      takes 6 arguments: R0, R1, R2, R3, R4, R5.
      
      Syscall is for calls that only need 3.
      The amd64 and 386 versions zero the extra arg registers,
      but the arm version does not.
      
      func utimensat calls Syscall with 3 arguments.
      The kernel expects a 4th argument.
      That turns out to be whatever is in R3 at the time of the call.
      CL 137160043 changed various pieces of code and apparently
      changed the value left in R3 at the time of utimensat's Syscall.
      This causes the kernel to return EINVAL.
      
      Change linux/arm Syscall to zero R3, R4, R5, so that calls will
      behave deterministically, even if they pass too few arguments.
      
      Arguably, utimensat could be fixed too, but the predictable
      zeroing is certainly worth doing, and once done utimensat's
      use of Syscall is fine.
      
      Fixes arm build.
      
      TBR=bradfitz
      CC=golang-codereviews
      https://golang.org/cl/141080043
      83824639
    • Russ Cox's avatar
      runtime: use new #include "textflag.h" · cb040d59
      Russ Cox authored
      I did this just to clean things up, but it will be important
      when we drop the pkg directory later.
      
      LGTM=bradfitz
      R=r, bradfitz
      CC=golang-codereviews
      https://golang.org/cl/132600043
      cb040d59
    • Russ Cox's avatar
      runtime: do not stop traceback at onM · d16a2ad0
      Russ Cox authored
      Behavior before this CL:
      
      1. If onM is called on a g0 stack, it just calls the given function.
      
      2. If onM is called on a gsignal stack, it calls badonm.
      
      3. If onM is called on a curg stack, it switches to the g0 stack
      and then calls the function.
      
      In cases 1 and 2, if the program then crashes (and badonm always does),
      we want to see what called onM, but the traceback stops at onM.
      In case 3, the traceback must stop at onM, because the g0
      stack we are renting really does stop at onM.
      
      The current code stops the traceback at onM to handle 3,
      at the cost of making 1 and 2 crash with incomplete traces.
      
      Change traceback to scan past onM but in case 3 make it look
      like on the rented g0 stack, onM was called from mstart.
      The traceback already knows that mstart is a top-of-stack function.
      
      Alternate fix at CL 132610043 but I think this one is cleaner.
      This CL makes 3 the exception, while that CL makes 1 and 2 the exception.
      
      Submitting TBR to try to get better stack traces out of the
      freebsd/amd64 builder, but happy to make changes in a
      followup CL.
      
      TBR=khr
      R=khr
      CC=golang-codereviews
      https://golang.org/cl/133620043
      d16a2ad0
    • Russ Cox's avatar
      cmd/dist: another attempt at textflag.h · cf3fd0a5
      Russ Cox authored
      The old change worked fine in my client, but my client
      must not have been in a completely clean state.
      
      TBR=r
      CC=golang-codereviews
      https://golang.org/cl/138100043
      cf3fd0a5
    • Russ Cox's avatar
      cmd/dist: make textflag.h available in runtime, avoid android/linux conflicts · 73a6d36d
      Russ Cox authored
      1) cmd/dist was copying textflag.h to the build include directory,
      but only after compiling package runtime. So other packages could
      use it, just not runtime. Copy earlier, so that runtime can use it too.
      
      2) We decided for android that anything marked linux is also included
      in the build. The generated linux-specific files in cmd/dist must therefore
      have explicit +build !android tags, or else you can't have simultaneous
      linux/arm and android/arm builds in a single client. The tag was already
      there for at least one file, but it was missing from many others.
      
      LGTM=r
      R=r
      CC=golang-codereviews
      https://golang.org/cl/134500043
      73a6d36d
    • Russ Cox's avatar
      runtime: mark sysAlloc nosplit · 99a08262
      Russ Cox authored
      sysAlloc is the only mem function called from Go.
      
      LGTM=iant, khr
      R=golang-codereviews, khr, 0intro, iant
      CC=dvyukov, golang-codereviews, r
      https://golang.org/cl/139210043
      99a08262
    • Russ Cox's avatar
      runtime: more C to Go conversion adjustments · db58ab96
      Russ Cox authored
      Mostly NOSPLIT additions.
      Had to rewrite atomic_arm.c in Go because it calls lock,
      and lock is too complex.
      
      With this CL, I find no Go -> C calls that can split the stack
      on any system except Solaris and Windows.
      
      Solaris and Windows need more work and will be done separately.
      
      LGTM=iant, dave
      R=golang-codereviews, bradfitz, iant, dave
      CC=dvyukov, golang-codereviews, khr, r
      https://golang.org/cl/137160043
      db58ab96
    • Brad Fitzpatrick's avatar
      cmd/api: don't depend on os/user or USER to check api · 1a14b5ba
      Brad Fitzpatrick authored
      The -nocgo builder failed because it has cgo disabled
      as well as no USER environment variable:
      http://build.golang.org/log/2250abb82f5022b72a12997b8ff89fcdeff094c9
      
      # Checking API compatibility.
      Error getting current user: user: Current not implemented on linux/amd64
      exit status 1
      
      Don't require the environment variable here.
      
      LGTM=minux
      R=dave, adg, minux
      CC=golang-codereviews
      https://golang.org/cl/140290043
      1a14b5ba
  2. 04 Sep, 2014 23 commits
  3. 03 Sep, 2014 6 commits
    • Rob Pike's avatar
      text/template: 0xef is an integer, not a floating-point value. · 55fa7659
      Rob Pike authored
      The discriminator in the execution engine was stupid.
      Add a test to the parse package too. The problem wasn't there
      but the particular case ('e' in a hex integer) was not covered.
      
      Fixes #8622.
      
      LGTM=ruiu
      R=golang-codereviews, ruiu
      CC=golang-codereviews
      https://golang.org/cl/133530043
      55fa7659
    • Russ Cox's avatar
      runtime: make entersyscall/exitsyscall safe for stack splits · 5ea69978
      Russ Cox authored
      It is fundamentally unsafe to grow the stack once someone
      has made a call to syscall.Syscall. That function takes 6 uintptr
      arguments, but depending on the call some are pointers.
      In fact, some might be pointers to stack values, and we don't know which.
      That makes it impossible to copy the stack somewhere else.
      Since we want to delete all the stack splitting code, relying only
      on stack copying, make sure that Syscall never needs to split the stack.
      
      The only thing Syscall does is:
              call entersyscall
              make the system call
              call exitsyscall
      
      As long as we make sure that entersyscall and exitsyscall
      can live in the nosplit region, they won't ask for more stack.
      
      Do this by making entersyscall and exitsyscall set up the
      stack guard so that any call to a function with a split check
      will cause a crash. Then move non-essential slow-path
      work onto the m stack using onM and mark the rest of the
      work nosplit. The linker will verify that the chain of nosplits
      fits in the total nosplit budget.
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=dvyukov, golang-codereviews, khr, r
      https://golang.org/cl/140950043
      5ea69978
    • Robin Eklind's avatar
      spec: Add link to rune literals from string literals when talking about escape sequences. · f82097f5
      Robin Eklind authored
      LGTM=gri
      R=golang-codereviews, gobot, gri
      CC=golang-codereviews
      https://golang.org/cl/140750043
      f82097f5
    • Russ Cox's avatar
      runtime: convert symtab.c into symtab.go · 97f8386a
      Russ Cox authored
      Because symtab.c was partially converted before,
      the diffs are not terribly useful.
      
      The earlier conversion was trying to refactor or
      clean up the code in addition to doing the translation.
      It also made a mistake by redefining Func to be something
      users could overwrite.
      
      I undid those changes, making symtab.go a more
      literal line-for-line translation of symtab.c instead.
      
      LGTM=josharian
      R=golang-codereviews, dave, bradfitz, josharian
      CC=golang-codereviews, iant, khr, r
      https://golang.org/cl/140880043
      97f8386a
    • Brad Fitzpatrick's avatar
      runtime: relax flaky GC pause test · 4930a8d0
      Brad Fitzpatrick authored
      We often saw GC pauses of 0 ns, not just on Windows.
      Google Compute Engine timer granularity might suck
      too.
      
      LGTM=rsc
      R=rsc, dvyukov
      CC=golang-codereviews
      https://golang.org/cl/140910043
      4930a8d0
    • Russ Cox's avatar
      runtime: remove guard against uninitialized forcegc.g · 176c4469
      Russ Cox authored
      The race was in the old C code.
      The new Go code does not have the race
      and does not need the check.
      
      LGTM=bradfitz, dvyukov
      R=golang-codereviews, bradfitz, dvyukov
      CC=golang-codereviews, rlh
      https://golang.org/cl/140180043
      176c4469