Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: VirtualAlloc of 1048576 bytes failed with errno=487 #14638

Closed
mei-rune opened this issue Mar 4, 2016 · 7 comments
Closed

runtime: VirtualAlloc of 1048576 bytes failed with errno=487 #14638

mei-rune opened this issue Mar 4, 2016 · 7 comments

Comments

@mei-rune
Copy link

mei-rune commented Mar 4, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 windows/386
  2. What operating system and processor architecture are you using (go env)?
    set GOARCH=386
    set GOBIN=
    set GOEXE=.exe
    set GOHOSTARCH=386
    set GOHOSTOS=windows
    set GOOS=windows
    set GOPATH=C:\tpt_programs\go_3td;C:\tpt_programs\Jenkins\jobs\xxx\workspace\src\engine
    set GORACE=
    set GOROOT=C:\tpt_programs\go
    set GOTOOLDIR=C:\tpt_programs\go\pkg\tool\windows_386
    set GO15VENDOREXPERIMENT=1
    set CC=gcc
    set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0
    set CXX=g++
    set CGO_ENABLED=1
  3. What did you do?
    (Use play.golang.org to provide a runnable example, if possible.)
    run 'go build' on the windows
  4. What did you expect to see?
    Build is ok.
  5. What did you see instead?
runtime: VirtualAlloc of 1048576 bytes failed with errno=487
fatal error: runtime: cannot map pages in arena address space

runtime stack:
runtime.throw(0x657940, 0x30)
    c:/go/src/runtime/panic.go:530 +0x7f
runtime.sysMap(0x41380000, 0x100000, 0x30c3fd01, 0x728fd8)
    c:/go/src/runtime/mem_windows.go:116 +0xf9
runtime.(*mheap).sysAlloc(0x7189a0, 0x100000, 0x0)
    c:/go/src/runtime/malloc.go:429 +0x121
runtime.(*mheap).grow(0x7189a0, 0x8, 0x0)
    c:/go/src/runtime/mheap.go:651 +0x52
runtime.(*mheap).allocSpanLocked(0x7189a0, 0x1, 0x313d9e60)
    c:/go/src/runtime/mheap.go:553 +0x485
runtime.(*mheap).alloc_m(0x7189a0, 0x1, 0x17, 0x16600, 0x313d9e60)
    c:/go/src/runtime/mheap.go:437 +0x116
runtime.(*mheap).alloc.func1()
    c:/go/src/runtime/mheap.go:502 +0x3d
runtime.systemstack(0x30c3fec4)
    c:/go/src/runtime/asm_386.s:329 +0x88
runtime.(*mheap).alloc(0x7189a0, 0x1, 0x17, 0x27f0100, 0x1606)
    c:/go/src/runtime/mheap.go:503 +0x5a
runtime.(*mcentral).grow(0x719c18, 0x0)
    c:/go/src/runtime/mcentral.go:209 +0x8e
runtime.(*mcentral).cacheSpan(0x719c18, 0x313d9e60)
    c:/go/src/runtime/mcentral.go:89 +0x4c0
runtime.(*mcache).refill(0x310000, 0x17, 0x313d9e60)
    c:/go/src/runtime/mcache.go:119 +0xab
runtime.mallocgc.func2()
    c:/go/src/runtime/malloc.go:642 +0x2b
runtime.systemstack(0x109ae000)
    c:/go/src/runtime/asm_386.s:313 +0x5e
runtime.mstart()
    c:/go/src/runtime/proc.go:1048

goroutine 1 [running]:
runtime.systemstack_switch()
    c:/go/src/runtime/asm_386.s:267 fp=0x3bd937f4 sp=0x3bd937f0
runtime.mallocgc(0x1c0, 0x5bd5c0, 0x0, 0x4)
    c:/go/src/runtime/malloc.go:643 +0x6ca fp=0x3bd93860 sp=0x3bd937f4
runtime.newobject(0x5bd5c0, 0x0)
    c:/go/src/runtime/malloc.go:781 +0x41 fp=0x3bd93874 sp=0x3bd93860
cmd/link/internal/ld.writelines()
    c:/go/src/cmd/link/internal/ld/dwarf.go:1651 +0xe77 fp=0x3bd93aac sp=0x3bd93874
cmd/link/internal/ld.Dwarfemitdebugsections()
    c:/go/src/cmd/link/internal/ld/dwarf.go:2108 +0x94a fp=0x3bd93bc0 sp=0x3bd93aac
cmd/link/internal/x86.asmb()
    c:/go/src/cmd/link/internal/x86/asm.go:729 +0xea2 fp=0x3bd93cdc sp=0x3bd93bc0
cmd/link/internal/ld.Ldmain()
    c:/go/src/cmd/link/internal/ld/pobj.go:248 +0x1ac6 fp=0x3bd93f28 sp=0x3bd93cdc
cmd/link/internal/x86.Main()
    c:/go/src/cmd/link/internal/x86/obj.go:44 +0x1c fp=0x3bd93f2c sp=0x3bd93f28
main.main()
    c:/go/src/cmd/link/main.go:25 +0xf6 fp=0x3bd93f98 sp=0x3bd93f2c
runtime.main()
    c:/go/src/runtime/proc.go:188 +0x234 fp=0x3bd93fc0 sp=0x3bd93f98
runtime.goexit()
    c:/go/src/runtime/asm_386.s:1585 +0x1 fp=0x3bd93fc4 sp=0x3bd93fc0
@mei-rune
Copy link
Author

mei-rune commented Mar 4, 2016

The code is closed source.

@mattn
Copy link
Member

mattn commented Mar 4, 2016

The code is closed source.

Please show me small code that can reproduce.

@davecheney
Copy link
Contributor

I don't think there is anything that can be done. Virtual address space on windows/386 is very limited and the program you are trying to build is simply too big.

Are you able to use a 64bit platform ?

@mei-rune
Copy link
Author

mei-rune commented Mar 4, 2016

I will try it on 64bit later.

@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 4, 2016
@minux
Copy link
Member

minux commented Mar 5, 2016 via email

@alexbrainman
Copy link
Member

errno=487 is ERROR_INVALID_ADDRESS. I wonder why calling VirtualAlloc here returns ERROR_INVALID_ADDRESS.

Alex

@mei-rune
Copy link
Author

mei-rune commented Mar 5, 2016

I run it on 64bit and is ok.
I run it on 32bit again and is ok.
it is arise almost by accident

@mei-rune mei-rune closed this as completed May 6, 2016
@golang golang locked and limited conversation to collaborators May 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants