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

'Reload Current Project' menu option just causes Godot to exit #74549

Open
blackears opened this issue Mar 7, 2023 · 10 comments
Open

'Reload Current Project' menu option just causes Godot to exit #74549

blackears opened this issue Mar 7, 2023 · 10 comments

Comments

@blackears
Copy link

Godot version

v4.0.stable.official [92bee43]

System information

Windows 10, Compatability

Issue description

Cliccing on the Reload Current Project option in the Project menu causes Godot to exit rather than reload the project.

Steps to reproduce

Open any project.
Select Project > Reload Current Project

Minimal reproduction project

N/A

@KoBeWi
Copy link
Member

KoBeWi commented Mar 7, 2023

It works, but seems to fail randomly (likely due to exit crash?)

@pierpo
Copy link

pierpo commented Mar 17, 2023

I have the same issue on Ubuntu 22.10. It does work on my macOS machine, though!

@CookieBadger
Copy link
Contributor

CookieBadger commented May 9, 2023

On my Windows 10 machine, Mono Godot (4.0.2 mono) consistently just exits, every single time.

@Calinou
Copy link
Member

Calinou commented May 9, 2023

Try starting Godot from a terminal then use Reload Current Project. This way, you will be able to see if it crashes on exit.

@kynn122

This comment was marked as off-topic.

@jitspoe
Copy link
Contributor

jitspoe commented Jul 19, 2023

Ran into this but didn't realize it was crashing until I happened to have a debugger attached. It just seemed like "reload current project" and the quit and reload after changing setting seemed to just quit without reloading half the time.

Seems like it might be caused by having errors when quitting.

Exception thrown: read access violation.
this was 0x26C91C857D0.

>	godot.windows.editor.x86_64.exe!EditorLog::_process_message(const String & p_msg, EditorLog::MessageType p_type) Line 216	C++
 	godot.windows.editor.x86_64.exe!EditorLog::add_message(const String & p_msg, EditorLog::MessageType p_type) Line 241	C++
 	[Inline Frame] godot.windows.editor.x86_64.exe!call_with_variant_args_static(void(*)(const String &, bool, bool)) Line 777	C++
 	[Inline Frame] godot.windows.editor.x86_64.exe!call_with_variant_args_static_ret(void(*)(const String &, bool, bool) p_method, const Variant * *) Line 846	C++
 	godot.windows.editor.x86_64.exe!CallableCustomStaticMethodPointerRet<void,String const &,bool,bool>::call(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 308	C++
 	godot.windows.editor.x86_64.exe!Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 51	C++
 	godot.windows.editor.x86_64.exe!CallableCustomBind::call(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 145	C++
 	godot.windows.editor.x86_64.exe!Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 51	C++
 	godot.windows.editor.x86_64.exe!CallQueue::_call_function(const Callable & p_callable, const Variant * p_args, int p_argcount, bool p_show_error) Line 220	C++
 	godot.windows.editor.x86_64.exe!CallQueue::flush() Line 336	C++
 	godot.windows.editor.x86_64.exe!Main::cleanup(bool p_force) Line 3558	C++
 	godot.windows.editor.x86_64.exe!widechar_main(int argc, wchar_t * * argv) Line 184	C++
 	godot.windows.editor.x86_64.exe!_main() Line 206	C++
 	godot.windows.editor.x86_64.exe!main(int argc, char * * argv) Line 218	C++
 	[Inline Frame] godot.windows.editor.x86_64.exe!invoke_main() Line 102	C++
 	godot.windows.editor.x86_64.exe!__scrt_common_main_seh() Line 288	C++
 	kernel32.dll!BaseThreadInitThunk�()	Unknown
 	ntdll.dll!RtlUserThreadStart�()	Unknown

After some digging, it seems getting the size of the message goes to this:

	_FORCE_INLINE_ uint32_t *_get_size() const {
		if (!_ptr) {
			return nullptr;
		}

		return reinterpret_cast<uint32_t *>(_ptr) - 1;
	}

And, in my case, that appears to be invalid memory:

-		message	{text=U"" type=MSG_TYPE_STD (0) count=0 }	EditorLog::LogMessage
-		text	U""	String
-		_cowdata	{_ptr=0x0000026ce6c70000 U"" }	CowData<char32_t>
-		_ptr	0x0000026ce6c70000 U""	char32_t *
			0 U''	char32_t
		type	MSG_TYPE_STD (0)	EditorLog::MessageType
		count	0	int
+		message.text._cowdata._ptr	0x0000026ce6c70000 U""	char32_t *
+		(uint32_t*)0x0000026ce6c70000 - 1	0x0000026ce6c6fffc {???}	unsigned int *

The message it was trying to log was "Console plugin exited."

Which was my own addon that had:

func _exit_tree():
	print ("Console plugin exited.")

Removing the print might have fixed it for me. Should probably ignore messages printed after shutdown, maybe?

@saierXP
Copy link

saierXP commented Jul 19, 2023

The message it was trying to log was "Console plugin exited."

Which was my own addon that had:

func _exit_tree():
	print ("Console plugin exited.")

Removing the print might have fixed it for me. Should probably ignore messages printed after shutdown, maybe?

Related to #79379

@blackears
Copy link
Author

I've noticed with the latest Godot build that I'm getting a crash when I try to restart the editor in Compatibility mode but not in the other modes.

@denis-games
Copy link

Same here with Godot 3.5, 4.0 and 4.1 on Ubuntu 23.04.
Was the same on previous Ubuntu versions (at least 22.04 & 22.10).

@tjmclain
Copy link

func _exit_tree():
	print ("Console plugin exited.")

Removing the print might have fixed it for me. Should probably ignore messages printed after shutdown, maybe?

Thanks so much for figuring this out and posting about it! Seriously. I was going crazy yesterday trying to track down this exact issue, and this fixed it for me.

I'll mention for anyone else checking out this post: I'm on Godot 4.1.1, and I'm scripting in C#, not GDScript (in case that's relevant).

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

No branches or pull requests

10 participants