go: runtime: crosscompiled to AIX/ppc64 not working in IBMi PASE (AIX7.2) due to "not in usable address space"
I want to crosscompile a simple Hello-World example to IBM-i PASE environment. This is a AIX 7.2 subsystem on the IBMi (AS400). Normally AIX compiled code should work in this environment.
But when i want to run the test application i get the following error:
runtime: memory allocated by OS [0x700000028000000, 0x70000002c000000) not in usable address space: base outside usable address space
fatal error: memory reservation exceeds address space limit
runtime stack:
runtime.throw(0x1000d9f06, 0x2e)
/usr/lib/go-1.14/src/runtime/panic.go:1116 +0x68 fp=0xffffffffffff590 sp=0xffffffffffff550 pc=0x100032e08
runtime.(*mheap).sysAlloc(0x180037440, 0x400000, 0x100062a18, 0x9001000a01a1450)
/usr/lib/go-1.14/src/runtime/malloc.go:706 +0x838 fp=0xffffffffffff660 sp=0xffffffffffff590 pc=0x10000a9a8
runtime.(*mheap).grow(0x180037440, 0x1, 0x0)
/usr/lib/go-1.14/src/runtime/mheap.go:1286 +0x18c fp=0xffffffffffff6f0 sp=0xffffffffffff660 pc=0x10002586c
runtime.(*mheap).allocSpan(0x180037440, 0x1, 0x2a000100062a18, 0x18004d8e8, 0x900000000332200)
/usr/lib/go-1.14/src/runtime/mheap.go:1124 +0x748 fp=0xffffffffffff780 sp=0xffffffffffff6f0 pc=0x100025578
runtime.(*mheap).alloc.func1()
/usr/lib/go-1.14/src/runtime/mheap.go:871 +0x7c fp=0xffffffffffff7e8 sp=0xffffffffffff780 pc=0x10005e26c
runtime.systemstack(0xffffffffffff840)
/usr/lib/go-1.14/src/runtime/asm_ppc64x.s:295 +0xd0 fp=0xffffffffffff808 sp=0xffffffffffff7e8 pc=0x1000604c0
...
Is this a problem which can be solved easily? How can i fix this?
This is the go code i compiled
package main
import "fmt"
func main() {
fmt.Println("hello world22e")
}
i tried the crosscompile from windows and linux with the same result.
greetings, Franz
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 57 (11 by maintainers)
i futher investigated the “System error - error data is: -1 9 (64002005)”. The underlaying reason is that os.MkDir and os.MkDirAll are sometimes returning without the directory been created. i have done an ugly hack and call xmkdirall and xmkdir 10 times. with this the 64002005 errors go away.
maybe someone has an idea why this commands return without creating the dir immediately.
Here is the diff. You can bootstrap amd compile go with that (xmkdir… are ugly i know. maybe someone could suggest a clean solution):
compile command:
GOTMPDIR=/develop/tmp CGO_ENABLED=0 GOROOT_BOOTSTRAP=/develop/go-aix-ppc64-bootstrap/ ./make.bash