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

Random crashes using Ctrl + X while multiple lines selected #81535

Closed
ArcMember opened this issue Sep 11, 2023 · 5 comments · Fixed by #86978
Closed

Random crashes using Ctrl + X while multiple lines selected #81535

ArcMember opened this issue Sep 11, 2023 · 5 comments · Fixed by #86978

Comments

@ArcMember
Copy link

ArcMember commented Sep 11, 2023

Godot version

v4.1.1.stable.mono.official [bd6af8e]

System information

Windows 11 - Godot v4.1.stable - Vulkan (Forward+) - GeForce RTX 3060 Laptop GPU (nvidia, 536.67) - AMD Ryzen 7 5800H

Issue description

Godot crashes when using Ctrl+X (but not when using "Cut" from context menu) while cursor is on multiple lines (placed with Alt). Crashes are random because some lines are cut fine and only some cause crash with no obvious difference.

The only error in console:
image

Steps to reproduce

  1. Write some code, I have consistent crashes on these lines:
var speed = max(1, speed_moving)
position += moving_vector.normalized() * speed * delta
  1. Set cursros on both of them by pressing Alt + LMB
  2. Press Ctrl+X

Minimal reproduction project

N/A

@MewPurPur
Copy link
Contributor

On it.

@MewPurPur
Copy link
Contributor

MewPurPur commented Sep 11, 2023

The copying operation itself works, the code gets to the end; it seems to crash later in the frame or something. 🤔

I can't see where this bug could be coming from.

@capnm
Copy link
Contributor

capnm commented Sep 11, 2023

Crash after setting cursors on 2 subsequent lines, here also with UI -> Edit -> Cut.
The error is IMO that it tries to delete 2 lines without a space between them..

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.2.m230909.custom_build (83fd610d2ff05159e299a9531370660983fc2caf)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3bfd0) [0x7f8284710fd0] (??:0)
[2] CodeTextEditor::_line_col_changed() (godot-git/./core/templates/cowdata.h:155)
[3] Object::emit_signalp(StringName const&, Variant const**, int) (godot-git/./core/object/object.cpp:1093)
[4] TextEdit::_emit_caret_changed() (godot-git/./core/variant/variant.h:301)
[5] MethodBindT<>::call(Object*, Variant const**, int, Callable::CallError&) const (godot-git/./core/variant/binder_common.h:?)
[6] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (godot-git/./core/object/object.cpp:?)
[7] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (godot-git/./core/variant/callable.cpp:62)
[8] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (godot-git/./core/object/message_queue.cpp:220)
[9] CallQueue::flush() (godot-git/./core/object/message_queue.cpp:?)
[10] SceneTree::physics_process(double) (godot-git/./scene/main/scene_tree.cpp:473)
[11] Main::iteration() (godot-git/main/main.cpp:3467)
[12] OS_LinuxBSD::run() (godot-git/platform/linuxbsd/os_linuxbsd.cpp:933)
[13] godot-build/godot.linuxbsd.editor.dev.x86_64.llvm(main+0xdc) [0x555c9149bbcc] (godot-git/platform/linuxbsd/godot_linuxbsd.cpp:76)
[14] /lib/x86_64-linux-gnu/libc.so.6(+0x271ca) [0x7f82846fc1ca] (??:0)
[15] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f82846fc285] (??:0)
[16] godot-build/strato-server/godot.linuxbsd.editor.dev.x86_64.llvm(_start+0x2a) [0x555c9149ba2a] (??:?)
-- END OF BACKTRACE --
================================================================
Aborted

@capnm
Copy link
Contributor

capnm commented Sep 16, 2023

EOF

E.g. here it prints if the second caret is at the EOF position:

ERROR: Index p_line = 11 is out of bounds (text.size() = 11).
   at: get_line_wrap_index_at_column (./scene/gui/text_edit.cpp:5293)

@wasiqwiqar
Copy link

My crashes seem to be happening on any lines that are together, also happens on more than 2 lines.

This causes a crash

Godot_v4 1 1-stable_win64_ODKr0gMfz7

This does not cause a crash

Godot_v4 1 1-stable_win64_a677iUnzuT

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