1. 29 Mar, 2011 7 commits
  2. 28 Mar, 2011 11 commits
  3. 27 Mar, 2011 3 commits
  4. 26 Mar, 2011 6 commits
  5. 25 Mar, 2011 13 commits
    • Rob Pike's avatar
      testing: shorten some tests. · f0cf7d29
      Rob Pike authored
      These are the top runners.  More to come.
      Also print two digits of timing info under -test.v.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4317044
      f0cf7d29
    • Ian Lance Taylor's avatar
      test: match gccgo error messages for bug081.go. · 4cb660aa
      Ian Lance Taylor authored
      bug081.go:9:9: error: expected type
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4280071
      4cb660aa
    • Dave Cheney's avatar
      build: handle broken awk in version.bash · d165dc60
      Dave Cheney authored
      R=adg, rsc, ality
      CC=golang-dev
      https://golang.org/cl/4281069
      d165dc60
    • Rob Pike's avatar
      testing: set up structure for faster testing using the new -test.short flag. · d406f8f6
      Rob Pike authored
      New make target "testshort" runs "gotest -test.short" and is invoked
      by run.bash, which is invoked by all.bash.
      
      Use -test.short to make one package (crypto ecdsa) run much faster.
      More changes to come.
      
      Once this is in, I will update the long-running tests to use the new flag.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4317043
      d406f8f6
    • Ian Lance Taylor's avatar
      test: match gccgo error messages for bug016.go. · 47c1cef5
      Ian Lance Taylor authored
      bug016.go:11:8: error: negative shift count
      
      R=rsc, gri
      CC=golang-dev
      https://golang.org/cl/4312055
      47c1cef5
    • Peter Mundy's avatar
      net: fix Windows build · 91bcdb62
      Peter Mundy authored
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4314042
      91bcdb62
    • Albert Strasheim's avatar
      e83d6964
    • Albert Strasheim's avatar
      net: add FileConn, FilePacketConn, FileListener · e480b819
      Albert Strasheim authored
      R=iant, rsc, brainman
      CC=golang-dev
      https://golang.org/cl/4306042
      e480b819
    • Rob Pike's avatar
      23637846
    • Ian Lance Taylor's avatar
      test: match gccgo error messages for bug274.go. · 237ae641
      Ian Lance Taylor authored
      bug274.go:23:3: error: missing statement after label
      bug274.go:25:3: error: missing statement after label
      bug274.go:28:3: error: label ‘L2’ defined and not used
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4273114
      237ae641
    • Rob Pike's avatar
      flag: fix error in documentation example. · 9db2bc74
      Rob Pike authored
      Fixes #1615.
      This time for sure.
      
      R=rsc, gri
      CC=golang-dev
      https://golang.org/cl/4275079
      9db2bc74
    • Russ Cox's avatar
      runtime/pprof: disable test on darwin · 071d212a
      Russ Cox authored
      Fixes #1641.
      
      Actually it side steps the real issue, which is that the
      setitimer(2) implementation on OS X is not useful for
      profiling of multi-threaded programs.  I filed the below
      using the Apple Bug Reporter.
      
      /*
      Filed as Apple Bug Report #9177434.
      
      This program creates a new pthread that loops, wasting cpu time.
      In the main pthread, it sleeps on a condition that will never come true.
      Before doing so it sets up an interval timer using ITIMER_PROF.
      The handler prints a message saying which thread it is running on.
      
      POSIX does not specify which thread should receive the signal, but
      in order to be useful in a user-mode self-profiler like pprof or gprof
         http://code.google.com/p/google-perftools
         http://www.delorie.com/gnu/docs/binutils/gprof_25.html
      it is important that the thread that receives the signal is the one
      whose execution caused the timer to expire.
      
      Linux and FreeBSD handle this by sending the signal to the process's
      queue but delivering it to the current thread if possible:
      
         http://lxr.linux.no/linux+v2.6.38/kernel/signal.c#L802
           807        /*
           808         * Now find a thread we can wake up to take the signal off the queue.
           809         *
           810         * If the main thread wants the signal, it gets first crack.
           811         * Probably the least surprising to the average bear.
           812         * /
      
         http://fxr.watson.org/fxr/source/kern/kern_sig.c?v=FREEBSD8;im=bigexcerpts#L1907
           1914         /*
           1915          * Check if current thread can handle the signal without
           1916          * switching context to another thread.
           1917          * /
      
      On those operating systems, this program prints:
      
          $ ./a.out
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          signal on cpu-chewing looper thread
          $
      
      The OS X kernel does not have any such preference.  Its get_signalthread
      does not prefer current_thread(), in contrast to the other two systems,
      so the signal gets delivered to the first thread in the list that is able to
      handle it, which ends up being the main thread in this experiment.
      http://fxr.watson.org/fxr/source/bsd/kern/kern_sig.c?v=xnu-1456.1.26;im=excerpts#L1666
      
          $ ./a.out
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          signal on sleeping main thread
          $
      
      The fix is to make get_signalthread use the same heuristic as
      Linux and FreeBSD, namely to use current_thread() if possible
      before scanning the process thread list.
      
      */
      
      #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*);
      
      static pthread_t pmain, ploop;
      
      int
      main(void)
      {
              struct itimerval it;
              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(SIGPROF, &sa, 0);
      
              pmain = pthread_self();
              pthread_create(&ploop, 0, looper, 0);
      
              memset(&it, 0, sizeof it);
              it.it_interval.tv_usec = 10000;
              it.it_value = it.it_interval;
              setitimer(ITIMER_PROF, &it, 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)
      {
              static int nsig;
              pthread_t p;
      
              p = pthread_self();
              if(p == pmain)
                      printf("signal on sleeping main thread\n");
              else if(p == ploop)
                      printf("signal on cpu-chewing looper thread\n");
              else
                      printf("signal on %p\n", (void*)p);
              if(++nsig >= 10)
                      exit(0);
      }
      
      static void*
      looper(void *v)
      {
              for(;;);
      }
      
      R=r
      CC=golang-dev
      https://golang.org/cl/4273113
      071d212a
    • Ian Lance Taylor's avatar
      test: match gccgo error messages for label.go and label1.go. · 8beb4be8
      Ian Lance Taylor authored
      label.go:30:1: error: label ‘L6’ already defined
      label.go:28:1: note: previous definition of ‘L6’ was here
      label.go:23:1: error: label ‘L4’ defined and not used
      label.go:52:2: error: label ‘defalt’ defined and not used
      label.go:17:1: error: label ‘L2’ defined and not used
      label.go:26:1: error: label ‘L5’ defined and not used
      label.go:20:1: error: label ‘L3’ defined and not used
      label.go:14:1: error: label ‘L1’ defined and not used
      
      label1.go:32:13: error: invalid continue label ‘L2’
      label1.go:44:13: error: invalid continue label ‘L3’
      label1.go:52:10: error: invalid break label ‘L4’
      label1.go:55:13: error: invalid continue label ‘L4’
      label1.go:65:9: error: invalid break label ‘L5’
      label1.go:68:12: error: invalid continue label ‘L5’
      label1.go:76:10: error: invalid break label ‘L1’
      label1.go:79:13: error: invalid continue label ‘L1’
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4275078
      8beb4be8