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 on 'Generate POT' when Dictionary-modifying Method is Present #79697

Closed
michaldev opened this issue Jul 20, 2023 · 7 comments · Fixed by #81653
Closed

Crash on 'Generate POT' when Dictionary-modifying Method is Present #79697

michaldev opened this issue Jul 20, 2023 · 7 comments · Fixed by #81653

Comments

@michaldev
Copy link

michaldev commented Jul 20, 2023

Godot version

4.0 -> latest

I've tested all this versions:
4.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4
4.1, 4.1.1
4.2 dev 4

in all this versions problem exists.

System information

Fedora 38, macOS

Issue description

I have found a very strange bug while generating translations. The presence of a method modifying the dictionary's content causes the editor to crash during the generation of the translation template.

The mere presence of an uninvoked method causes a crash.

Edit: The issue occurs not only with singletons. Any script containing a method that modifies any dictionary leads to a crash.

Steps to reproduce

Project -> Project Settings -> Localizations -> Generate POT -> Add (Add your singleton)

extends Node

var session_data = {
	"coins" : 0,
	"power": 0
}

var shop_items = [
	{
		"id": "max_hp",
		"name": tr("First Shop Item"),
		"desc": tr("Great tool."),
	}
]

func add_power(val: int):
	session_data["power"] += val

⚠️ Problem is in add_power method, not in shop_items.

Project -> Project Settings -> Localizations -> Generate POT -> Generate

And... Crash.

Nagranie.ekranu.z.2023-09-14.13-10-42.webm

Minimal reproduction project

translation_gm_crash.zip

Just open project and go to: Project -> Project Settings -> Localizations -> Generate POT -> Generate

@michaldev michaldev changed the title Crash after "Generate POT" - when I add autoloaded singleton Crash on 'Generate POT' when Autoloaded Singleton with Dictionary-modifying Method is Present Jul 20, 2023
@michaldev
Copy link
Author

Logs from console:

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.1.stable.official (bd6af8e0ea69167dd0627f3bd54f9105bda0f8b5)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
ERROR: FATAL: Index p_index = 1 is out of bounds (size() = 0).
   at: get (./core/templates/cowdata.h:155)

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.1.1.stable.official (bd6af8e0ea69167dd0627f3bd54f9105bda0f8b5)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
ERROR: FATAL: Index p_index = 1 is out of bounds (size() = 0).
   at: get (./core/templates/cowdata.h:155)

@michaldev
Copy link
Author

michaldev commented Jul 20, 2023

The subject appears to be more extensive. The crash also happens with files that are not autoloaded singletons.
Issue has been updated.

@michaldev michaldev changed the title Crash on 'Generate POT' when Autoloaded Singleton with Dictionary-modifying Method is Present Crash on 'Generate POT' when Dictionary-modifying Method is Present Jul 24, 2023
@michaldev
Copy link
Author

michaldev commented Jul 24, 2023

Having thoroughly investigated the issue, I can confirm that the problem is not limited to autoloaded singletons. It occurs with any file that has a method modifying any dictionary. This indicates that the bug is critical and is almost always present. Below, I present an example that does not use an autoloaded singleton.

translation_crash_2.zip
Project -> Project Settings -> Localizations -> Generate POT -> Generate

@michaldev
Copy link
Author

The generation problem also occurs in many other unidentified cases.

@michaldev
Copy link
Author

michaldev commented Sep 13, 2023

The problem occurs on various operating systems. Today I tested on macOS.
Issue has been updated.

@michaldev
Copy link
Author

michaldev commented Sep 13, 2023

Today I've tested all stable versions of Godot 4:
4.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4
4.1, 4.1.1

And latest dev 4 from godot 4.2.

On all this godot versions problem exists.

Issue has been updated.

@silverkorn
Copy link

Just a little shoutout to the gold member sponsorship. Made me curious 😆

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.

4 participants