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

[macOS 12 x86_64] 4.2 beta1+ crashes trying to launch Compatibility mode project due to ANGLE lib not being compatible #83269

Closed
aitorciki opened this issue Oct 13, 2023 · 11 comments

Comments

@aitorciki
Copy link
Contributor

Godot version

v4.2.beta1.official[b137180]

System information

Godot v4.2.beta1 - macOS 12.7.0 - Compatibility - integrated Intel(R) Iris(TM) Graphics 6100 - Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz (4 Threads)

Issue description

Godot 4.2 crashes when creating or opening a project using Compatibility rendering mode on Intel macOS (12.7):

Godot Engine v4.2.beta1.official.b1371806a - https://godotengine.org
ERROR: Can't create an EGL display.
   at: _get_gldisplay_id (drivers/egl/egl_manager.cpp:60)
ERROR: Condition "gldisplay_id < 0" is true. Returning: ERR_CANT_CREATE
   at: window_create (drivers/egl/egl_manager.cpp:188)
ERROR: Can't create an OpenGL context.
   at: _create_window (platform/macos/display_server_macos.mm:196)
ERROR: Condition "main_window == INVALID_WINDOW_ID" is true.
   at: DisplayServerMacOS (platform/macos/display_server_macos.mm:4470)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.beta1.official (b1371806ad3907c009458ea939bd4b810f9deb21)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] 1   libsystem_platform.dylib            0x00007ff8110f9dfd _sigtramp + 29
[2] 2   ???                                 0x0000000000000001 0x0 + 1
[3] RendererCompositorRD::_create_current()
[4] RendererCompositorRD::_create_current()
[5] RendererCompositorRD::_create_current()
[6] 6   dyld                                0x000000011208a52e start + 462
-- END OF BACKTRACE --
================================================================

The same project opens successfully in Godot 4.1.2. Converting the project to Forward+ also results in a successful launch.

Steps to reproduce

Creating a new project using Compatibility rendering mode from the manager results in the crash.

Minimal reproduction project

project.godot:

; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
;   [section] ; section goes between []
;   param=value ; assign values to parameters

config_version=5

[application]

config/name="MacOSGL"
config/features=PackedStringArray("4.1", "GL Compatibility")
config/icon="res://icon.svg"

[rendering]

renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
@akien-mga akien-mga added this to the 4.2 milestone Oct 13, 2023
@aitorciki aitorciki changed the title [macOS + x86_64] 4.2 crashes trying to launch Compatibility mode project [macOS + x86_64] 4.2 beta1 crashes trying to launch Compatibility mode project Oct 20, 2023
@aitorciki
Copy link
Contributor Author

Error persists in 4.2 beta 4, I hoped #83988 could have helped, but I'm getting the same result:

Godot Engine v4.2.beta4.official.93cdacbb0 - https://godotengine.org
ERROR: Can't create an EGL display.
   at: _get_gldisplay_id (drivers/egl/egl_manager.cpp:65)
ERROR: Condition "gldisplay_id < 0" is true. Returning: ERR_CANT_CREATE
   at: window_create (drivers/egl/egl_manager.cpp:193)
ERROR: Can't create an OpenGL context.
   at: _create_window (platform/macos/display_server_macos.mm:196)
ERROR: Condition "main_window == INVALID_WINDOW_ID" is true.
   at: DisplayServerMacOS (platform/macos/display_server_macos.mm:4545)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.beta4.official (93cdacbb0a30f12b2f3f5e8e06b90149deeb554b)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] 1   libsystem_platform.dylib            0x00007ff8110f9dfd _sigtramp + 29
[2] 2   ???                                 0x0000000000000001 0x0 + 1
[3] RendererCompositorRD::_create_current()
[4] RendererCompositorRD::_create_current()
[5] RendererCompositorRD::_create_current()
[6] 6   dyld                                0x000000011b2d252e start + 462
-- END OF BACKTRACE --
================================================================

@akien-mga
Copy link
Member

This is probably the same issue as #83669, the ANGLE libraries might not be compatible with macOS 12.7.

The crash in RendererCompositorRD is a bit weird, I guess we're trying to fall back to Forward+ or Mobile but somehow this logic doesn't work properly.

Does it work if you run the project from the command line with:

path/to/Godot --path path/to/project --rendering-driver opengl3

This should force using the native OpenGL drivers instead of ANGLE (which is controlled by opengl3_angle).

If you can then open the project successfully in the editor, you can change the rendering/gl_compatibility/driver.macos setting to opengl3 to enforce it.

@aitorciki
Copy link
Contributor Author

Adding --rendering-driver opengl3 to the command line works as expected, yes.

@akien-mga akien-mga changed the title [macOS + x86_64] 4.2 beta1 crashes trying to launch Compatibility mode project [macOS 10.14 and older] 4.2 beta1+ crashes trying to launch Compatibility mode project due to ANGLE lib not being compatible Oct 31, 2023
@bruvzg
Copy link
Member

bruvzg commented Oct 31, 2023

Automatic fallback to native GL is implemented in #83753 and should fix the crash. Both ARM64 and x86_64 versions of the editor are working on M1, and I have no Intel Macs to test it. It was expected to not work with something as old as 10.14 (#83669), but I'm surprised it's not working with 12.7, not sure what's wrong.

@akien-mga
Copy link
Member

Ah I misinterpreted the versions, I thought this was 10.12, not 12. So it may be a different issue to #83669 in the end.

@akien-mga akien-mga changed the title [macOS 10.14 and older] 4.2 beta1+ crashes trying to launch Compatibility mode project due to ANGLE lib not being compatible [macOS 12 x86_64] 4.2 beta1+ crashes trying to launch Compatibility mode project due to ANGLE lib not being compatible Oct 31, 2023
@akien-mga
Copy link
Member

@aitorciki Could you confirm if #83753 fixes the crash by testing this custom build I made after merging it?
https://downloads.tuxfamily.org/godotengine/testing/Godot_v4.2-beta_8fc215893_macos.universal.zip

I guess this wouldn't strictly fix this issue as we expect ANGLE to work fine on macOS 12.7, so this requires further investigation. But it would be good if OpenGL still works out of the box by falling back to the native driver.

@aitorciki
Copy link
Contributor Author

Still the same error with your custom build 😞

Godot Engine v4.2.beta.official.8fc215893 - https://godotengine.org
ERROR: Can't create an EGL display.
   at: _get_gldisplay_id (drivers/egl/egl_manager.cpp:65)
ERROR: Condition "gldisplay_id < 0" is true. Returning: ERR_CANT_CREATE
   at: window_create (drivers/egl/egl_manager.cpp:193)
ERROR: Can't create an OpenGL context.
   at: _create_window (platform/macos/display_server_macos.mm:196)
ERROR: Condition "main_window == INVALID_WINDOW_ID" is true.
   at: DisplayServerMacOS (platform/macos/display_server_macos.mm:4552)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.beta.official (8fc215893af3ea54a8fbd001caee0ce968d206d9)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] 1   libsystem_platform.dylib            0x00007ff8110f9dfd _sigtramp + 29
[2] 2   ???                                 0x0000000000000001 0x0 + 1
[3] RendererCompositorRD::_create_current()
[4] RendererCompositorRD::_create_current()
[5] RendererCompositorRD::_create_current()
[6] 6   dyld                                0x000000011ab1952e start + 462
-- END OF BACKTRACE --
================================================================

@aitorciki
Copy link
Contributor Author

I've compiled current master (6afd320) with and without angle_libs, just to compare to beta and the provided custom build when building on macOS 12 + Intel:

  • Compiling with angle_libs has the exact same result, Godot crashes not fallbacking to opengl3 printing ERROR: Can't create an EGL display unless opengl3 is forced.
  • Compiling without angle_libs launches the project successfully with opengl3 by default, and when forced to use ANGLE with --rendering-driver opengl3_angle if will fallback successfully to opengl3 after printing ERROR: Can't load EGL.

@YuriSizov
Copy link
Contributor

@aitorciki Could you see how the current master behaves, after #84288 was merged?

@aitorciki
Copy link
Contributor Author

Looking good! Properly falls back to OpenGL displaying ERROR: Can't create an EGL display. in the terminal 👍

@YuriSizov
Copy link
Contributor

Sweet! Let's assume the crash is fixed with #84288 which closes the issue. I think there are still some concerns about how ANGLE is behaving, but that should probably be tracked separately.

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

No branches or pull requests

4 participants