{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/22914","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/22914/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/22914/comments","events_url":"https://api.github.com/repos/golang/go/issues/22914/events","html_url":"https://github.com/golang/go/issues/22914","id":277587030,"number":22914,"title":"runtime: failure to getPageSize on netbsd-386","user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars1.githubusercontent.com/u/2621?v=4","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"labels":[{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false},{"id":199753589,"url":"https://api.github.com/repos/golang/go/labels/OS-NetBSD","name":"OS-NetBSD","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/56","html_url":"https://github.com/golang/go/milestone/56","labels_url":"https://api.github.com/repos/golang/go/milestones/56/labels","id":2473074,"number":56,"title":"Go1.10","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":353,"closed_issues":598,"state":"open","created_at":"2017-04-21T19:22:29Z","updated_at":"2017-11-29T05:59:33Z","due_on":"2018-01-31T08:00:00Z","closed_at":null},"comments":4,"created_at":"2017-11-29T00:26:10Z","updated_at":"2017-11-29T06:02:37Z","closed_at":null,"author_association":"OWNER","body":"I'm trying to revive the NetBSD port.\r\n\r\nWe have passing NetBSD 8-BETA builders for amd64 now.\r\n\r\nThe NetBSD i386 kernel fails to get networking on GCE, but the 64-bit NetBSD kernel can run 32-bit binaries (like FreeBSD and unlike OpenBSD), and that's how we used to run the netbsd-386 builder, so I'm trying that again.\r\n\r\nBut 32-bit binaries fail to get the page size on a 64-bit kernel:\r\n\r\n```\r\nRunning /tmp/workdir/go/src/all.bash with args [\"/tmp/workdir/go/src/all.bash\"] and env [\"PWD=/\" \"HOME=/\" \"PATH=/usr/pkg/bin:/usr/pkg/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R7/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin\" \"_rc_original_stdout_fd=7\" \"GOROOT_BOOTSTRAP=/tmp/workdir/go1.4\" \"_rc_original_stderr_fd=8\" \"RC_PID=  10\" \"_rc_pid=2\" \"_rc_postprocessor_fd=9\" \"WORKDIR=/tmp/workdir\" \"GO_BUILDER_NAME=netbsd-386-8branch\" \"GOARCH=386\" \"GOHOSTARCH=386\"] in dir /tmp/workdir/go/src\r\nBuilding Go toolchain1 using /tmp/workdir/go1.4.\r\nBuilding Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.\r\nBuilding Go toolchain2 using go_bootstrap and Go toolchain1.\r\nfatal error: failed to get system page size\r\nruntime: panic before malloc heap initialized\r\n\r\nruntime stack:     \r\nruntime.throw(0x82bf412, 0x1e)\r\n        /tmp/workdir/go/src/runtime/panic.go:616 +0x65 fp=0xffffe718 sp=0xffffe70c pc=0x806e025\r\nruntime.mallocinit()        \r\n        /tmp/workdir/go/src/runtime/malloc.go:232 +0x3ba fp=0xffffe758 sp=0xffffe718 pc=0x8055c6a\r\nruntime.schedinit()         \r\n        /tmp/workdir/go/src/runtime/proc.go:485 +0x3c fp=0xffffe780 sp=0xffffe758 pc=0x807029c\r\nruntime.rt0_go(0xffffe814, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /tmp/workdir/go/src/runtime/asm_386.s:297 +0x224 fp=0xffffe784 sp=0xffffe780 pc=0x8091ef4\r\ngo tool dist: FAILED: /tmp/workdir/go/pkg/tool/netbsd_386/go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2\r\n```\r\n\r\nObviously not correct, but falling back to 4KB instead of returning 0 on sysctl failure seems to make it get further:\r\n\r\n```patch\r\nbradfitz@gdev:~/go/src$ git di\r\ndiff --git a/src/runtime/os_netbsd.go b/src/runtime/os_netbsd.go\r\nindex 39e91ee..a35bd1c 100644\r\n--- a/src/runtime/os_netbsd.go\r\n+++ b/src/runtime/os_netbsd.go\r\n@@ -106,6 +106,9 @@ func getPageSize() uintptr {\r\n        if ret >= 0 {\r\n                return uintptr(out)\r\n        }       \r\n+       if GOOS == \"netbsd\" {\r\n+               return 4 << 10  \r\n+       }               \r\n        return 0        \r\n }              \r\n\r\n```\r\n\r\nNow instead of crashing, `make.bash` seems to hang forever, consuming CPU forever in `/tmp/workdir/go/pkg/tool/netbsd_386/go_bootstrap install`.\r\n\r\nIdeas welcome.\r\n\r\n/cc @bsiegert @aclements @krytarowski @ianlancetaylor "},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/347761838","html_url":"https://github.com/golang/go/issues/22914#issuecomment-347761838","issue_url":"https://api.github.com/repos/golang/go/issues/22914","id":347761838,"user":{"login":"coypoop","id":14857674,"avatar_url":"https://avatars1.githubusercontent.com/u/14857674?v=4","gravatar_id":"","url":"https://api.github.com/users/coypoop","html_url":"https://github.com/coypoop","followers_url":"https://api.github.com/users/coypoop/followers","following_url":"https://api.github.com/users/coypoop/following{/other_user}","gists_url":"https://api.github.com/users/coypoop/gists{/gist_id}","starred_url":"https://api.github.com/users/coypoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coypoop/subscriptions","organizations_url":"https://api.github.com/users/coypoop/orgs","repos_url":"https://api.github.com/users/coypoop/repos","events_url":"https://api.github.com/users/coypoop/events{/privacy}","received_events_url":"https://api.github.com/users/coypoop/received_events","type":"User","site_admin":false},"created_at":"2017-11-29T06:02:37Z","updated_at":"2017-11-29T06:02:37Z","author_association":"NONE","body":"copying the freebsd/386 sysctl implementation as-is fixes this"}}
{"actor":{"display_login":"coypoop"}}