Closed leecbaker closed 4 years ago
Thanks, I was just going to ask if you could put this on here. So, normally to build and test for mac I would sit on a friends macbook air in a cafe accros the street that also works from "home".. obviously that is not an option right now.
Carrying on from the comments on the install page, I understand you are using jdk 14. Please could you try 8. I believe these are the mac install instructions https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html
The crash is happening at the point it tries to open the java vm
That is somewhere after line 230 of https://github.com/mSparks43/XPlane-11-AutoATC-plugin/blob/master/src/jvm.cpp
does it print the AutoATC:Successfully loaded the jvm .so line in the xplane log.txt? If that still isnt fixing it, the next option given the circumstances is probably to build it yourself. This is pretty easy on mac since all the tools you need are easily available and the reason so many developers prefer it.
Help is here.
I see now these are two different reports on Mac 10.15.4 The above still applies
Yes, give me a day or so and I'll look into it. I do have easy access to mac, so it's easy for me to debug. I didn't realize this part of the plugin was open source, that makes it even easier.
-lee
OK here's what I have. I have compiled the plugin locally, and run with X-Plane. I'm still seeing a segfault, with a backtrace that isn't useful- looks like memory corruption.
I have no other plugins installed. Printed to the log:
AutoATC:Wav loaded.
AutoATC:Wav loaded.
AutoATC:Wav loaded.
AutoATC:Wav loaded.
AutoATC:Using OpenAL device.
plane thread began
a simple notepad in Resources/plugins/AutoATC
AutoATC:Successfully loaded the jvm .so
And stdout/stderr:
AutoATC:load sound 1AutoATC:load sound 2AutoATC:load sound 3AutoATC:load sound 4AutoATC:load sound 5AutoATC:load sound 6AutoATC:0x00000000: I found someone else's openAL context 0x00000019.
Process 43593 stopped
* thread #1, name = 'Main Thread', queue = 'com.apple.main-thread', stop reason = signal SIGSEGV
I'm going to dig in a bit more.
The crash is occurring here: https://github.com/mSparks43/XPlane-11-AutoATC-plugin/blob/27e9f5ebb6d0621a76fe2fb87d2f960db1c3da29/src/jvm.cpp#L293
I think the original bug might be caused by memory corruption, as the parameters to the function look OK to me.
I didn't realize this part of the plugin was open source, that makes it even easier. The C/C++ is LGPL, with other options available if people want it. It had been 20 years since I had done much C, so made it open to help with any porting issues and because the XP11 SDK is so powerful it needs to be used more. The jar isn't, but the JVM gives enough feedback on issues that it doesn't need to be (there is a skeleton available .java that covers the functions called)
To clarify, there are two known bugs crashing on the JVM, the title of this is "on shutdown" There is a known - now fixed bug that affects everyone occasionally on shutdown, that should have been resolved on Wednesday with the jar in https://forums.x-plane.org/applications/core/interface/file/attachment.php?id=490544 from my comment in https://forums.x-plane.org/index.php?/files/file/45663-main-installation-files-for-autoatc-for-xplane-11/&page=8&tab=comments
There is also a crash, on mac, at startup, posted by Samir Singh in the comment thread above that looked like it could be the original issue posted here.
I suspect given what you have reported above that it is related to the performance options being used
options[0].optionString = "-XX:+UseG1GC"; options[1].optionString = "-XX:MaxGCPauseMillis=2"; //options[2].optionString = "-XX:+UseStringCache"; options[2].optionString = "-XX:ParallelGCThreads=4"; options[3].optionString = "-XX:ConcGCThreads=4";
Which were added/changed during performance issue debugging (using the standard GC results in multiple "stop the world" collections which hit performance badly on some machines) and have only been tested on win/lin.
These are also likely Java 8 specific.
First I would try
JavaVMOption* options = new JavaVMOption[4]; options[0].optionString = "-XX:+UseG1GC"; options[1].optionString = "-XX:MaxGCPauseMillis=2"; options[2].optionString = "-XX:ParallelGCThreads=4"; options[3].optionString = "-XX:ConcGCThreads=4"; vm_args.nOptions = 4;
Array of length 4 instead of 5 on the first line
then
vm_args.nOptions = 0; // vm_args.options = options;
to try and start it with default options.
To clarify, there are two known bugs crashing on the JVM, the title of this is "on shutdown" You're totally right. I have experienced both. I started to debug one bug, and then the other occurred. Was too busy chasing a bug to realize I was confusing the two.
Unfortunately starting with default options didn't seem to solve the problem at all. Even with incorrect options, I would hope this would not clobber the stack like it is.
It's getting late here- I'll have to pick this up another day.
I started to debug one bug, and then the other occurred.
I renamed the title for this one. Shutdown is issue #17 and I just put 0.9.2 on the .org which should fix it.
Since startup is emergent on Catalina, I'd delete and try installing again, the .xpl has been tested on pre catalina mac, and JNI_CreateJavaVM is in /usr/local/jre/lib/server/libjvm.dylib from the JDK install
Not sure if this is the cause here, but it is a candidate. segfaults on Linux if Resources/plugins/java/AutoATCPlugin.jar doesn't exist.
So if Xplane cant read this file (or one of its dependants) due to some permissions issue this might cause it
As of 9.4.2, jvm is bundled, and options are configurable in the json file
Not much to say other than X-Plane crashes on shutdown. I can replicate this every time.
Steps to reproduce:
I'm using the latest X-Plane release (11.41r2) on macOS 10.15.4.
Here's the backtrace from the crash reporter:
And from the log file, here are the last few lines: