-
Notifications
You must be signed in to change notification settings - Fork 263
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
A weird, yet critical issue with x86 and OpenGL ES #54
Comments
I've also tried on x86 emulator. When using x86 Marshmallow image, I get a different crash (see below), and Intel 4.0.4 image is not recognised by virtual devices manager, even after installing according to instructions (probably another issue?). On x86 Marshmallow image I get this crash as soon as I attempt to compile GL shader:
However, I believe this crash is not related to this issue... |
I've just tried running problematic binary on Pegatron Hudl 2 and it works there. (this tablets runs Android 5.1) So it is possible that this issue is either related to ICS x86 image (I cannot test that because official Intel image is not recognized by recent virtual devices manager) or to Prestigio Multiphone duo. Any ideas what happened? |
OK, after some investigation I've discovered that error I am getting is due to This now indicates one of several possible things:
If 1. is true, then why our binaries compiled with r11 do not crash on other devices (SGS6, Nexus5X, Hudl 2, ...). Maybe it's specific to Android 4.0.4? EDIT: obviously it's not, as it works on HTC One V on Android 4.0.3 (ARMv7). It is also possible that device in question has some bug in their OpenGL ES driver, but why then our binary works when compiled with r10? I am totally confused... |
Uh, is that device actually running Lollipop? The target is a minimum target, and there are a lot of problems specifically with L and newer running on pre-L devices.
That seems pretty likely. According to gsmarena, that device shipped with 4.0, which was before we had any CTS tests to verify stack protector behavior. Where was The emulator crash in |
No, this device is running ICS. I am aware that NDK target is a minimum target and up until 16 months ago I used android-8 as a target, but with release of Lollipop and android-21 NDK target I wanted to take advantage of OpenGLES 3 on devices that support it. In order to do that, I needed appropriate OpenGL ES headers which are not available when targeting less than android-21. In order to ensure our binary works correctly, we rigorously tested it down to Android 2.3, implementing all the required workarounds to make our binary work across all Android versions our SDK supports (API level 10 and higher)
Then why does binary work when compiled with NDK r10? We use
It comes from our
I'll open another issue for that later. My guess is that it might be related to rare crash we have at some very specific devices when initialising OpenGL ES with pbuffer for offscreen-only rendering. |
If your testing is solid then you're probably fine. Just know that it is an untested and unsupported configuration that is known broken in many cases.
That's a good question. GCC was updated (still 4.9 but it's a newer 4.9). Maybe thanks to some new optimization you're hitting a bad case now? Possibly something that was being inlined before isn't now and that's affected stack guard generation?
|
Since this appears to be device specific issue - other Intel-based devices work fine - I've contacted our Intel contact to check if they know more about possible GPU driver bugs in this device. They responded that they have deprecated platform this device uses (Medfield platform) years ago and they recommended dropping support for this device from our SDK. I've also contacted our client which required us to support this device to check if it's OK to drop support for it. Anywhere, even if they still require us to support it, I will make sure our x86 binary will be built with So, I think we can close this issue because there is obviously nothing to do here. To conclude:
|
FYI anything built with clang will use |
It looks like bionic added the stack protector TLS slot in this commit which first appeared in a release branch with jb-mr2-release or 4.3. As far as I can tell, Clang, LLVM, and the NDK makefiles contain no logic to gate the use of the TLS cookies to >= 4.3 platforms. I haven't looked at GCC. My company must support down to 4.1 so we patched LLVM to unconditionally use the global cookie instead of the TLS cookie. |
In our project we use OpenGL ES initialized with pbuffer surface to perform some offscreen rendering (OpenGLES shaders are used to accelerate some image processing).
With NDK r10e everything works OK, however, when same source code is built with NDK r11b, app crashes when OpenGL is initalised.
The device in question is Prestigio Multiphone (device model: PAP5430), target is set to
android-21
, GNU STL static is used and GCC 4.9 for building (both in NDR r10e and NDK r11b).When built with NDK r10, app works correctly, when built with NDK r11 we get following crash:
This is how to reproduce it:
eglGetDisplay(EGL_DEFAULT_DISPLAY)
eglInitialize(display, &versionMajor, &versionMinor)
eglCreatePbufferSurface
eglMakeCurrent
The GPU on device is PowerVR SGX 540.
I believe this is a NDK issue, not a device issue.
The text was updated successfully, but these errors were encountered: