<p dir="auto">by <strong><a href="mailto:jaq@spacepants.org">jaq@spacepants.org</a></strong>:</p>
<pre class="notranslate">I just downloaded the source code release branch from code.google.com per the
instructions, then ran all.bash:

hg clone ...
hg update release
cd go/src
./all.bash
...
--- FAIL: TestLookupHost (0.00 seconds)
    hosts_test.go:65: LookupHost("localhost") = [127.0.0.1 127.0.0.1], has duplicate addresses
FAIL
FAIL    net 2.379s
...

My /etc/hosts is managed by a config management tool and just happens to have put two
localhost entries in there (I didn't know this until now ;-)

cat /etc/hosts
...
127.0.0.1   gunstar localhost
...
127.0.0.1   localhost   

The test seems a bit fragile because it relies on config outside the control of the Go
source code.</pre>
<p dir="auto">by <strong><a href="mailto:dave@lytics.io">dave@lytics.io</a></strong>:</p>
<pre class="notranslate">Building with the race detector enabled sometimes blows up and consumes all available
memory. This happens for me with the package "labix.org/v2/mgo" .

What steps will reproduce the problem?

Download labix.org/v2/mgo and build it with -race:

{{{
$ mkdir ~/gopathtemp
$ export GOPATH=~/gopathtemp
$ go get labix.org/v2/mgo
$ cd $GOPATH/src/labix.org/v2/mgo
$ free -h
             total       used       free     shared    buffers     cached
Mem:           31G        11G        19G         0B       154M       1.4G
-/+ buffers/cache:        10G        20G
Swap:           0B         0B         0B
$ go build -v -race
labix.org/v2/mgo/bson
labix.org/v2/mgo
go build labix.org/v2/mgo: signal: killed
}}}

The final command "go build -race" takes about 30 seconds and uses 18G of RAM
before being OOM-killed. In /var/log/syslog, the following appears:

{{{Aug 20 13:55:34 dave2 kernel: [12453.191018] 6g invoked oom-killer: gfp_mask=0x280da,
order=0, oom_score_adj=0
Aug 20 13:55:34 dave2 kernel: [12453.191022] 6g cpuset=/ mems_allowed=0
Aug 20 13:55:34 dave2 kernel: [12453.191025] Pid: 6445, comm: 6g Tainted: GF           
3.8.0-29-generic #42-Ubuntu
Aug 20 13:55:34 dave2 kernel: [12453.191026] Call Trace:
Aug 20 13:55:34 dave2 kernel: [12453.191042]  [&lt;ffffffff816c199e&gt;]
dump_header+0x80/0x1c3
Aug 20 13:55:34 dave2 kernel: [12453.191046]  [&lt;ffffffff81132ec7&gt;]
oom_kill_process+0x1b7/0x320
Aug 20 13:55:34 dave2 kernel: [12453.191049]  [&lt;ffffffff81065a45&gt;] ?
has_ns_capability_noaudit+0x15/0x20
Aug 20 13:55:34 dave2 kernel: [12453.191051]  [&lt;ffffffff81065a67&gt;] ?
has_capability_noaudit+0x17/0x20
Aug 20 13:55:34 dave2 kernel: [12453.191053]  [&lt;ffffffff81133607&gt;]
out_of_memory+0x417/0x450
Aug 20 13:55:34 dave2 kernel: [12453.191056]  [&lt;ffffffff81138b96&gt;]
__alloc_pages_nodemask+0x7e6/0x920
Aug 20 13:55:34 dave2 kernel: [12453.191060]  [&lt;ffffffff81175a75&gt;]
alloc_pages_vma+0xa5/0x150
Aug 20 13:55:34 dave2 kernel: [12453.191063]  [&lt;ffffffff81158739&gt;]
handle_pte_fault+0x2d9/0x450
Aug 20 13:55:34 dave2 kernel: [12453.191065]  [&lt;ffffffff81159209&gt;]
handle_mm_fault+0x299/0x670
Aug 20 13:55:34 dave2 kernel: [12453.191068]  [&lt;ffffffff8115fa63&gt;] ?
mmap_region+0x2a3/0x640
Aug 20 13:55:34 dave2 kernel: [12453.191071]  [&lt;ffffffff816d0c7d&gt;]
__do_page_fault+0x18d/0x500
Aug 20 13:55:34 dave2 kernel: [12453.191073]  [&lt;ffffffff8116004d&gt;] ?
do_mmap_pgoff+0x24d/0x340
Aug 20 13:55:34 dave2 kernel: [12453.191076]  [&lt;ffffffff8109297f&gt;] ?
__dequeue_entity+0x2f/0x50
Aug 20 13:55:34 dave2 kernel: [12453.191079]  [&lt;ffffffff8114b7c8&gt;] ?
vm_mmap_pgoff+0x88/0xb0
Aug 20 13:55:34 dave2 kernel: [12453.191082]  [&lt;ffffffff816d0ffe&gt;]
do_page_fault+0xe/0x10
Aug 20 13:55:34 dave2 kernel: [12453.191084]  [&lt;ffffffff816cd618&gt;]
page_fault+0x28/0x30
}}}
 


I'm running Ubuntu 13.04 AMD64, with 32G of RAM (see the "free -h" command
above):
{{{
$ uname -a
Linux dave2 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013 x86_64 x86_64
x86_64 GNU/Linux

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
}}}

What is the expected output?
"go build -race" should produce a binary and terminate. It does neither.

What do you see instead?
"go build -race" runs for 30 seconds before using all available memory and
being killed by the OOM killer.

Which compiler are you using (5g, 6g, 8g, gccgo)?
I'm using the go 1.1.2 tar distribution from golang.org and running "go build
-race".

Which operating system are you using?
Ubuntu 13.04 AMD64.

Which version are you using?  (run 'go version')
1.1.2

Please provide any additional information below.</pre>