godot: Editor fails to launch on Linux without any error when project is on a path with `\x20`

Godot version

v4.1.1.stable.official [bd6af8e0e]

System information

Linux 6.4.8-247.current

Issue description

The editor fails to open projects.

  • New projects and demo projects behave the same.
  • Identical behaviour with Godot v3.5.2.stable.official [170ba337a] .

So I assume there is some missing library or something on my system. But there is no info on the commandline and no error messages or feedback. Just silently takes me back to the Project Manager window.

I ran Delta V: Rings of Saturn to confirm that a built Godot game would work, and it ran just fine. As do non-Godot games from Stellaris for Linux from GoG to Deep Rock Galactic running on Proton.

Very perplexing.

Screenshot from 2023-08-07 11-40-40 Screenshot from 2023-08-07 11-40-59

Steps to reproduce

  1. Run Godot
  2. Create a new project
  3. Click on project to highlight it
  4. Click Edit button

Expected

Godot editor launches.

Actual

Godot logo displays briefly before returning to the Project Manager.

Minimal reproduction project

Empty projected I tested with: Aleph.zip

Also tried a demo project from the asset list and got the same result.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 18 (9 by maintainers)

Most upvoted comments

We could change the replace("\\", "/") to run it only on Windows, but this might have other unwanted consequences. Needs thorough testing.

I think you’re onto something.

I’ve tried many other locations and other names. In my home folder it works with spaces or periods - so it isn’t the dots. It also works on my external drive - so it isn’t because it is across some odd filesystem boundary.

But the editor will not work on my secondary internal drive no matter where it is.

And after making many different projects and trying things out I think I know why:

  1. The standard path I use to access my secondary drive, as you’ve seen, is /media/data.secondary
  2. But that path is actually a symlink to another path in /mnt (for historical reasons)
  3. The partition’s label has a space in it, and that label is used as the name of the folder
  4. Due to some weird bug, the mount configuration system choked on the space and rendered it as \x20

Godot’s Project Manager can access the symlink, but I tried to brown to the path with the backslash in it, and it refuses to open the path at all. I can select it, but then the Godot Project Manager reports that the path specified doesn’t exist.

Screenshot from 2023-08-09 08-18-21

You’ll also note that it shows a forward slash instead of the backslash that it should.

Screenshot from 2023-08-09 08-30-23

Nemo, my file manager, displays the disk label in the breadcrumbs, but the backslashed version generated by the mounting configuration in the folder itself.

So I think that the editor is trying to resolve symlinks, hits that backslash and decides that it has seen enough and exits.

Incidentally, Godot does not crash or report any errors to the console when it is unable to open that weird path in the project browser.

I haven’t run into any other programs that have issues with it, but I can kinda understand why a program might. I can do a workaround to rename the mount path, and since I luckily used a symlink for everything, very few things should break so long as I update the /media/data.secondary link. I’ll try that out shortly.

  • I think the fix is to look at the path parsing code/library and ensure it can handle weird characters.
  • It might even just be cross-platform path separator code getting confused.

Looks like that incantation is used all over the place. I might suggest a single Path object which can handle paths instead of disconnected bespoke string operations.

Screenshot from 2023-08-09 09-09-02

There is a single file (but not exactly tiny) library called cwalk for C/C++ which could be handy if you don’t want to write your own. It is also MIT licensed like Godot.

I’ve written my own Path libraries in a couple of languages, but not C++. I could give it a shot if you’re interested.

Can confirm:

  • using the same path in Godot
  • to the same filesystem
  • but a different mount point without any weird characters in it

Now works!

Screenshot from 2023-08-09 08-40-24

So it had to do with the backslash in the symlink path.

It immediately drops me into the Project Manager whether I run it from gdb or not.

❯ gdb --args ./linux/godot.linuxbsd.editor.x86_64 -e --path /media/data.secondary/Game\ Projects/Godot/Dalet/
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-solus-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Warning: 'set logging on', an alias for the command 'set logging enabled', is deprecated.
Use 'set logging enabled on'.

Warning: 'set logging off', an alias for the command 'set logging enabled', is deprecated.
Use 'set logging enabled off'.

Reading symbols from ./linux/godot.linuxbsd.editor.x86_64...
gdb$ run
Starting program: ~/Source/Clones/godot-debug-builds/bin/linux/godot.linuxbsd.editor.x86_64 -e --path /media/data.secondary/Game\ Projects/Godot/Dalet/
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
[Detaching after vfork from child process 201279]
[New Thread 0x7fffe9dff6c0 (LWP 201281)]
[New Thread 0x7fffe95fe6c0 (LWP 201282)]
[New Thread 0x7fffe8dfd6c0 (LWP 201283)]
[New Thread 0x7fffe85fc6c0 (LWP 201284)]
[New Thread 0x7fffe7dfb6c0 (LWP 201285)]
[New Thread 0x7fffe75fa6c0 (LWP 201286)]
[New Thread 0x7fffe6df96c0 (LWP 201287)]
[New Thread 0x7fffe65f86c0 (LWP 201288)]
[New Thread 0x7fffe5df76c0 (LWP 201289)]
[New Thread 0x7fffe55f66c0 (LWP 201290)]
[New Thread 0x7fffe4df56c0 (LWP 201291)]
[New Thread 0x7fffe45f46c0 (LWP 201292)]
[New Thread 0x7fffe3df36c0 (LWP 201293)]
[New Thread 0x7fffe35f26c0 (LWP 201294)]
[New Thread 0x7fffe2df16c0 (LWP 201295)]
[New Thread 0x7fffe25f06c0 (LWP 201296)]
[New Thread 0x7fffe1def6c0 (LWP 201297)]
[New Thread 0x7fffe15ee6c0 (LWP 201298)]
[New Thread 0x7fffe0ded6c0 (LWP 201299)]
[New Thread 0x7fffe05ec6c0 (LWP 201300)]
[New Thread 0x7fffdfdeb6c0 (LWP 201301)]
[New Thread 0x7fffdf5ea6c0 (LWP 201302)]
[New Thread 0x7fffdede96c0 (LWP 201303)]
[New Thread 0x7fffde5e86c0 (LWP 201304)]
[New Thread 0x7fffddde76c0 (LWP 201305)]
[New Thread 0x7fffdd5e66c0 (LWP 201306)]
[New Thread 0x7fffdcde56c0 (LWP 201307)]
[New Thread 0x7fffdc5e46c0 (LWP 201308)]
[New Thread 0x7fffdbde36c0 (LWP 201309)]
[New Thread 0x7fffdb5e26c0 (LWP 201310)]
[New Thread 0x7fffdade16c0 (LWP 201311)]
[New Thread 0x7fffda5e06c0 (LWP 201312)]
[New Thread 0x7fffd9ddf6c0 (LWP 201313)]
Godot Engine v4.0.3.stable.custom_build.5222a99f5 - https://godotengine.org
[New Thread 0x7fffd8fa46c0 (LWP 201314)]
[Detaching after fork from child process 201315]
[New Thread 0x7fffd3fff6c0 (LWP 201316)]
[Thread 0x7fffd8fa46c0 (LWP 201314) exited]
[Detaching after fork from child process 201317]
[New Thread 0x7fffc95ff6c0 (LWP 201318)]
OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility - Using Device: NVIDIA Corporation - NVIDIA GeForce RTX 3080 Ti
[New Thread 0x7fffc8dfe6c0 (LWP 201319)]
[New Thread 0x7fffc85fd6c0 (LWP 201320)]
[New Thread 0x7fffc7c516c0 (LWP 201321)]

[New Thread 0x7fffc72506c0 (LWP 201322)]

Because it immediately kicks over the Project Manager I don’t think that a trace will be very useful but here is the bt command after I halted it:

^C
Thread 1 "godot.linuxbsd." received signal SIGINT, Interrupt.
-----------------------------------------------------------------------------------------------------------------------[regs]
  RAX: 0xFFFFFFFFFFFFFDFC  RBX: 0x00007FFFFFFFDDA0  RCX: 0x00007FFFF7CDD835  RDX: 0x00007FFFFFFFDDA0  o d I t S z A p C
  RSI: 0x0000000000000000  RDI: 0x0000000000000000  RBP: 0x00007FFFFFFFDDB0  RSP: 0x00007FFFFFFFDD60  RIP: 0x00007FFFF7CDD835
  R8 : 0x0000000000000000  R9 : 0x0000000000000004  R10: 0x00007FFFFFFFDDB0  R11: 0x0000000000000293  R12: 0x0000000000000000
  R13: 0x0000000000000000  R14: 0x0000000000000045  R15: 0x0000000000000000
  CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000  SS: 002B
-----------------------------------------------------------------------------------------------------------------------[code]
=> 0x7ffff7cdd835 <clock_nanosleep+101>:        mov    edi,r8d
   0x7ffff7cdd838 <clock_nanosleep+104>:        mov    QWORD PTR [rsp],rax
   0x7ffff7cdd83c <clock_nanosleep+108>:        call   0x7ffff7c8bc40
   0x7ffff7cdd841 <clock_nanosleep+113>:        mov    rax,QWORD PTR [rsp]
   0x7ffff7cdd845 <clock_nanosleep+117>:        add    rsp,0x28
   0x7ffff7cdd849 <clock_nanosleep+121>:        neg    eax
   0x7ffff7cdd84b <clock_nanosleep+123>:        ret
   0x7ffff7cdd84c <clock_nanosleep+124>:        nop    DWORD PTR [rax+0x0]
-----------------------------------------------------------------------------------------------------------------------------
0x00007ffff7cdd835 in clock_nanosleep () from /usr/lib/haswell/libc.so.6
gdb$ bt
#0  0x00007ffff7cdd835 in clock_nanosleep () from /usr/lib/haswell/libc.so.6
#1  0x00007ffff7ce23c7 in nanosleep () from /usr/lib/haswell/libc.so.6
#2  0x000055555717b0f8 in OS_Unix::delay_usec (this=<optimized out>, p_usec=<optimized out>) at drivers/unix/os_unix.cpp:256
#3  0x000055555a29bcbf in OS::add_frame_delay (this=this@entry=0x7fffffffdf20, p_can_draw=<optimized out>) at core/os/os.cpp:548
#4  0x000055555610b6fc in Main::iteration () at main/main.cpp:3251
#5  0x00005555560a5ba1 in OS_LinuxBSD::run (this=this@entry=0x7fffffffdf20) at platform/linuxbsd/os_linuxbsd.cpp:889
#6  0x00005555560961f1 in main (argc=<optimized out>, argv=0x7fffffffe478) at platform/linuxbsd/godot_linuxbsd.cpp:73

Is there a good place in the editor code where I could drop a breakpoint or something?

This is X11 with Budgie.

Trying to open a project from the commandline doesn’t seem to dump anything interesting either.

❯ clear ; ./Godot_v4.1.1-stable_linux.x86_64 -v -e /media/data.secondary/Game\ Projects/Godot/Aleph/project.godot
Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Xshape 1.1 detected.
Xinerama 1.1 detected.
Xrandr 1.6 detected.
Xrender 0.11 detected.
Xinput 2.2 detected.
XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
Only one GPU found, using default.
ScreenSaver: DBus 1.14.4 detected.
PortalDesktop: DBus 1.14.4 detected.
Using "default" pen tablet driver...
Shader 'CanvasSdfShaderGLES3' SHA256: 72cda41890bce2f09217c172023d31e735a3fee605bad83c8e63f1a981a36a77
Shader 'SkeletonShaderGLES3' SHA256: add3f03e6eebdffdf0073fae42195857307eddada333b82998642329511917a2
Shader 'ParticlesShaderGLES3' SHA256: 9bf432d37b0b4792d67aa9f577258845d4047e3f98e990aeca6fd20a868c4db2
Shader 'ParticlesCopyShaderGLES3' SHA256: c778843b0cd1c7ce4c621fa2b924f703ac4001faef0555114b81a76c264a6908
Shader 'CopyShaderGLES3' SHA256: b1bc5a355ed9bda23f291956f121e0535b4e81b54cdac398412d200e6133161f
Shader 'CanvasShaderGLES3' SHA256: 007cddfcf35f7d57b219cffec53f6a7d9fe7a1979be4db64c6450cfac6000053
Shader 'CanvasOcclusionShaderGLES3' SHA256: 968915a469db9a7d505be274e8060c8288c15a5865baeb8362b3b0e2cacb16f3
Shader 'SceneShaderGLES3' SHA256: 7757391c487ac94cfa6418166bd5fdacce470f09394c1a2a875e878c8c5d8596
Shader 'SkyShaderGLES3' SHA256: 1fe105946e63973aecf5198091930c2bdb17778012ef0253e325ade3a297e6c8
Shader 'CubemapFilterShaderGLES3' SHA256: 2b651c285a02b7d4221af1827e1613c03e73e600ebc40b9e6a0b22bb855bd75f
OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 3080 Ti
JoypadLinux: udev enabled and loaded successfully.
PulseAudio 15.0.0 detected.
PulseAudio: context other
PulseAudio: context other
PulseAudio: context other
PulseAudio: context ready
PulseAudio: Detecting channels for device: alsa_output.pci-0000_0a_00.1.hdmi-stereo-extra1
PulseAudio: detected 2 output channels
PulseAudio: audio buffer frames: 512 calculated output latency: 11ms
 
TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 3144975361
EDITOR API HASH: 3555714656
EditorSettings: Load OK!
Loaded system CA certificates
EditorSettings: Save OK!

Godot was downloaded from the official website and moved to a writable subdirectory in /opt.