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

Crash when launching with nonexistent option #49658

Closed
timothyqiu opened this issue Jun 16, 2021 · 0 comments · Fixed by #49661
Closed

Crash when launching with nonexistent option #49658

timothyqiu opened this issue Jun 16, 2021 · 0 comments · Fixed by #49661
Assignees
Milestone

Comments

@timothyqiu
Copy link
Member

timothyqiu commented Jun 16, 2021

Godot version

master (34e308e)

System information

macOS 11.4

Issue description

I forgot what the option for generating the API reference is, so I tried --doc-tool, and Godot crashed. It seems that any unrecognized option can do, like --foobar.

Crash Log
ERROR: Bug (please report): EditorPaths haven't been initialized, EditorSettings cannot be created properly.
   at: create (editor/editor_settings.cpp:911)
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] 1   libsystem_platform.dylib            0x00007fff2067dd7d _sigtramp + 29
[2] CowData<char32_t>::_unref(void*) (in godot.osx.tools.64) (cowdata.h:201)
[3] String::String(String const&) (in godot.osx.tools.64) (ustring.h:440)
[4] String::String(String const&) (in godot.osx.tools.64) (ustring.h:440)
[5] EditorPaths::get_config_dir() const (in godot.osx.tools.64) (editor_paths.cpp:50)
[6] EditorSettings::get_text_editor_themes_dir() const (in godot.osx.tools.64) (editor_settings.cpp:1208)
[7] EditorSettings::list_text_editor_themes() (in godot.osx.tools.64) (editor_settings.cpp:1309)
[8] EditorSettings::create() (in godot.osx.tools.64) (editor_settings.cpp:972)
[9] ProjectManager::ProjectManager() (in godot.osx.tools.64) (project_manager.cpp:2394)
[10] ProjectManager::ProjectManager() (in godot.osx.tools.64) (project_manager.cpp:2787)
[11] Main::start() (in godot.osx.tools.64) (main.cpp:2365)
[12] main (in godot.osx.tools.64) (godot_main_osx.mm:78)
[13] 13  libdyld.dylib                       0x00007fff20653f5d start + 1
-- END OF BACKTRACE --
Abort trap: 6

Steps to reproduce

Execute:

/path/to/godot --doc-tool

Minimal reproduction project

No response

@akien-mga akien-mga added this to the 4.0 milestone Jun 16, 2021
@akien-mga akien-mga self-assigned this Jun 16, 2021
akien-mga added a commit to akien-mga/godot that referenced this issue Jun 16, 2021
WARNING: Hacks everywhere!

The logic in `main.cpp` is due a full rewrite as it's extremely hacky,
splitting argument parsing over several functions, with a mess of global state
and assumptions about what combinations of arguments or lack thereof should
mean in terms of what we want to read: game, editor, project manager, or
command line tools such as `--doctool`, `--export` or `--script`.

Until this is fully rewritten, this patch hacks things some more to ensure
that we don't fall back to the project manager in cases where it's not
warranted, and especially not *too late*, as it can mean that we haven't
properly initialized stuff like `EditorPaths` needed by the PM (which in turn
impacts what kind of path will be used for logs and the shader cache, etc...
the rabbit hole goes deep).

Fixes godotengine#41435.
Fixes godotengine#49392.
Fixes godotengine#49658.
Fixes godotengine#38202 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants