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

Apple Silicon Mac GLFW error on startup #7558

Closed
panther03 opened this issue Dec 20, 2020 · 31 comments
Closed

Apple Silicon Mac GLFW error on startup #7558

panther03 opened this issue Dec 20, 2020 · 31 comments
Labels
1.15 1.16 Blocked Upstream This request's solution is awaiting a change on a project we depend on. Bug This request reports or fixes a new or existing bug. Confirmed This request has been verified to be factually correct by at least one member of the team. Not Us The issue can't be fixed by us/isn't caused by us. Vanilla Bug This request fixes or reports a bug that exists in the base Minecraft game. Wont Fix/Works As Intended This request reports something that would break expectations in order to fix.

Comments

@panther03
Copy link

panther03 commented Dec 20, 2020

Minecraft Version: 1.16.4

Forge Version: all versions from 35.1.4 to 35.1.13, as well as 35.0.0

Logs: https://paste.ee/p/lIYZ6

Steps to Reproduce:

  1. Simply install Forge with the vanilla minecraft launcher through Rosetta, or create a new blank forge instance in MultiMC, running either natively (with this guide) or also through Rosetta.
  2. Launch the game.

Description of issue:

Upon launch of any 1.16.4 version with Forge installed, using native or Intel LWJGL, a GLFW error causes the game to crash:

java.lang.IllegalStateException: GLFW error before init:
[0x10008]Cocoa: Failed to find service port for display

Some say they have fixed this error using the argument -Dfml.earlyprogresswindow=false, but for me and several others, adding the argument just causes the GLFW error to display in a popup window, and the error in the log is mostly the same:
image

[17:14:59] [Render thread/ERROR] [mojang/GLX]: GLFW error collected during initialization: GLFW error during init: [0x10008]6123248856
[17:15:29] [Render thread/WARN] [minecraft/Main]: Failed to create window: 
net.minecraft.client.MainWindow$GlException: GLFW error 65544: Cocoa: Failed to find service port for display

This does not happen in Vanilla, and I have also observed it in many forge 1.15.2 versions. I have also observed that the instance will very rarely launch successfully. I have no good explanation for this, and it's extremely inconsistent, but for some reason, sometimes it just decides it will launch fine, and in these cases the game will be perfectly playable.

In the instances I have been able to launch it, it has generally been on a new launch of MultiMC, which makes me wonder if this has something to do with GLFW initializing before forge; if it runs as a separate background process, it becomes a race to see which one inits first, and if you keep trying to launch the same instance, the code for GLFW is cached or something. Just a complete guess, I don't know how Forge uses GLFW internally.

@panther03 panther03 added the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label Dec 20, 2020
@TheCurle
Copy link
Contributor

This is an issue with GLFW and Apple Silicon's Rosetta technology.
We cannot fix this.
Mojang cannot fix this.
Nobody but Apple can fix this.
This is a problem with Apple.
Apple must fix this.
We cannot fix this.

I've said it, but it's not going through.
WE CANNOT FIX THIS.

@TheCurle TheCurle added 1.15 1.16 Blocked Upstream This request's solution is awaiting a change on a project we depend on. Bug This request reports or fixes a new or existing bug. Confirmed This request has been verified to be factually correct by at least one member of the team. Not Us The issue can't be fixed by us/isn't caused by us. Vanilla Bug This request fixes or reports a bug that exists in the base Minecraft game. Wont Fix/Works As Intended This request reports something that would break expectations in order to fix. and removed Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. labels Dec 20, 2020
@LexManos
Copy link
Member

LexManos commented Dec 20, 2020

To clarify, this is indeed something that appears to be a issue on Apple's end.
First few google results say it has to do with some of the dual monitor systems. So if you have a second monitor, or a second monitor port even if unused, you could try disabling that.
If you used -Dfml.earlyprogresswindow=false then all of our graphics related changes to startup will be turned off. So if you still get it it's not us.

It may appear to be Forge's issue because we do more work before loading Minecraft, thus causing it to delay touching the GL context. Which could mean that whatever background task you were talking about is more likely to complete first and trigger the issue. But that doesn't mean it's caused by Forge.

However, IF you can find someone who can reproduce {Because all our mac users/devs can't} then we could try to remediate it on our end. But Macs are notorious for doing graphics wrong, and not many people in the community have them. So developing for them is damn near impossible.

@cpw
Copy link
Contributor

cpw commented Dec 21, 2020

I will just add speculation here that it could be an incompatibility with new mac silicon and LWJGL as well.. based on this: LWJGL/lwjgl3#601 there doesn't even seem to be native ARM64 libs for M1 yet, so this is probably an X86 emulation thing that's going wrong...

@panther03
Copy link
Author

Thanks for the response guys. I should probably clarify a couple things:

This is an issue with GLFW and Apple Silicon's Rosetta technology.

there doesn't even seem to be native ARM64 libs for M1 yet, so this is probably an X86 emulation thing that's going wrong...

This is not true. This is completely independent of Rosetta; as I wrote in my original post, it is possible to compile/obtain all dependencies for Minecraft to run natively on M1 (even MultiMC.) You can see in the logs that this is the case, since I'm using an aarch64 JVM and the JNI requires a consistent architecture for native libraries. Note however that the issue still occurs on Rosetta, which is why I'm writing this as a generic "apple silicon" issue (it does not occur on x86_64 macs running the same big sur).

That being said, it is true that LWJGL themselves do not yet ship native libraries, and that they are probably not tested nearly as thoroughly due to a lack of CI and other testing facilities. So maybe that's what it is.

However, IF you can find someone who can reproduce {Because all our mac users/devs can't} then we could try to remediate it on our end. But Macs are notorious for doing graphics wrong, and not many people in the community have them. So developing for them is damn near impossible.

Fair enough. It should be easy to re-create on any M1 system though, as far as I know.

@r58Playz
Copy link

r58Playz commented Dec 24, 2020

Reproduced:
I am using x86_64 MultiMC though.

MultiMC version: 0.6.12-develop-1429


Minecraft folder is:
/Applications/MultiMC.app/Contents/MacOS/instances/1.16.4-Optifine/.minecraft


Java path is:
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/bin/java


Checking Java version...
Java is version 1.8.0_275, using 32-bit architecture, from Azul Systems, Inc..


Your Java architecture is not matching your system architecture. You might want to install a 64bit Java version.


Main Class:
  io.github.zekerzhayard.forgewrapper.installer.Main

Native path:
  /Applications/MultiMC.app/Contents/MacOS/instances/1.16.4-Optifine/natives

Traits:
traits XR:Initial
traits FirstThreadOnMacOS

Libraries:
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-jemalloc/3.2.2/lwjgl-jemalloc-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-openal/3.2.2/lwjgl-openal-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-stb/3.2.2/lwjgl-stb-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-tinyfd/3.2.2/lwjgl-tinyfd-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/patchy/1.1/patchy-1.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/oshi-project/oshi-core/1.1/oshi-core-1.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/java/dev/jna/jna/4.4.0/jna-4.4.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/java/dev/jna/platform/3.4.0/platform-3.4.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/ibm/icu/icu4j/66.1/icu4j-66.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/javabridge/1.0.22/javabridge-1.0.22.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/io/netty/netty-all/4.1.25.Final/netty-all-4.1.25.Final.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/google/guava/guava/21.0/guava-21.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/commons-io/commons-io/2.5/commons-io-2.5.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/brigadier/1.0.17/brigadier-1.0.17.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/datafixerupper/4.0.26/datafixerupper-4.0.26.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/authlib/2.1.28/authlib-2.1.28.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/it/unimi/dsi/fastutil/8.2.1/fastutil-8.2.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/logging/log4j/log4j-core/2.11.2/log4j-core-2.11.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/text2speech/1.11.3/text2speech-1.11.3.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/io/github/zekerzhayard/ForgeWrapper/1.4.2/ForgeWrapper-1.4.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecraftforge/forge/1.16.4-35.1.4/forge-1.16.4-35.1.4-launcher.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/ow2/asm/asm/7.2/asm-7.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/ow2/asm/asm-commons/7.2/asm-commons-7.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/ow2/asm/asm-tree/7.2/asm-tree-7.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/ow2/asm/asm-util/7.2/asm-util-7.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/ow2/asm/asm-analysis/7.2/asm-analysis-7.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/cpw/mods/modlauncher/8.0.6/modlauncher-8.0.6.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/cpw/mods/grossjava9hacks/1.3.0/grossjava9hacks-1.3.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecraftforge/accesstransformers/2.2.0-shadowed/accesstransformers-2.2.0-shadowed.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecraftforge/eventbus/3.0.5-service/eventbus-3.0.5-service.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecraftforge/forgespi/3.2.0/forgespi-3.2.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecraftforge/coremods/3.0.0/coremods-3.0.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecraftforge/unsafe/0.2.0/unsafe-0.2.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/electronwill/night-config/core/3.6.2/core-3.6.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/electronwill/night-config/toml/3.6.2/toml-3.6.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/jline/jline/3.12.1/jline-3.12.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/apache/maven/maven-artifact/3.6.0/maven-artifact-3.6.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/jodah/typetools/0.8.1/typetools-0.8.1.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/net/minecrell/terminalconsoleappender/1.2.0/terminalconsoleappender-1.2.0.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/spongepowered/mixin/0.8.2/mixin-0.8.2.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/com/mojang/minecraft/1.16.4/minecraft-1.16.4-client.jar

Native libraries:
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-jemalloc/3.2.2/lwjgl-jemalloc-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-openal/3.2.2/lwjgl-openal-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-stb/3.2.2/lwjgl-stb-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl-tinyfd/3.2.2/lwjgl-tinyfd-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2-natives-macos.jar
  /Applications/MultiMC.app/Contents/MacOS/libraries/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-natives-osx.jar

Mods:
  [❌] OptiFine_1.16.4_HD_U_G5.jar (disabled)

Params:
  --username  --version MultiMC5 --gameDir /Applications/MultiMC.app/Contents/MacOS/instances/1.16.4-Optifine/.minecraft --assetsDir /Applications/MultiMC.app/Contents/MacOS/assets --assetIndex 1.16 --uuid  --accessToken  --userType  --versionType release --launchTarget fmlclient --fml.forgeVersion 35.1.4 --fml.mcVersion 1.16.4 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20201102.104115

Window size: 854 x 480

Java Arguments:
[-Xdock:icon=icon.png, -Xdock:name="MultiMC: 1.16.4-Optifine", -XstartOnFirstThread, -Xms204m, -Xmx2048m, -Duser.language=en]


Wrapper command is:
/Users/************/MCAppleSilicon/m1-multimc-hack/mcwrap.py


Minecraft process ID: 3863


Using onesix launcher.

2020-12-24 09:56:12,442 main WARN Advanced terminal features are not available in this environment
[09:56:12] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, r58Playz, --version, MultiMC5, --gameDir, /Applications/MultiMC.app/Contents/MacOS/instances/1.16.4-Optifine/.minecraft, --assetsDir, /Applications/MultiMC.app/Contents/MacOS/assets, --assetIndex, 1.16, --uuid, <PROFILE ID>, --accessToken, ❄❄❄❄❄❄❄❄, --userType, mojang, --versionType, release, --launchTarget, fmlclient, --fml.forgeVersion, 35.1.4, --fml.mcVersion, 1.16.4, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20201102.104115, --width, 854, --height, 480]
[09:56:12] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.0.6+85+master.325de55 starting: java version 1.8.0_275 by Azul Systems, Inc.
[09:56:12] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[09:56:12] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.2 Source=file:/Applications/MultiMC.app/Contents/MacOS/libraries/org/spongepowered/mixin/0.8.2/mixin-0.8.2.jar Service=ModLauncher Env=CLIENT
[LWJGL] GLFW_PLATFORM_ERROR error
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:105]: 	Description : Cocoa: Failed to find service port for display
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:106]: 	Stacktrace  :
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:830)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: net.minecraftforge.fml.loading.progress.ClientVisualization.initWindow(ClientVisualization.java:67)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: net.minecraftforge.fml.loading.progress.ClientVisualization.start(ClientVisualization.java:305)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.accept(EarlyProgressVisualization.java:37)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: net.minecraftforge.fml.loading.FMLLoader.setupLaunchHandler(FMLLoader.java:188)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: net.minecraftforge.fml.loading.FMLServiceProvider.initialize(FMLServiceProvider.java:94)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: cpw.mods.modlauncher.TransformationServiceDecorator.onInitialize(TransformationServiceDecorator.java:68)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseTransformationServices$7(TransformationServicesHandler.java:107)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: java.util.HashMap$Values.forEach(HashMap.java:981)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: cpw.mods.modlauncher.TransformationServicesHandler.initialiseTransformationServices(TransformationServicesHandler.java:107)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:59)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: cpw.mods.modlauncher.Launcher.run(Launcher.java:76)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:50)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: java.lang.reflect.Method.invoke(Method.java:498)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: org.multimc.EntryPoint.listen(EntryPoint.java:143)
[09:56:12] [main/INFO] [STDERR/]: [org.lwjgl.glfw.GLFWErrorCallback$1:invoke:110]: org.multimc.EntryPoint.main(EntryPoint.java:34)
[09:56:13] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmlclient' with arguments [--version, MultiMC5, --gameDir, /Applications/MultiMC.app/Contents/MacOS/instances/1.16.4-Optifine/.minecraft, --assetsDir, /Applications/MultiMC.app/Contents/MacOS/assets, --uuid, <PROFILE ID>, --username, r58Playz, --assetIndex, 1.16, --accessToken, ❄❄❄❄❄❄❄❄, --userType, mojang, --versionType, release, --width, 854, --height, 480]
[09:56:16] [Render thread/INFO] [mojang/YggdrasilAuthenticationService]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[09:56:16] [Render thread/INFO] [minecraft/Minecraft]: Setting user: r58Playz
[09:56:16] [Render thread/INFO] [minecraft/Minecraft]: Backend library: LWJGL version 3.2.3 SNAPSHOT
[09:56:16] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:func_179870_a:123]: ---- Minecraft Crash Report ----
// My bad.

Time: 12/24/20 9:56 AM
Description: Initializing game

java.lang.IllegalStateException: GLFW error before init: [0x10008]Cocoa: Failed to find service port for display
	at com.mojang.blaze3d.platform.GLX.func_229879_lam_(SourceFile:64) ~[?:?] {re:classloading}
	at net.minecraft.client.MainWindow.func_211162_a(MainWindow.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at com.mojang.blaze3d.platform.GLX._initGlfw(SourceFile:63) ~[?:?] {re:classloading}
	at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(SourceFile:1060) ~[?:?] {re:classloading}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:416) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:149) ~[minecraft-1.16.4-client.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] {}
	at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.4-35.1.4-launcher.jar:35.1] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.6.jar:?] {}
	at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:50) [ForgeWrapper-1.4.2.jar:?] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] {}
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?] {}
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?] {}
	at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?] {}
	at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at com.mojang.blaze3d.platform.GLX.func_229879_lam_(SourceFile:64) ~[?:?] {re:classloading}
	at net.minecraft.client.MainWindow.func_211162_a(MainWindow.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at com.mojang.blaze3d.platform.GLX._initGlfw(SourceFile:63) ~[?:?] {re:classloading}
	at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(SourceFile:1060) ~[?:?] {re:classloading}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:416) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
-- Initialization --
Details:
Stacktrace:
	at net.minecraft.client.main.Main.main(Main.java:149) ~[minecraft-1.16.4-client.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] {}
	at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.4-35.1.4-launcher.jar:35.1] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.6.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.6.jar:?] {}
	at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:50) [ForgeWrapper-1.4.2.jar:?] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] {}
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?] {}
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?] {}
	at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?] {}
	at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?] {}


-- System Details --
Details:
	Minecraft Version: 1.16.4
	Minecraft Version ID: 1.16.4
	Operating System: Mac OS X (aarch64) version 11.1
	Java Version: 1.8.0_275, Azul Systems, Inc.
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Azul Systems, Inc.
	Memory: 639593560 bytes (609 MB) / 962592768 bytes (918 MB) up to 1908932608 bytes (1820 MB)
	CPUs: 8
	JVM Flags: 2 total; -Xms204m -Xmx2048m
	Launched Version: MultiMC5
	Backend library: LWJGL version 3.2.3 SNAPSHOT
	Backend API: NO CONTEXT
	GL Caps: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'forge'
	Type: Client (map_client.txt)
	CPU: <unknown>
[09:56:16] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:func_179870_a:123]: #@!@# Game crashed! Crash report saved to: #@!@# /Applications/MultiMC.app/Contents/MacOS/instances/1.16.4-Optifine/.minecraft/crash-reports/crash-2020-12-24_09.56.16-client.txt
																																												
Process exited with code 0.
Clipboard copy at: 24 Dec 2020 09:56:20 -0800

@TheCurle
Copy link
Contributor

Yes, there are no M1 LWJGL natives, so Rosetta is interpreting them for x86_64 regardless of how you start the game.
As demonstrated above, it's an Apple API issue.

Still not something we, or anyone but Apple, can fix.

@panther03
Copy link
Author

Yes, there are no M1 LWJGL natives, so Rosetta is interpreting them for x86_64 regardless of how you start the game.
As demonstrated above, it's an Apple API issue.

Still not something we, or anyone but Apple, can fix.

That's simply not true. Have you not read my post? Do you need me to provide the libraries themselves so you can run file on them? They are arm64 natives, compiled from scratch. This is not a Rosetta issue.

@TheCurle
Copy link
Contributor

Great. It's compiled. they've supported arm for a while. But it's not compatible, and i don't see any fixes in their repository to work around the missing APIs on the newer Mac system.
This is an APPLE thing.

@sdirkwinkel
Copy link

It seems to be a bug in upstream macOS. I've removed the failing call in glfw and forge works fine.

I've built a version of glfw with the failing function just returning null (sdirkwinkel/glfw@310d5c3)

you cat get the lib here:
https://github.com/0xQSL/m1-multimc-hack/blob/fix-forge/lwjglnatives/libglfw.dylib

I'm able to run forge modpacks with this. FPS are quite good.

@TheCurle
Copy link
Contributor

Yes, they deprecated the APIs that GLFW/LWJGL use. Hence my insistence from the start that this is an Apple thing.
Rosetta, when interpreting the standard x86_64 libraries, makes a call to an API that Apple removed, hence your thing working when that API is no longer called.

We can only wait until a fix is issued upstream.

@sdirkwinkel
Copy link

This is not about rosetta. I'm using native java/glfw on aarch64. It seems to be just a change to display handling code. The same issue appears with airplay displays.

I do agree that forge can't fix this. It should be fixed in glfw/macOS

@jnsmalm
Copy link

jnsmalm commented Jan 1, 2021

It seems to be a bug in upstream macOS. I've removed the failing call in glfw and forge works fine.

I've built a version of glfw with the failing function just returning null (0xQSL/glfw@310d5c3)

you cat get the lib here:
https://github.com/0xQSL/m1-multimc-hack/blob/fix-forge/lwjglnatives/libglfw.dylib

I'm able to run forge modpacks with this. FPS are quite good.

I tried your libglfw.dylib file, could not get it to work (get the same error as described above). I just tried replacing the old file with yours, anything else I must do?

Do I need to replace all files in lwjglnatives folder or only the libglfw.dylib one?

@sdirkwinkel
Copy link

You should just need the libglfw.dylib. How are you running Minecraft? Can you provide a log?

The fix seems to work for at leas some people: yusefnapora/m1-multimc-hack#1

@kawanet
Copy link

kawanet commented Jan 15, 2021

@0xQSL Thank you for your great patch! It works in 60fps+ on my M1 Macbook.

How to guide in Japanese: https://qiita.com/kawanet/items/57a35446b7daa903dfe9

@Lodran
Copy link

Lodran commented Jan 20, 2021

Looking at the patch that 0xQSL linked, it appears that the only significant difference in behavior between Apple's glfw library and the hacked one is that Apple's calls _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find service port for display"); before returning a null pointer, while the hacked version simply returns the null pointer.
So, my question is: is there code in Forge that makes it sensitive to calls to _glfwInputError, for example by displaying the error and then terminating the application?

@MinecraftForge MinecraftForge deleted a comment from bluemonkey96 Jan 22, 2021
@LexManos
Copy link
Member

This is not going to become a place to hack around in your natives.
This is still to the point of people trying to actually see if it's a Forge issue. IF it is feel free to provide a PR that doesn't break everyone elses things.
And no AFAIK we dont 'display the error and terminate the application' We don't really care about the GL errors any more then vanilla does.

@Barteks2x
Copy link
Contributor

Minecraft itself checks for glfw errors when it initializes the main window, and crashes if it detects an error. If just ignoring the error and continuing makes it work, it should be possible to detect this particular error and not throw an exception (in GLX._initGlfw)

@Lodran
Copy link

Lodran commented Jan 26, 2021

@LexManos: in ClientVisualization.java -

    if (!glfwInit()) {
        throw new IllegalStateException("Unable to initialize GLFW");
    }

I don't know that this is the issue, because I'm only poking around in Forge's source code, but it's a possibility.

@nevyn
Copy link

nevyn commented Feb 1, 2021

fyi, this is not a bug in macOS, but rather a deprecation of an entire API layer that no longer works on Apple Silicon. A correct patch has been merged to glfw master.

The patch supplied above (early null return) shouldn't have any bad side effects though, and is fine as a stop gap imho.

@saintentropy
Copy link

@nevyn Do you know when the 3.3.3 release is scheduled for glfw?

@nevyn
Copy link

nevyn commented Feb 8, 2021

@nevyn Do you know when the 3.3.3 release is scheduled for glfw?

@saintentropy Sorry, I don't. I'm not a maintainer on that project, I just wrote the above linked patch and wanted to correct some misinformation. Feels like an important fix to ship though, since it breaks glfw on all new macs.

@elmindreda
Copy link

A fix for the Failed to find service port for display error has been merged to the 3.3-stable branch of GLFW and I'm hoping to have 3.3.3 out next week.

@10595870
Copy link

This has been such a helpful thread, thank you so much!
When 3.3.3 is released, what do I need to do? Just update Forge when they add it? I’m currently learning about development so I apologise for a silly question. (although I admit this is just because I want to update my Forge server)

@TheCurle
Copy link
Contributor

Once LWJGL is updated, we need to wait for Mojang to take it up and update the game to work with it.

Updating the game ourselves can possibly be a monumental task, and would probably introduce a lot of unintentional bugs.

Yet again, this is totally beyond our control.

@Klowes
Copy link

Klowes commented Feb 15, 2021

If you use MultiMC you can set the client to use the upcoming version of LWJGL, which from what I understand should fix the issue without Forge or Mojang having to ship. Kind of annoying having to tweak the instance so much but it'll work for the time being

@FarmerJax
Copy link

It seems to be a bug in upstream macOS. I've removed the failing call in glfw and forge works fine.

I've built a version of glfw with the failing function just returning null (0xQSL/glfw@310d5c3)

you cat get the lib here:
https://github.com/0xQSL/m1-multimc-hack/blob/fix-forge/lwjglnatives/libglfw.dylib

I'm able to run forge modpacks with this. FPS are quite good.

Can someone explain to me how to install this fix?

@DaemonUmbra
Copy link
Member

We're not going to endorse installing binaries built by random people on the internet.

@10595870
Copy link

10595870 commented Mar 1, 2021

Someone on Reddit had success using crossover. I’ll post the steps below

“1. ⁠Install crossover
2. ⁠go to minecraft.net and download the launcher for windows
3. ⁠Install the minecraft launcher in to a crossover bottle.
4. ⁠now there’s two options. Go to the launcher and change the profile folder to somewhere like documents or find the bottles folder on your Mac. (I’d have to look at my Mac again to get more information)
5. ⁠then what I did was installed Java 8 to the bottle using the downloaded .exe from oracle
6. ⁠then download minecraft forge and try to install it in the bottle(again not sure if it’s needed to install to bottle. It just needs to find the .minecraft folder for the bottles minecraft launcher.
7. ⁠then launch the crossover minecraft launcher and PROFIT :P

This is my first MacBook/Mac in general so I’m still learning how the OS works.

If you’d like a more confirmed way of doing it I’ll have to try and install it again to another bottle“

@pjfranke
Copy link

LWJGL has been updated to 3.3.0 snapshot 7 per LWJGL/lwjgl3#601 (comment), and the issue closed. Is that change sufficient to resolve the issues identified here? As I understand from above, this new library would need to be included by Mojang, not simply Forge.

@Klowes
Copy link

Klowes commented Mar 10, 2021

Can confirm this works without Crossover.
I set my gf up with mods running native.

I know this isn't relevant to Forge's issue, but I'm sure many others will arrive here like myself looking for a fix they can implement today

  1. Download Zulu Java 11 JDK for macOS ARM64
  2. Download MultiMC Development Version
  3. [Download LWJGL Natives] (Link to random unknown binary files removed)
  4. Set Java Path in MultiMC as .<...>/zulu-11.jdk/Contents/Home/bin/java in settings/java
  5. Set Java arguments -Dorg.lwjgl.librarypath=<...>/MCSiliconLWJGL/lwjglnatives in settings/java
  6. Create an MC instance and add your modpack via one of the launcher integrations (Only Available in the Development version)
  7. Edit that instance
  8. Right Click LWJGL 3 in GUI, click customize
  9. Right Click LWJGL 3 in GUI, click edit
  10. Replace contents of file with JSON below and save
    { "formatVersion": 1, "libraries": [ { "name": "lwjgl:lwjglfat:1", "MMC-hint": "local", "MMC-filename": "lwjglfat.jar" } ], "name": "LWJGL 3", "releaseTime": "2019-06-24T12:52:52+00:00", "type": "release", "uid": "org.lwjgl3", "version": "3.2.2" }
  11. Click "Open libraries" found on right hand side of instance GUI
  12. copy & paste lwjglfat.jar in the window that will open up
  13. Navigate to Settings tab in instance GUI
  14. Click Workarounds in that tab's pane
  15. Check "Native Libraries" & to use system installation of GLFW & OpenAL
  16. Launch, it may fail the first time during the stitching phase, but every launch after that will be a success
  17. Profit

@LexManos
Copy link
Member

LexManos commented Mar 10, 2021

Look guys, this is resolved. It was a upstream issue. Update yourself, or wait for 1.17 where Mojang updates.
Going to lock this as we don't really need more discussion.
And it's getting into the advocating manual hacks and sharing of random native files which we can't support as Forge.

@MinecraftForge MinecraftForge locked as resolved and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.15 1.16 Blocked Upstream This request's solution is awaiting a change on a project we depend on. Bug This request reports or fixes a new or existing bug. Confirmed This request has been verified to be factually correct by at least one member of the team. Not Us The issue can't be fixed by us/isn't caused by us. Vanilla Bug This request fixes or reports a bug that exists in the base Minecraft game. Wont Fix/Works As Intended This request reports something that would break expectations in order to fix.
Projects
None yet
Development

No branches or pull requests