-
Notifications
You must be signed in to change notification settings - Fork 173
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
Sporadic crash on iOS (baseSize() in machine.h) #448
Comments
I tried to isolate the problem. Seems it doesn't crash if I add additional checks. Unfortunately printf() also crashes here, so can't tell which condition is met.
Of course it's only a workaround, but I don't know where the wrong values come from. |
My first suggestion would be to try building in It'd also be interesting to see if this is reproducible somewhere besides iOS. Is it possible to compile your project for OS X? Barring that, it could be interesting to try running it on the simulator (to eliminate any architecture-dependence). |
Bad news: The problem still occurs, my workaround doesn't help. (I hate occasionally crashes... and I tested it for so long and it didn't crash...) Thanks for your hints, I will try them. If you have any ideas how I could catch the exception (and return 0 or whatever), please let me know. Compiling the project for OS X is not possible. At least not for me. It wasn't designed for that. And I couldn't reproduce it in the simulator up to now. Bad conditions. |
On Jul 18, 2015 4:36 AM, "revvv" notifications@github.com wrote:
Does that mean the crash only happens with armv6 builds, not armv7 or arm64
|
I use either "armv7" or "armv7 arm64" as VALID ARCHITECTURES. The crash happens with both settings on my 64 bit iPad Air. I never used "armv6". AFAIK jMonkeyEngine doesn't support that. UPDATE: Now I understand why you asked. Updated first posting. |
I could not compile Avian with debug mode. (Don't know how to modify the jMonkeyEngine build.xml.) I was really surprised that BytesPerWord can have different values, even 0! |
Given the fragility of the problem, debug mode may not have helped anyway.
The only thing I can think of is trying to set the VM_STRESS or VM_STRESS_MAJOR flags in an effort to make it more reproducible. If you can't modify the external build system, it's not hard to add those flags directly to the avian makefile. E.g.:
You might also try directly modifying the makefile similarly to preserve debug info (using If you can figure out how to reproduce it reliably, the next step would probably be to start simplifying the test case. Try commenting out large portions of code (both your own and in JME), and see if you can still get the problem to happen. |
This certainly seems to be a heap corruption issue, which can either be due to a bug in the VM or some JNI code (e.g. incorrect use of GetPrimitiveArrayCritical such as https://groups.google.com/d/msg/avian/Ibd2p44_kOA/UgFLgq-ibMQJ ). These are hard to debug because the crash generally occurs well after the corruption happens. As Josh noted, the VM_STRESS and VM_STRESS_MAJOR macros can help close the gap between fault and crash, but they're only practical once you've narrowed the test case down a bit and made it more reliably reproduceable. My advice is to scrutinize any JNI code in your app or libraries that might be hit prior to the crash and make sure it's playing by the rules. If all that looks good, do what you can to simplify the test case like Josh suggested. The narrower it is, the more tools we can throw at it. |
@joshuawarner32 With your hints I could build with debug and stress options. With "debug" the problem doesn't occur. With "stress" it crashes immediately on armv7/arm64 and in the simulator, but at a different location. (Same result with our minimalistic default project.) @dicej Indeed the project uses JNI and jogl. Thanks for all your help. Closed. IMHO not an Avian bug. |
I get a sporadic exception on my iPad Air. It doesn't play a role if it's armv7 or arm64 binary. Both crash.
I'm using the jMonkeyEngine 3.0 with a private Avian build from today's master (openjdk-1.7.0-u40-unofficial-macosx-x86_64-image).
I got the problem already with an Avian master from 2015-06-01. Any help is appreciated.
The stacktrace is from arm64:
The text was updated successfully, but these errors were encountered: