1. 03 Oct, 2014 2 commits
  2. 29 Sep, 2014 1 commit
  3. 22 Sep, 2014 1 commit
    • runtime: Mark runtime_goexit function as noinline. · 76deefd0
      If the compiler inlines this function into kickoff, it may reuse
      the TLS block address to load g. However, this is not necessarily
      correct, as the call to g->entry in kickoff may cause the TLS
      address to change. If the wrong value is loaded for g->status in
      runtime_goexit, it may cause a runtime panic.
      
      By marking the function as noinline we prevent the compiler from
      reusing the TLS address.
      
      From-SVN: r215484
      Ian Lance Taylor committed
  4. 20 Sep, 2014 1 commit
  5. 05 Sep, 2014 2 commits
  6. 03 Sep, 2014 1 commit
  7. 15 Aug, 2014 1 commit
  8. 13 Aug, 2014 1 commit
    • compiler, runtime: Fix unexpected GC interfering with closure passing. · 798c183f
      The Go frontend passes closures through to functions using the
      functions __go_set_closure and __go_get_closure.  The
      expectation is that there are no function calls between
      set_closure and get_closure.  However, it turns out that there
      can be function calls if some of the function arguments
      require type conversion to an interface type.  Converting to
      an interface type can allocate memory, and that can in turn
      trigger a garbage collection, and that can in turn call pool
      cleanup functions that may call __go_set_closure.  So the
      called function can see the wrong closure value, which is bad.
      
      This patch fixes the problem in two different ways.  First, we
      move all type conversions in function arguments into temporary
      variables so that they can not appear before the call to
      __go_set_closure.  (This required shifting the flatten phase
      after the simplify_thunk phase, since the latter expects to
      work with unconverted argument types.)  Second, we fix the
      memory allocation function to preserve the closure value
      across any possible garbage collection.
      
      A test case is the libgo database/sql check run with the
      environment variable GOGC set to 1.
      
      From-SVN: r213932
      Ian Lance Taylor committed
  9. 04 Aug, 2014 1 commit
  10. 02 Aug, 2014 1 commit
    • re PR other/61895 (libbacktrace crashes with bus error with empty file argv[0]) · dc14e88e
      	PR other/61895
      
      runtime: Ignore small argv[0] file for backtrace.
      
      Reportedly in some cases Docker starts processes with argv[0]
      pointing to an empty file.  That would cause libgo to pass
      that empty file to libbacktrace, which would then fail to do
      any backtraces.  Everything should work fine if libbacktrace
      falls back to /proc/self/exe.
      
      This patch to libgo works around the problem by ignoring
      argv[0] if it is a small file, or if stat fails.  This is not
      a perfect fix but it's an unusual problem.
      
      From-SVN: r213513
      Ian Lance Taylor committed
  11. 20 Jul, 2014 3 commits
  12. 19 Jul, 2014 3 commits
  13. 12 Jul, 2014 1 commit
  14. 11 Jul, 2014 2 commits
  15. 02 Jul, 2014 1 commit
  16. 01 Jul, 2014 1 commit
  17. 24 Jun, 2014 1 commit
  18. 13 Jun, 2014 2 commits
    • re PR go/52583 (Several new go testsuite failues on Solaris) · 2abacbae
      	PR go/52583
      runtime: Stop backtrace at a few recognized functions.
      
      On x86_64 Solaris the makecontext function does not properly
      indicate that it is at the top of the stack.  Attempting to
      unwind the stack past a call to makecontext tends to crash.
      This patch changes libgo to look for certain functions that
      are always found at the top of the stack, and to stop
      unwinding when it reaches one of those functions.  There is
      never anything interesting past these functions--that is,
      there is never any code written by the user.
      
      From-SVN: r211640
      Ian Lance Taylor committed
    • re PR go/61498 (Many 64-bit Go tests SEGV in scanblock) · eec40eac
      	PR go/61498
      runtime: Always set gcnext_sp to pointer-aligned address.
      
      The gcnext_sp field is only used on systems that do not use
      split stacks.  It marks the bottom of the stack for the
      garbage collector.  This change makes sure that the stack
      bottom is always aligned to a pointer value.
      
      Previously the garbage collector would align all the addresses
      that it scanned, but it now expects them to be aligned before
      scanning.
      
      From-SVN: r211639
      Ian Lance Taylor committed
  19. 10 Jun, 2014 1 commit
  20. 06 Jun, 2014 1 commit
  21. 04 Jun, 2014 1 commit
    • libgo: Merge from revision 18783:00cce3a34d7e of master library. · bae90c98
      This revision was committed January 7, 2014.  The next
      revision deleted runtime/mfinal.c.  That will be done in a
      subsequent merge.
      
      This merge changes type descriptors to add a zero field,
      pointing to a zero value for that type.  This is implemented
      as a common variable.
      
      	* go-gcc.cc (Gcc_backend::implicit_variable): Add is_common and
      	alignment parameters.  Permit init parameter to be NULL.
      
      From-SVN: r211249
      Ian Lance Taylor committed
  22. 30 May, 2014 1 commit
  23. 29 May, 2014 2 commits
    • runtime: add the --without-libatomic configure option · 9a85ed03
      This adds the --without-libatomic configure option, which is useful for building libgo
      with a non-gcc compiler.
      
      It disables libgo's dependency on libatomic. This
      is useful for platforms where it is known that the libatomic runtime
      functions are not required, or where the compiler automatically
      provides an implementation of them.
      
      From-SVN: r211065
      Ian Lance Taylor committed
    • runtime: disable split stacks for runtime_printf function under Clang · d76a1885
      LLVM's code generator does not currently support split stacks for vararg
      functions, so we disable split stacks for the only function that uses this
      feature under Clang. This appears to be OK as long as:
      - this function only calls non-inlined, internal-linkage (hence no dynamic
        loader) functions compiled with split stacks (i.e. go_vprintf), which can
        allocate more stack space as required;
      - this function itself does not occupy more than BACKOFF bytes of stack space
        (see libgcc/config/i386/morestack.S).
      These conditions are currently known to be satisfied by Clang on x86-32 and
      x86-64. Note that signal handlers receive slightly less stack space than they
      would normally do if they happen to be called while this function is being
      run. If this turns out to be a problem we could consider increasing BACKOFF.
      
      From-SVN: r211037
      Ian Lance Taylor committed
  24. 28 May, 2014 1 commit
  25. 27 May, 2014 1 commit
  26. 07 May, 2014 2 commits
  27. 01 May, 2014 1 commit
  28. 25 Apr, 2014 1 commit
    • re PR go/60931 (libgo has issues when page size is not 4k) · 9490b8da
      	PR go/60931
      
      runtime: Fix garbage collector issue with non 4kB system page size
      
      The go garbage collector tracks memory in terms of 4kB pages.
      Most of the code checks getpagesize() at runtime and does the
      right thing.
      
      On a 64kB ppc64 box I see SEGVs in long running processes
      which has been diagnosed as a bug in scavengelist.
      scavengelist does a madvise(MADV_DONTNEED) without rounding
      the arguments to the system page size.  A strace of one of the
      failures shows the problem:
      
      madvise(0xc211030000, 4096, MADV_DONTNEED) = 0
      
      The kernel rounds the length up to 64kB and we mark 60kB of
      valid data as no longer needed.
      
      Round start up to a system page and end down before calling
      madvise.
      
      From-SVN: r209777
      Ian Lance Taylor committed
  29. 17 Apr, 2014 2 commits