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

GUI editor issue while code editing and do Ctrl + S #24027

Closed
Tracked by #39144
etalot opened this issue Nov 28, 2018 · 6 comments
Closed
Tracked by #39144

GUI editor issue while code editing and do Ctrl + S #24027

etalot opened this issue Nov 28, 2018 · 6 comments

Comments

@etalot
Copy link

etalot commented Nov 28, 2018

Godot version:
latest 3.1 master 28-Nov-2018 built
GLES3 and GLES2 affected.

OS/device including version:
Windows 10 64bit, ver 1803
CPU: Intel Core i5-5200
GPU: Intel HD 5500(latest drivers ver. 20.19.15.5058)

Issue description:
While saving script in code editor often get infinite loop:

ERROR: _process_line: Index line=0 out of size (l.offset_caches.size()=0)
   At: scene/gui/rich_text_label.cpp:166

While don't have any rich_text_label node in project.
I tried to set breakpoints on line 166(and few lines before 166) in "scene/gui/rich_text_label.cpp" in Visual Studio 2017, no luck. Breakpoints doesn't work in debug mode in scene/gui/rich_text_label.cpp:166.
Please tell me why? (I'm not c++ developer, first time in my life compile project in Visual Studio)
Because breakpoints in main/main.cpp works.

I did some experiments:
Experiment N1. Swap lines:

ERR_FAIL_INDEX_V(line, l.offset_caches.size(), 0);
line_ofs = l.offset_caches[line];

and got good debug info in console:

ERROR: GDScript::reload: Method/Function Failed, returning: ERR_PARSE_ERROR At: modules\gdscript\gdscript.cpp:580 Loading resource: res://scn/Game.gd (cached) ERROR: CowData<int>::get: FATAL: Index p_index=0 out of size (size()=0) At: C:\temp\godot\core/cowdata.h:149 CrashHandlerException: Program crashed Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues [0] CowData<int>::get (c:\temp\godot\core\cowdata.h:149) [1] CowData<int>::get (c:\temp\godot\core\cowdata.h:149) [2] Vector<int>::operator[] (c:\temp\godot\core\vector.h:89) [3] RichTextLabel::_process_line (c:\temp\godot\scene\gui\rich_text_label.cpp:166) [4] RichTextLabel::_notification (c:\temp\godot\scene\gui\rich_text_label.cpp:856) [5] RichTextLabel::_notificationv (c:\temp\godot\scene\gui\rich_text_label.h:38) [6] Object::notification (c:\temp\godot\core\object.cpp:957) [7] CanvasItem::_update_callback (c:\temp\godot\scene\2d\canvas_item.cpp:447) [8] MethodBind0<CanvasItem>::call (c:\temp\godot\core\method_bind.gen.inc:139) [9] Object::call (c:\temp\godot\core\object.cpp:945) [10] MessageQueue::_call_function (c:\temp\godot\core\message_queue.cpp:256) [11] MessageQueue::flush (c:\temp\godot\core\message_queue.cpp:302) [12] SceneTree::iteration (c:\temp\godot\scene\main\scene_tree.cpp:477) [13] Main::iteration (c:\temp\godot\main\main.cpp:1834) [14] OS_Windows::run (c:\temp\godot\platform\windows\os_windows.cpp:2736) [15] widechar_main (c:\temp\godot\platform\windows\godot_win.cpp:150) [16] _main (c:\temp\godot\platform\windows\godot_win.cpp:172) [17] main (c:\temp\godot\platform\windows\godot_win.cpp:184) [18] __scrt_common_main_seh (d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288) [19] BaseThreadInitThunk -- END OF BACKTRACE --

Experiment N2. Comment lines 166/167:

//ERR_FAIL_INDEX_V(line, l.offset_caches.size(), 0);
//line_ofs = l.offset_caches[line];

and got graphic bug instead of freezing Godot and errors flow in GUI console(Output):

godot_bug

Experiment N3. More comment next if after 166 line:
//if (p_mode == PROCESS_CACHE) {
and graphic bug in GUI Output console is disappeared.

Steps to reproduce:

  1. Open minimal project.
  2. Press F5 to run it.
  3. After opened game window wait 2-5 seconds and close it.
  4. Press F3 for go to code editor
  5. Point cursor before "onready var nc = preload("res://scn/n.tscn")" (line 9)
  6. Rapidly(how you can) press spacebar, then Ctrl + S, then Backspace, then Ctrl + S, repeat few times. Soon Godot will be frozen. Check console window for infinite loop of:
    ERROR: _process_line: Index line=0 out of size (l.offset_caches.size()=0)
    At: scene/gui/rich_text_label.cpp:166

Minimal reproduction project:

Tree.bug3.zip

@akien-mga
Copy link
Member

akien-mga commented Jan 19, 2019

I tried the steps to reproduce but couldn't get it to trigger the infinite loop in the current master branch (7f92097).

@etalot
Copy link
Author

etalot commented Jan 20, 2019

I tried the steps to reproduce but couldn't get it to trigger the infinite loop in the current master branch (7f92097).

I tried just now with last https://hugo.pro/projects/godot-builds/
Issue still exist. I made video https://youtu.be/fcvpChB7rOY
With OBS Studio screen grabber, I get bug even in two hit Ctrl + S

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Feb 23, 2019
@Toshiwoz
Copy link
Contributor

Toshiwoz commented Oct 1, 2019

Hey, I know it might look like it's not related, but this error:
RichTextLabel::_process_line (c:\temp\godot\scene\gui\rich_text_label.cpp:166)
Is the same I get.

In my case, I've started getting that message when I've implemented threads, and the only thing I do in the thread that might relate to RichTextLabel, is sending messages to the output window using print(), so I made a test, removed all prints, and now it's not crashing anymore.
So, to me looks like the infinite loop is triggered because you have an error related to the richetext, maybe cache not cleared, and you send that message to the Output window, that is already saturated, that triggers godot to send again the same error message, and that generates the loop.

It's just my grain of salt, I might be wrong.

@akien-mga
Copy link
Member

Tried against in the current master branch, I still can't reproduce the issue (on Linux). Might be specific to Windows with its slower I/O. Can you still reproduce it in the latest 3.2 build?

@akien-mga
Copy link
Member

No new answer, and I still can't reproduce the bug, so closing. If anyone can reproduce it, please comment and make sure that a project is attached that can reliably trigger the issue.

@Birdulon
Copy link
Contributor

Started getting this fairly frequently in 3.5rc1 while editing scripts in VSCode, I'll try and whip up a minimum project for it later.
image

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

4 participants