Skip to content
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

Upgrade to libgdx 1.11.0 and LWJGL 3.3.1 to fix Mac crash #730

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

mlaux
Copy link
Contributor

@mlaux mlaux commented Feb 9, 2023

This PR updates the project to libgdx 1.11.0 and LWJGL 3.3.1, fixing a crash on macOS 10.15 and above with certain combinations of JDK and JavaFX versions:

Process:               java [68856]
Path:                  /Library/Java/JavaVirtualMachines/jdk1.8.0_361.jdk/Contents/Home/bin/java
Identifier:            java
Version:               1.0 (1.8.0_361)
Code Type:             X86-64 (Native)
Parent Process:        idea [33033]
Responsible:           idea [33033]
User ID:               501

Date/Time:             2023-02-08 22:34:25.349 -0600
OS Version:            Mac OS X 10.15.7 (19H1615)
Report Version:        12
Anonymous UUID:        FDD76A0F-A9AC-47AD-2799-06700F5E0B24

Sleep/Wake UUID:       2454E68D-C922-4038-A1BF-9C1675CDB6BB

Time Awake Since Boot: 1800000 seconds
Time Since Wake:       2400 seconds

System Integrity Protection: enabled

Crashed Thread:        43  Java: LWJGL Application

Exception Type:        EXC_BAD_INSTRUCTION (SIGABRT)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
-[NSOpenGLContext setView:] must be called from the main thread.

Thread 43 Crashed:: Java: LWJGL Application
0   libsystem_kernel.dylib        	0x00007fff7142533a __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff714e5e60 pthread_kill + 430
2   libsystem_c.dylib             	0x00007fff713ac808 abort + 120
3   libjvm.dylib                  	0x000000011008fa24 os::abort(bool) + 22
4   libjvm.dylib                  	0x000000011019dd4b VMError::report_and_die() + 2245
5   libjvm.dylib                  	0x00000001100940bf JVM_handle_bsd_signal + 500
6   libjvm.dylib                  	0x0000000110091ca3 signalHandler(int, __siginfo*, void*) + 45
7   libsystem_platform.dylib      	0x00007fff714da5fd _sigtramp + 29
8   ???                           	0x0000000000000002 0 + 2
9   liblwjgl.dylib                	0x0000000136745c77 Java_org_lwjgl_opengl_MacOSXContextImplementation_setView + 183
10  ???                           	0x00000001118ad747 0 + 4589279047
11  ???                           	0x000000011189d33d 0 + 4589212477
12  ???                           	0x000000011189d382 0 + 4589212546
13  ???                           	0x000000011189d33d 0 + 4589212477
14  ???                           	0x000000011189d382 0 + 4589212546
15  ???                           	0x000000011189d33d 0 + 4589212477
16  ???                           	0x000000011189d33d 0 + 4589212477
17  ???                           	0x000000011189d33d 0 + 4589212477
18  ???                           	0x000000011189d33d 0 + 4589212477
19  ???                           	0x000000011189d33d 0 + 4589212477
20  ???                           	0x000000011189d33d 0 + 4589212477
21  ???                           	0x000000011189d33d 0 + 4589212477
22  ???                           	0x0000000111895827 0 + 4589180967
23  libjvm.dylib                  	0x000000010fed7fab JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1673
24  libjvm.dylib                  	0x000000010fed6e0e JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*) + 330
25  libjvm.dylib                  	0x000000010fed6fef JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*) + 87
26  libjvm.dylib                  	0x000000010ff44213 thread_entry(JavaThread*, Thread*) + 120
27  libjvm.dylib                  	0x00000001101625f0 JavaThread::thread_main_inner() + 130
28  libjvm.dylib                  	0x00000001101624af JavaThread::run() + 413
29  libjvm.dylib                  	0x000000011008f55b java_start(Thread*) + 250
30  libsystem_pthread.dylib       	0x00007fff714e6109 _pthread_start + 148
31  libsystem_pthread.dylib       	0x00007fff714e1b8b thread_start + 15

I've played a few songs and graphics, audio, and input all seem to be working correctly. Further testing would be appreciated!

@exch-bms2 exch-bms2 merged commit e38e223 into exch-bms2:master Mar 16, 2023
@staticssleever668
Copy link

@mlaux, hi, how do you compile beatoraja? This breaks the ant build script as dependency file paths haven't been updated there. Did you forget to stage build.xml by any chance?
Honestly though, I hate seeing this merged, as updating binary files bloats the repository size a lot. Although the fact the repo contained dependencies as binaries in the fist place is at fault. I think #714 is what should have been merged instead.

@wcko87
Copy link
Contributor

wcko87 commented Mar 17, 2023

I have the exact same thoughts as @staticssleever668
The compiled jar file is also at least twice as large if you updated the dependencies in the ant build script.

I don't know if it was a good idea to merge this

@mlaux
Copy link
Contributor Author

mlaux commented Mar 17, 2023

I totally agree that proper dependency management like #714 is what is actually needed for the future - my purpose in submitting this change was to give the maintainers a lower-touch option that fixes this particular crash, as well as give passersby that run into this issue a way to fix it for themselves, on their systems, while #714 is discussed and prepared to merge.

I definitely intended on making changes to this based on feedback before it was merged (if it was merged at all). I also could have been clearer in my original description. @exch-bms2 can you revert this?

Re: the ant issue, I compiled this by creating an IntelliJ project (and honestly didn’t see the build.xml). If we really want to keep this, I’ll make a separate change to fix ant.

@exch-bms2
Copy link
Owner

Reverted.
I just tested this PR (with modyfied build.xml), and trying to play, but controller doesn't work.
Please ensure that controller works on your environment.

@Getaji
Copy link
Contributor

Getaji commented Apr 6, 2023

The problem with the controller not being detected seems to be due to the fact that it is not registered in the mapping managed by the backend, SDL. The actual problem may be simpler or more complex, but in my environment I solved it by generating and registering mappings.

There are several ways to register mappings: you can use a mapping string generated by the SDL2 Gamepad Tool or Steam's Big Picture mapping function and append it to gamecontrollerdb.txt in the gdx-controllers-desktop.jar file or you can specify it in the environment variable SDL_GAMECONTROLLERCONFIG.

However, it would not be realistic for the developer to cover all the controllers that the user might connect, and it is not a good idea to make the user configure complicated settings. There may be some way to do this, as it was previously recognized without doing anything, but it may be unavoidable to maintain the use of the latest libGDX.

This is all I have been able to research. I hope this is helpful.

PS: The controllers I have tested to work are PHOENIXWAN 2018-2021 models (one generation old).

@hwsmm
Copy link

hwsmm commented Jul 29, 2023

This PR also fixes a problem where ; + Right Shift can't be pressed at the same time on Linux, I'd test and try fixing if I had a controller, but I don't have any sadly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants