godot: Engine hangs when trying to preload a resource from script starting with OS reserved names
Godot version: 3.0+, 4.0+
OS/device including version: Windows 10 1803 build 17134.165
Issue description:
I have tried to preload a script condition.gd
using relative path:
const Condition = preload("con
# engine hangs after `con` is typed
After that the engine hangs (no crash), with the following output (master, in official just hangs the engine)
WARNING: _open: Case mismatch opening requested file 'con.remap', stored as 'con' in the filesystem. This file will not open when exported to other case-sensitive platforms.
At: drivers/windows/file_access_windows.cpp:102
The issue is most likely related to the fact that parser tries to manipulate OS reserved names as pointed by KellyThomas
Workaround:
😄
Minimal reproduction project: con-preload-hang.zip
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (17 by maintainers)
Commits related to this issue
- Fix engine hangs with Windows reserved file names This is an experimental fix for #20110 that uses GetFileType function to test the opened file type and fail if the type is FILE_TYPE_CHAR (https://do... — committed to dragmz/godot by dragmz 5 years ago
- Prevent opening Windows console files Fixes #20110. — committed to reduz/godot by reduz a year ago
- Prevent opening Windows console files Fixes #20110. — committed to reduz/godot by reduz a year ago
- Prevent opening Windows console files Fixes #20110. — committed to the-brickster/godot by reduz a year ago
- Prevent opening Windows console files Fixes #20110. — committed to Streq/godot by reduz a year ago
Probably related to this constraint:
https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file
Doesn’t this in effect result in Godot creating files that are problematic to handle with other, non-prefix-aware programs? Because
\\?\c:\con
would then be fine for us, but feels like that may result in issues with other programs still. Also this should be fairly fast to compare against a blacklist compared to the already quite slow file operations.@hpvb That sounds like an interesting option.
Whatever fix we choose, we must ensure that it doesn’t make cross-platform dev and export more cumbersome. The proposed fix in #25805 would imply that some names can’t be used while on Windows, but you can use them while on Linux and export a broken Windows build, which isn’t good.