-
Notifications
You must be signed in to change notification settings - Fork 266
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
NDK 15 breaks mmap on Nexus 5 #449
Comments
are you building with _FILE_OFFSET_BITS=64 by any chance? |
@enh Yes |
yeah, that should be fixed by https://android-review.googlesource.com/429481/. in the meantime, not building with _FILE_OFFSET_BITS=64 is a workaround. |
Thanks. I'll just stick to NDK14b until the next NDK release. |
Just don't set |
Oh, actually:
Don't do that. NDK API level is the minimum version your app supports. That said, |
yeah, seems like we're still missing something here. is this literally the code? offset is 0?
i don't suppose you know how to run strace to see what's really going on? if not, do you have a small reproduceable test case? |
Actually, my gradle setup is:
and yes, that's literally the code. Haven't used strace yet. |
We had several bugs filed saying "if I set _FILE_OFFSET_BITS=64 when targeting an API < L, various functions are missing". Instead of saying "yes, they are", we quietly just modified the header files to expose the non-64-bit variants. This makes no sense. We can't just say "oh, yeah, we don't have a version of this function that agrees with your calling code about how large off_t is, but here's a version that doesn't: I'm sure it'll be fine". _FILE_OFFSET_BITS=64 on Android LP32 has always been a game of chance, but that game should be "are all the functions my code needs available at compile time?", not "will my code actually work at run time?". Bug: android/ndk#449 Bug: android/ndk#442 Bug: android/ndk#333 Bug: android/ndk#332 Bug: android/ndk#324 Test: builds Change-Id: Ib095251d3e21e77ed50cc3575388107fecec4ecd
For the NDK your target API is actually your In that case, you are hitting the case of the other bug. You'll need to make sure you're not passing |
Description
Using NDK 15.1.4119039 we are seeing a weird runtime failure in our app and tests on certain devices. We tracked it done to this source line:
On a Nexus 5 running Android 6.0.1, this will fail (MAP_FAILED returned) with errno == EINVAL. With earlier NDKs this was never a problem. Also, when running on a Nexus 5x, it is not a problem when building with NDK15.
Environment Details
The text was updated successfully, but these errors were encountered: