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

Way to find the source of crash only present in the exported version? #53480

Closed
pixel-boy opened this issue Oct 6, 2021 · 5 comments
Closed

Comments

@pixel-boy
Copy link

pixel-boy commented Oct 6, 2021

Godot version

3.3.4.stable.official

System information

Windows 7, GLES 2

Issue description

My game crashes randomly in the export builds (only without the debug)
It does not happen every time even if the crash seems happens more often in certain levels of the game, I dont really see how to debug that, what are the solutions / techniques to track this kind of problem?
I'll continue to search but any ideas are welcome, because I don't really have any on my side anymore

The crashes are not specific to my computer, and also happens on Windows 10

I don't know if this is really useful but I have captured the crash on video several times, here is an example:
https://streamable.com/uw2qt5

Also some ERROR found in the logs, I can't really decipher them and don't know if they are the cause of the crashes but if that can help:

ERROR: Condition "!node" is true. Returned: nullptr
   at: get_node (scene/main/node.cpp:1325) - Condition "!node" is true. Returned: nullptr
ERROR: Index p_pos = -1 is out of bounds (data.children.size() + 1 = 2).
   at: move_child (scene/main/node.cpp:316) - Index p_pos = -1 is out of bounds (data.children.size() + 1 = 2).
ERROR: Condition "!f" is true.
   at: store_line (core/bind/core_bind.cpp:2131) - Condition "!f" is true.
ERROR: Error calling method from signal 'size_changed': 'Control(main.gd)::_on_window_size_changed': Method not found..
   at: emit_signal (core/object.cpp:1238) - Error calling method from signal 'size_changed': 'Control(main.gd)::_on_window_size_changed': Method not found..
**WARNING**: ObjectDB instances leaked at exit (run with --verbose for details).
   At: core/object.cpp:2132:cleanup() - ObjectDB instances leaked at exit (run with --verbose for details).
**ERROR**: Resources still in use at exit (run with --verbose for details).
   At: core/resource.cpp:450:clear() - Resources still in use at exit (run with --verbose for details).
**ERROR**: There are still MemoryPool allocs in use at exit!
   At: core/pool_vector.cpp:66:cleanup() - Condition "allocs_used > 0" is true.

Steps to reproduce

The problem is project specific, the only way I have to cause the crash is to play the game until it finally happens

Minimal reproduction project

I can share the game/project if necessary

@Calinou
Copy link
Member

Calinou commented Oct 6, 2021

This is a duplicate of another issue, but I can't find it right now.

This may have been fixed by #51796, so try upgrading to 3.4 beta 6 after making a backup of your project files.

@pixel-boy
Copy link
Author

I thought I was on the latest version but you made me realize that no, I tested with the beta6 version which was just released and so far I haven't had a crash, so I think this post can be closed, thanks!

@clayjohn
Copy link
Member

clayjohn commented Oct 6, 2021

Great! Thanks for checking again.

@clayjohn clayjohn closed this as completed Oct 6, 2021
@clayjohn clayjohn added this to the 3.4 milestone Oct 6, 2021
@akien-mga
Copy link
Member

Note that 3.4 beta 6 shouldn't crash indeed, but it should still print errors in your logs, because this issue happens due to a bug somewhere in your script. Previously this would only be reported on debug builds, and release builds would crash if the bug isn't fix.

The bug is typically that you're trying to use a reference to a node which has been freed, e.g.:

var node = <gets some node>

...

node.queue_free()

...

# Later, maybe from another script:
node.do_something()

You might be trying to prevent a crash with

if node != null:
    node.do_something()

but this doesn't work with freed instances, you should use is_instance_valid(node).

@pixel-boy
Copy link
Author

Thanks for the precision! I already use this solution in some cases that caused me bugs in the past, but in this one knowing that it happens outside the editor I could not locate the problem, I guess I should apply this solution everywhere from now on to avoid this kind of situation

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