-
Notifications
You must be signed in to change notification settings - Fork 18k
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: fatal error: failed to get system page size / panic before malloc heap initialized #18041
Comments
/cc @aclements
It seems we need to have a fallback method (read /proc/self/auxv?)
to get the physical page size in runtime/os_linux.go?
|
Also, if this was not clear, the bug happens on android/arm arm64. Works fine on darwin/arm64. Haven't tested linux/arm64 too. Seems to be linked to https://go-review.googlesource.com/#/c/25022/. |
Right. darwin/arm64 always uses sysctl to query system page size,
only the linux port relies on AUXV. But for shared library and static
libraries, the AUXV might not be (directly) available.
|
Yes, we probably need something like that, but since this is GOOS=android, os_linux.go isn't involved right now. As far as I can tell, Android isn't even trying to set the physical page size. I'm not very familiar with the Android runtime init process, which is quite different from other OSes, so I'm trying to work out where to put this setup now. |
Okay, for example, I did not understand the GOOS=android apparently implies the linux build tag, so os_linux.go is involved. But I think rt0_android_*.go is synthesizing an empty auxv. |
CL https://golang.org/cl/33651 mentions this issue. |
CL https://golang.org/cl/33652 mentions this issue. |
This refactoring is in preparation for handling auxv differently in Android shared libraries. Updates #18041. Change-Id: If0458a309f9c804e7abd0a58b5a224d89f8da257 Reviewed-on: https://go-review.googlesource.com/33651 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
@crawshaw, perhaps it's time to bump NDK requirement
and just use bionic's getauxval?
|
I would advize against that since using Could falling back to auvx generation (like it used to) as a last resort be an option ? We ourselves release on 16+. |
Can we use `getauxval` on 21+ and the private `__libc_auxv` if available on
previous versions?
|
A crazy idea:
when all else fail, we try mmap a few times to
determine the system page size.
|
CL https://golang.org/cl/34610 mentions this issue. |
@steeve, could you please test CL 34610 and see if it works
in production build? (Update: the CL is submitted, so please
try the latest master branch instead.)
If you got "Recompile using GOARM=5." message, please
see if making "func checkgoarm" in runtime/os_linux_arm.go
simply return fixes the problem and allow the application to
run. Thanks.
I failed to find an Android device with such limiting SELinux
rules.
|
@minux sorry for the lag. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
Build a
gomobile
library for Android, link it, and try to launch the app and use the library.What did you expect to see?
The app launching.
What did you see instead?
The text was updated successfully, but these errors were encountered: