This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Go patch committed: Update Go library
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Mon, 31 Oct 2011 17:14:58 +0100
- Subject: Re: Go patch committed: Update Go library
- References: <mcr4nyv718a.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Ian Lance Taylor <iant@google.com> writes:
> This patch updates the Go library to the most recent weekly release. I
> think the only potential portability issues here are the use of the
> ipv6_mreq struct. I'm not entirely sure the new exp/terminal package is
> portable, but it might be.
>
> I have not included the entire patch here, because it is too large and
> it's just copying changes anyhow. I've included all patches to files
> which are specific to the Go frontend version.
After this change, I'm seeing another issue: most 32-bit go execution
tests fail like this on Solaris 11/x86:
/vol/gcc/src/hg/trunk/local/libgo/runtime/malloc.goc:366: libgo assertion failure
FAIL: go.go-torture/execute/array-1.go execution, -O0
Running the test under truss, I find:
14261: mmap(0xFF000000, 805306368, PROT_NONE, MAP_PRIVATE|MAP_ANON, -1, 0) Err#12 ENOMEM
With truss -u (user function tracing), I see:
14285/1@1: -> libgo:runtime_mallocinit()
14285/1@1: -> libgo:runtime_InitSizes()
14285/1@1: <- libgo:runtime_InitSizes() = 2
14285/1@1: -> libgo:runtime_SysReserve()
14285/1: mmap(0xFF000000, 805306368, PROT_NONE, MAP_PRIVATE|MAP_ANON, -1, 0) Err#12 ENOMEM
14285/1@1: <- libgo:runtime_SysReserve() = -1
14285/1@1: -> libgo:__go_assert_fail()
If I remove the adjustment in runtime/malloc.goc (runtime_mallocinit),
the test passes:
14445/1: mmap(0xFEF78114, 805306368, PROT_NONE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xCE000000
This stuff seems incredibly fragile, and I don't exactly understand
why. Besides, the assertion failure above is strange/wrong in two ways:
/vol/gcc/src/hg/trunk/local/libgo/runtime/malloc.goc:366: libgo assertion failure
* I'd expect to see the message from runtime_throw() here, not just
`libgo assertion failure'.
* The message points to the wrong line due to a broken test: malloc.goc
has:
p = runtime_SysReserve((void*)(0x00f8ULL<<32), bitmap_size + arena_size);
if(p == nil)
runtime_throw("runtime: cannot reserve arena virtual address space");
On failure, p will be MAP_FAILED ((void *)-1), not nil, so the wrong
assertion it thrown.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University