-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Godot built from the master branch crashes when pressing enter on the project manager screen #101555
Comments
Just compiled the beta locally, and can confirm the crash when you just open Godot and press ENTER. My system: |
Confirmed, backtrace with debug symbols:
Given |
There's two issues in the code that @Klemmbaustein linked to:
|
I've also been able to reproduce this error locally:
I’m currently working on fixing the void ProjectManager::_open_selected_projects_check_recovery_mode() {
Vector<ProjectList::Item> selected_projects = project_list->get_selected_projects();
if (selected_projects.is_empty()) {
return;
}
ProjectList::Item project = selected_projects[0];
if (project.missing) {
return;
}
... // The rest of the code remains unchanged
} Regarding the rest of the method, I’m unclear about the statement:
Could you clarify this further, @akien-mga? It's not clear to me yet. Specifically, I’d like to understand whether we should:
void ProjectManager::_open_selected_projects_check_recovery_mode() {
...
// Check each selected project for recovery mode
bool has_recovery_project = false;
for (const ProjectList::Item& project : selected_projects) {
if (project.missing) {
continue;
}
// Check if any project failed to load during the last startup.
if (project.recovery_mode) {
has_recovery_project = true;
break;
}
}
if (has_recovery_project) {
open_in_recovery_mode = false;
_open_recovery_mode_ask(false);
return;
}
_open_selected_projects_check_warnings();
} OR
Clarifying this will help me decide the right approach to proceed. Thank you! |
Regarding multi-selection, I'm not sure what the best approach should be to be honest. The project manager handling of this is pretty hacky, and there's already some functionality that only caters to the first selected projects, e.g. the project migration handling. I think it's reasonable to expect that only one project should be opened when doing project recovery, but then we need to give proper feedback to the user that only the first project in their selection is being considered. @rsubtil (who implemented the recovery mode) might need to chime in. |
To be honest, I only learned that Godot supports opening multiple projects when I implemented this feature 😅 So, to give my two cents, I'd say that if a project is in a bad state that requires being opened in recovery mode, it is a temporary problem that warrants some concentration on each specific project in order to fix. So I'm more inclined to support opening recovery mode for individual projects only. |
I've added a dialog to warn users which project is being considered for opening in recovery mode: What do you think? Here's the code: void ProjectManager::_open_selected_projects_check_recovery_mode() {
Vector<ProjectList::Item> selected_projects = project_list->get_selected_projects();
if (selected_projects.is_empty()) {
return;
}
const ProjectList::Item &project = selected_projects[0];
if (selected_projects.size() > 1) {
open_in_recovery_mode_dialog->set_text(vformat(TTR("Only the first selected project will be considered for opening in recovery mode: %s"), project.path));
open_in_recovery_mode_dialog->popup_centered(Size2i(400.0 * EDSCALE, 0));
}
if (project.missing) {
return;
}
... // The rest of the code remains unchanged
} I can include this in my PR if it makes sense. CC @akien-mga @rsubtil Edit: Upon checking the console, I found the following error:
I haven’t figured out how to fix this yet. Any ideias? |
Tested versions
This happens when building the engine from the master branch, and recent builds of other PRs (for example: #101552)
4.3 and 4.4-dev7 do not crash like this.
System information
Godot v4.4.beta (4ce466d) - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 32.0.15.6636) - AMD Ryzen 9 5950X 16-Core Processor (32 threads)
Issue description
The engine crashes with the following error message when pressing enter on the project manager screen if no project is selected:
I've looked into this for myself, and it looks like It's crashing because it's trying to open the currently selected project, but it doesn't check if there are no selected projects.
(editor/project_manager.cpp line 1052)
(editor/project_manager.cpp line 615)
From my testing, adding a check to verify that
project_list->get_selected_projects()
returns at least one project fixes this crash and works fine. I have no idea why this is only happening in very new versions of the engine though, this code for this hasn't changed for months (EDIT: I misread dates in the git blame, it looks like #92563 caused this). Maybe something in the input code is not marking that input as handled properly, so it's treated as a shortcut incorrectly?Steps to reproduce
Press enter on the project manager screen if no project is selected.
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: