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 example DodgeTheCreeps #38

Open
1l0 opened this issue Mar 21, 2018 · 3 comments
Open

Crash on example DodgeTheCreeps #38

1l0 opened this issue Mar 21, 2018 · 3 comments

Comments

@1l0
Copy link
Contributor

1l0 commented Mar 21, 2018

The app could be launched and the player could be controlled,
screen shot 2018-03-22 at 6 15 36
but after a couple of seconds the app will crash.
Go version: go1.10 darwin/amd64
Godot version: 3.0.2.stable.official or 3.0.0.stable.official

$ godot -v
arguments
0: godot
1: -v
Current path: $GOPATH/src/github.com/ShadowApex/godot-go/examples/godot/DodgeTheCreeps
Using GLES3 video driver
OpenGL ES 3.0 Renderer: NVIDIA GeForce 320M OpenGL Engine
CoreAudio: detected 2 channels
CoreAudio: audio buffer frames: 512 calculated latency: 11ms
CORE API HASH: 5483915881153564253
EDITOR API HASH: -5919760101651613804
load resource: res://default_env.tres
load resource: res://Main.tscn
load resource: res://libgodot.gdnlib
load resource: res://Mob.tscn
load resource: res://libgodot.gdnlib (cached)
load resource: res://art/enemySwimming_1.png
load resource: res://art/enemySwimming_2.png
load resource: res://art/enemyWalking_1.png
load resource: res://art/enemyWalking_2.png
load resource: res://art/enemyFlyingAlt_1.png
load resource: res://art/enemyFlyingAlt_2.png
load resource: res://libgodot.gdnlib (cached)
2018/03/22 06:04:58 godot.go:74: Discovering classes to register with Godot...
load resource: res://art/enemySwimming_1.png (cached)
load resource: res://art/enemySwimming_2.png (cached)
load resource: res://art/enemyWalking_1.png (cached)
load resource: res://art/enemyWalking_2.png (cached)
load resource: res://art/enemyFlyingAlt_1.png (cached)
load resource: res://art/enemyFlyingAlt_2.png (cached)
load resource: res://Player.tscn
load resource: res://libgodot.gdnlib (cached)
load resource: res://art/playerGrey_walk1.png
load resource: res://art/playerGrey_walk2.png
load resource: res://art/playerGrey_up1.png
load resource: res://art/playerGrey_up2.png
load resource: res://libgodot.gdnlib (cached)
load resource: res://art/playerGrey_walk1.png (cached)
load resource: res://art/playerGrey_walk2.png (cached)
load resource: res://art/playerGrey_up1.png (cached)
load resource: res://art/playerGrey_up2.png (cached)
load resource: res://libgodot.gdnlib (cached)
load resource: res://Mob.tscn (cached)
load resource: res://Player.tscn (cached)
2018/03/22 06:04:58 player.go:34: X_Ready called!
2018/03/22 06:04:58 player.go:37: Getting animated sprite...
2018/03/22 06:04:58 player.go:40: Got animated sprite with ID: 0x7fe081ed91a0
2018/03/22 06:04:58 main.go:53: X_Ready called!
2018/03/22 06:04:58 main.go:54: Registry: &{map[0x7fe081ecf1c0:0xc4200d1b80 0x7fe081ed8ce0:0xc4200ea0a0]}
2018/03/22 06:04:58 main.go:95: New Game
FPS: 1
FPS: 1
FPS: 7
FPS: 60
2018/03/22 06:05:01 main.go:102: Start timer timeout
FPS: 60
2018/03/22 06:05:01 main.go:113: Mob timer timeout
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
-- END OF BACKTRACE --
Abort trap: 6
@ShadowApex
Copy link
Owner

Which version of godot-go are you using? It should not crash as of git version 69f026d512f5e5b3a8c10798b7a56d5761a70b09.

Right now there is an open issue with instancing nodes. The latest version shouldn't crash with the Dodge the Creeps example.

In the future, if you want to get more debug information, you can do the following:

  1. Compile Godot with debug symbols:
git clone https://github.com/godotengine/godot.git
git fetch && git checkout 3.0
scons platform=<osx/x11> target=debug --jobs 4
  1. Then run Godot with GDB to catch any crashes or segfaults. You can install GDB with brew, then you can run the debug version of Godot with GDB:
gdb godot
  1. Then set following forked processes and run Godot in GDB:
(gdb) set follow-fork-mode child
(gdb) run

Now if you experience a segfault, you can print a backtrace with bt:

#0  0x0000555557575e10 in Vector<SceneState::NodeData>::_get_size (this=0x148) at core/vector.h:61
#1  0x000055555757326c in Vector<SceneState::NodeData>::size (this=0x148) at core/vector.h:113
#2  0x0000555557565306 in SceneState::can_instance (this=0x0) at scene/resources/packed_scene.cpp:45
#3  0x0000555557571002 in PackedScene::can_instance (this=0x55555a0e4c70) at scene/resources/packed_scene.cpp:1670
#4  0x00005555562ec0e2 in MethodBind0RC<bool>::ptrcall (this=0x555559d88240, p_object=0x55555a0e4c70, p_args=0x55555a237380, r_ret=0xc420173a0c) at core/method_bind.gen.inc:565
#5  0x00005555564ba4ec in godot_method_bind_ptrcall (p_method_bind=0x555559d88240, p_instance=0x55555a0e4c70, p_args=0x55555a237380, p_ret=0xc420173a0c) at modules/gdnative/gdnative/gdnative.cpp:69
#6  0x00007fffd64093c8 in runtime.asmcgocall () at /usr/share/go-1.10/src/runtime/asm_amd64.s:688
#7  0x0000000000000810 in ?? ()
#8  0x0000000000000000 in ?? ()

@1l0
Copy link
Contributor Author

1l0 commented Mar 23, 2018

godot-go repo version:

$ git log -n 1
commit 69f026d512f5e5b3a8c10798b7a56d5761a70b09 (HEAD -> master, origin/master, origin/HEAD)
Author: William Edwards <shadowapex@gmail.com>
Date:   Thu Mar 15 23:36:49 2018 -0700

    Update README

Thanks for an introduction of the GDB stuff I will give it a try.

@ShadowApex
Copy link
Owner

Hi @1l0 ,

Thanks for providing the version of godot-go you're using. It's interesting that it crashed for you. Would you be able to try running it with GDB and posting the backtrace?

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

No branches or pull requests

2 participants