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
XmlReader.java gets stuck in infinite loop on nVidia Android hardware due to ART optimizations #3351
Comments
Sounds to me like an issue which should be reported to the Android team. |
I would agree, except for a couple of pieces of information:
That doesn't leave much option for having it fixed outside of libgdx. For my own needs, I'll likely be hacking a local version of XmlParser.java that works around the issue. |
Can you include a link to the nvidia (and android?) response? Afaik the XmlReader class is generated by Ragel, so it is probably not a good idea to modify that class directly. Otherwise, I guess a simple solution would be to use |
The response was in an email thread with their developer support team. The response was: "I did ask some of the SW people about that and they believe it's a valid optimization that ART is doing much like a C compiler would do in the same instance. They suggest you explicitly use the variables which it sounds like you are doing as the WAR." |
I don't agree that an optimization which clearly alters the functionality is valid (at least not if you cant disable it somehow). But I guess there isn't much we can do about that. Going to close this for above reasons. Please send a pull request when this is fixed in ragel. |
I very much agree that the optimization itself is incorrect. As much as anything, I wanted an issue listed here in case others run into it and go looking for solutions. My workaround ended up being replacing XmlParser.java with a locally-modified version, and inserting that into a local replacement for TmxMapLoader. |
The tight loops inside XmlReader.java end up being optimized by the ART on nVidia hardware - Shield TV and possibly others - such that changes to the loop variables are lost.
The problem occurs with the variables _upper and _lower in the while(true) loops at lines 130 and 152.
A workaround is to access those variables at the bottom of the loop in a debug log message between lines 141-142 and between 163-164.
The text was updated successfully, but these errors were encountered: