Skip to content

Failed to allocate a guard page #32082

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

Closed
joerg-krause opened this issue Mar 6, 2016 · 6 comments
Closed

Failed to allocate a guard page #32082

joerg-krause opened this issue Mar 6, 2016 · 6 comments

Comments

@joerg-krause
Copy link
Contributor

I am cross-compiling a cargo build hello for an unsupported ARMv5 target with a musl toolchain. I am using the instructions from rust-cross-libs to successfully build the rustlibs and hello.

I added an debug output to https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/thread.rs#L224 to get the page size used by Rust: psize: 9459

However, using a C test file with long sz = sysconf(_SC_PAGESIZE); prints a page size of 4096, which I assume is correct.

I know ARMv5 and arm---musl are not officially supported, but maybe can give me a hint why os::page_size() returns a wrong and obviously page size.

@alexcrichton
Copy link
Member

Was the standard library recompiled for armv5 as well? Right now I don't think we ship any armv5 standard libraries, nor do we have an armv5 target in the compiler.

Maybe the libc definition of _SC_PAGESIZE was wrong as well? Maybe the ABI is wrong? I guess it could be a number of factors.

@joerg-krause
Copy link
Contributor Author

Yes, the standard library was recompiled for ARMv5. Cross-compiling hello for the ARMv5 target works fine with the glIbc, but somehow fails with musl.

I've seen that _SC_PAGESIZE is defined as an integer value of 30 both in musl and stdlibc. I'll check, if it is really 30 for my build.

@joerg-krause
Copy link
Contributor Author

Ok, I need some work to do. _SC_PAGESIZE is wrong and I've to fix my custom JSON file to build the standard library correctly for musl and ARMv5.

@joerg-krause
Copy link
Contributor Author

I fixed my custom JSON target file for armv5te-unkwown-linux-musl.

Now, I can cross-compile cargos hello for my custom target armv5te-unkwown-linux-musl successfully.

@alexcrichton
Copy link
Member

Aha, I'm glad it worked out! Should we leave this open? Does a patch need to make its way upstream?

@joerg-krause
Copy link
Contributor Author

I'll close this. I proposed a PR to libc rust-lang/libc#214 to link with the shared library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants