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

Thread C++ Error not showing up in GUI #32957

Open
npip99 opened this issue Oct 21, 2019 · 1 comment
Open

Thread C++ Error not showing up in GUI #32957

npip99 opened this issue Oct 21, 2019 · 1 comment

Comments

@npip99
Copy link

npip99 commented Oct 21, 2019

Godot version: v3.2.alpha0.official

OS/device including version: Ubuntu 18.04.3

Issue description:

My game seems to randomly just close down, leaving ** Debug Process Stopped **. I have no error at all in the godot GUI, it all looks clear.

But, when I run from commandline, I get

ERROR: operator[]: FATAL: Index p_index=109 out of size (((Vector<T> *)(this))->_cowdata.size()=109)
   At: ./core/vector.h:49.
handle_crash: Program crashed with signal 4
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7ff448390f20] (??:0)
[2] godot-raw() [0xdbe1ff] (??:?)
[3] godot-raw() [0xdbe357] (??:?)
[4] godot-raw() [0xb3a361] (<artificial>:?)
[5] godot-raw() [0xb6285d] (??:?)
[6] godot-raw() [0x2931b00] (<artificial>:?)
[7] godot-raw() [0x294fdc8] (<artificial>:?)
[8] godot-raw() [0xbe75ef] (??:?)
[9] godot-raw() [0xb6294d] (??:?)
[10] godot-raw() [0x2931b00] (<artificial>:?)
[11] godot-raw() [0x294fdc8] (<artificial>:?)
[12] godot-raw() [0xbe75ef] (??:?)
[13] godot-raw() [0xb6294d] (??:?)
[14] godot-raw() [0x2931b00] (<artificial>:?)
[15] godot-raw() [0x294fdc8] (<artificial>:?)
[16] godot-raw() [0xbe75ef] (??:?)
[17] godot-raw() [0xb6294d] (??:?)
[18] godot-raw() [0x2931b00] (<artificial>:?)
[19] godot-raw() [0x294fdc8] (<artificial>:?)
[20] godot-raw() [0xbe75ef] (??:?)
[21] godot-raw() [0xb6294d] (??:?)
[22] godot-raw() [0x2931b00] (<artificial>:?)
[23] godot-raw() [0x294fdc8] (<artificial>:?)
[24] godot-raw() [0xbe75ef] (??:?)
[25] godot-raw() [0xb6294d] (??:?)
[26] godot-raw() [0x2931b00] (<artificial>:?)
[27] godot-raw() [0x294fdc8] (<artificial>:?)
[28] godot-raw() [0xbe75ef] (??:?)
[29] godot-raw() [0xb6294d] (??:?)
[30] godot-raw() [0x2931b00] (<artificial>:?)
[31] godot-raw() [0x294fdc8] (<artificial>:?)
[32] godot-raw() [0xbe75ef] (??:?)
[33] godot-raw() [0xb6294d] (??:?)
[34] godot-raw() [0x2931b00] (<artificial>:?)
[35] godot-raw() [0x294fdc8] (<artificial>:?)
[36] godot-raw() [0xbe75ef] (??:?)
[37] godot-raw() [0xb6294d] (??:?)
[38] godot-raw() [0x2931b00] (<artificial>:?)
[39] godot-raw() [0x294fdc8] (<artificial>:?)
[40] godot-raw() [0xbe75ef] (??:?)
[41] godot-raw() [0xb6294d] (??:?)
[42] godot-raw() [0x2931b00] (<artificial>:?)
[43] godot-raw() [0x294fdc8] (<artificial>:?)
[44] godot-raw() [0xbe75ef] (??:?)
[45] godot-raw() [0xb6294d] (??:?)
[46] godot-raw() [0x2931b00] (<artificial>:?)
[47] godot-raw() [0x294fdc8] (<artificial>:?)
[48] godot-raw() [0xbe75ef] (??:?)
[49] godot-raw() [0xb6294d] (??:?)
[50] godot-raw() [0x2931b00] (<artificial>:?)
[51] godot-raw() [0x294fdc8] (<artificial>:?)
[52] godot-raw() [0xbe75ef] (??:?)
[53] godot-raw() [0xb6294d] (??:?)
[54] godot-raw() [0x2931b00] (<artificial>:?)
[55] godot-raw() [0x294fdc8] (<artificial>:?)
[56] godot-raw() [0xbe75ef] (??:?)
[57] godot-raw() [0xb6294d] (??:?)
[58] godot-raw() [0x2931b00] (<artificial>:?)
[59] godot-raw() [0x294fdc8] (<artificial>:?)
[60] godot-raw() [0xbe75ef] (??:?)
[61] godot-raw() [0xb6294d] (??:?)
[62] godot-raw() [0x2931b00] (<artificial>:?)
[63] godot-raw() [0x294fdc8] (<artificial>:?)
[64] godot-raw() [0xbe75ef] (??:?)
[65] godot-raw() [0xb6294d] (??:?)
[66] godot-raw() [0x2931b00] (<artificial>:?)
[67] godot-raw() [0x294fdc8] (<artificial>:?)
[68] godot-raw() [0xbe75ef] (??:?)
[69] godot-raw() [0xb6294d] (??:?)
[70] godot-raw() [0x2931b00] (<artificial>:?)
[71] godot-raw() [0x294fdc8] (<artificial>:?)
[72] godot-raw() [0xbe75ef] (??:?)
[73] godot-raw() [0xb6294d] (??:?)
[74] godot-raw() [0x2931b00] (<artificial>:?)
[75] godot-raw() [0x294fdc8] (<artificial>:?)
[76] godot-raw() [0xbe75ef] (??:?)
[77] godot-raw() [0xb6294d] (??:?)
[78] godot-raw() [0x2931b00] (<artificial>:?)
[79] godot-raw() [0x294fdc8] (<artificial>:?)
[80] godot-raw() [0xbe75ef] (??:?)
[81] godot-raw() [0xb6294d] (??:?)
[82] godot-raw() [0x2931b00] (<artificial>:?)
[83] godot-raw() [0x294fcf0] (<artificial>:?)
[84] godot-raw() [0x193dadf] (??:?)
[85] godot-raw() [0x27fd986] (??:?)
[86] godot-raw() [0xba32d4] (??:?)
[87] godot-raw() [0x181551e] (<artificial>:?)
[88] godot-raw() [0x1855d0e] (??:?)
[89] godot-raw() [0x28c0310] (??:?)
[90] godot-raw() [0x834b7d] (??:?)
[91] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7ff448373b97] (??:0)
[92] godot-raw() [0x841d3e] (??:?)

So, it seems this error should have been appearing in the Godot GUI, but it wasn't. I tried pulling up gdb, and found this:

[New Thread 0x7fffc3566700 (LWP 15646)]
ERROR: operator[]: FATAL: Index p_index=68 out of size (((Vector<T> *)(this))->_cowdata.size()=68)
   At: ./core/vector.h:49.

Thread 1 "godot-raw" received signal SIGILL, Illegal instruction.
0x0000000000dbe1ff in Array::operator[](int) ()
(gdb) stop
(gdb) disas
Dump of assembler code for function _ZN5ArrayixEi:
   0x0000000000dbe180 <+0>:	push   %rbp
   0x0000000000dbe181 <+1>:	push   %rbx
   0x0000000000dbe182 <+2>:	movslq %esi,%rbx
   0x0000000000dbe185 <+5>:	sub    $0x8,%rsp
   0x0000000000dbe189 <+9>:	mov    (%rdi),%rbp
   0x0000000000dbe18c <+12>:	mov    0x10(%rbp),%rax
   0x0000000000dbe190 <+16>:	test   %ebx,%ebx
   0x0000000000dbe192 <+18>:	js     0xdbe1c0 <_ZN5ArrayixEi+64>
   0x0000000000dbe194 <+20>:	test   %rax,%rax
   0x0000000000dbe197 <+23>:	je     0xdbe1d0 <_ZN5ArrayixEi+80>
   0x0000000000dbe199 <+25>:	cmp    $0x4,%rax
   0x0000000000dbe19d <+29>:	je     0xdbe1d0 <_ZN5ArrayixEi+80>
   0x0000000000dbe19f <+31>:	cmp    -0x4(%rax),%ebx
   0x0000000000dbe1a2 <+34>:	jge    0xdbe210 <_ZN5ArrayixEi+144>
   0x0000000000dbe1a4 <+36>:	lea    0x10(%rbp),%rdi
   0x0000000000dbe1a8 <+40>:	callq  0x28a7d70 <_ZN7CowDataI7VariantE14_copy_on_writeEv>
   0x0000000000dbe1ad <+45>:	mov    0x10(%rbp),%rax
   0x0000000000dbe1b1 <+49>:	lea    (%rbx,%rbx,2),%rdx
   0x0000000000dbe1b5 <+53>:	add    $0x8,%rsp
   0x0000000000dbe1b9 <+57>:	pop    %rbx
   0x0000000000dbe1ba <+58>:	pop    %rbp
   0x0000000000dbe1bb <+59>:	lea    (%rax,%rdx,8),%rax
   0x0000000000dbe1bf <+63>:	retq   
   0x0000000000dbe1c0 <+64>:	test   %rax,%rax
   0x0000000000dbe1c3 <+67>:	je     0xdbe1d0 <_ZN5ArrayixEi+80>
   0x0000000000dbe1c5 <+69>:	cmp    $0x4,%rax
   0x0000000000dbe1c9 <+73>:	jne    0xdbe210 <_ZN5ArrayixEi+144>
   0x0000000000dbe1cb <+75>:	nopl   0x0(%rax,%rax,1)
   0x0000000000dbe1d0 <+80>:	xor    %r8d,%r8d
   0x0000000000dbe1d3 <+83>:	lea    0x1c5c6c6(%rip),%rax        # 0x2a1a8a0
   0x0000000000dbe1da <+90>:	pushq  $0x1
   0x0000000000dbe1dc <+92>:	movslq %ebx,%rcx
   0x0000000000dbe1df <+95>:	lea    0x1d2afc9(%rip),%r9        # 0x2ae91af
   0x0000000000dbe1e6 <+102>:	push   %rax
   0x0000000000dbe1e7 <+103>:	mov    $0x31,%edx
   0x0000000000dbe1ec <+108>:	lea    0x1c6582c(%rip),%rsi        # 0x2a23a1f
   0x0000000000dbe1f3 <+115>:	lea    0x1cb26ae(%rip),%rdi        # 0x2a708a8 <_ZZN16VectorWriteProxyI7VariantEixEiE12__FUNCTION__>
   0x0000000000dbe1fa <+122>:	callq  0xdbd1c0 <_Z22_err_print_index_errorPKcS0_illS0_S0_b>
=> 0x0000000000dbe1ff <+127>:	ud2    
   0x0000000000dbe201 <+129>:	data16 data16 data16 data16 data16 nopw %cs:0x0(%rax,%rax,1)
   0x0000000000dbe210 <+144>:	movslq -0x4(%rax),%r8
   0x0000000000dbe214 <+148>:	jmp    0xdbe1d3 <_ZN5ArrayixEi+83>

The program hangs when it tried to execute "ud2", which is an illegal instruction. But, you can see right before that is when it called _Z22_err_print_index_errorPKcS0_illS0_S0_b, or demangled it would be _err_print_index_error(char const*, char const*, int, long, long, char const*, char const*, bool). This correctly prints to terminal, but fails to print to the Godot console. I'm thinking it's because it almost immediately crashes after calling _err_print_index_error.

Most desirably, this should be showing where in the GDScript the error is. But, I understand sometimes that's hard to implement. But, it should at the minimum be showing the C++ error in the console, as it usually does.

Minimal reproduction project:
I've tried to create one but I can't other than this specific instance in my project. Hopefully I've left enough information, if you want more data collection I'd be happy to help.

@npip99 npip99 changed the title Error not showing up in GUI Thread C++ Error not showing up in GUI Oct 21, 2019
@KoBeWi
Copy link
Member

KoBeWi commented Oct 20, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

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

2 participants