touilleMan / godot-python

Python support for Godot 🐍🐍🐍
Other
1.89k stars 143 forks source link

Godot 3.1 crashes when opening python script #120

Open swenner opened 5 years ago

swenner commented 5 years ago

Steps to reproduce:

  1. Open the python pong sample
  2. Double click on pong.py in the file inspector

Godot crashes. The sample itself works fine. Not sure who is to blame :)

Godot Master (3.1) ca28c455bfdc8408485c217c17f07011c0b43f64 Godot Python master ce5b3dd6194de9ad9edf5fc6c8e84324bf07d41e

OpenGL ES 3.0 Renderer: Gallium 0.4 on AMD PITCAIRN (DRM 2.49.0 / 4.9.0-8-amd64, LLVM 3.9.1)
Editing project: /home/simon/scratch/godot-python-git/examples/pong (::home::simon::scratch::godot-python-git::examples::pong)
OpenGL ES 3.0 Renderer: Gallium 0.4 on AMD PITCAIRN (DRM 2.49.0 / 4.9.0-8-amd64, LLVM 3.9.1)
simon@beutelteufel:~/scratch/godot-git$ Pythonscript version: 0.11.1
Pythonscript backend: cpython 3.5.6 (v3.5.6:627d0c6, Dec  1 2018, 14:52:26)  [GCC 6.3.0 20170516]
PYTHONPATH: ['/home/simon/scratch/godot-python-git/examples/pong/pythonscript/lib/python35.zip', '/home/simon/scratch/godot-python-git/examples/pong/pythonscript/lib/python3.5', '/home/simon/scratch/godot-python-git/examples/pong/pythonscript/lib/python3.5/plat-linux', '/home/simon/scratch/godot-python-git/examples/pong/pythonscript/lib/python3.5/lib-dynload', '/home/simon/.local/lib/python3.5/site-packages', '/home/simon/scratch/godot-python-git/examples/pong/pythonscript/lib/python3.5/site-packages', '/home/simon/scratch/godot-python-git/examples/pong/', '/home/simon/scratch/godot-python-git/examples/pong/lib']
handle_crash: Program crashed with signal 11
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(+0x33060) [0x7f4066240060] (??:0)
[2] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x800b50] (/home/simon/scratch/godot-git/modules/gdnative/pluginscript/pluginscript_script.cpp:429)
[3] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x2281cd6] (/home/simon/scratch/godot-git/./core/os/memory.h:120)
[4] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xd4e715] (/home/simon/scratch/godot-git/editor/editor_inspector.cpp:449)
[5] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xd4eca6] (/home/simon/scratch/godot-git/editor/editor_inspector.cpp:479)
[6] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xd56fdd] (/home/simon/scratch/godot-git/editor/editor_inspector.cpp:1701)
[7] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xd589b3] (/home/simon/scratch/godot-git/editor/editor_inspector.cpp:1774)
[8] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xd8337c] (/home/simon/scratch/godot-git/editor/editor_node.cpp:1483)
[9] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xe9eeeb] (/home/simon/scratch/godot-git/./core/reference.h:285)
[10] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xe9ef50] (/home/simon/scratch/godot-git/./core/cowdata.h:338)
[11] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xd80518] (/home/simon/scratch/godot-git/editor/editor_node.cpp:598)
[12] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0xe87b0a] (/home/simon/scratch/godot-git/editor/filesystem_dock.cpp:803)
[13] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x7d3552] (/home/simon/scratch/godot-git/./core/cowdata.h:338)
[14] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x23012d3] (/home/simon/scratch/godot-git/core/object.cpp:945 (discriminator 1))
[15] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x22f5d50] (/home/simon/scratch/godot-git/./core/variant.h:415)
[16] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x22f5fd7] (/home/simon/scratch/godot-git/core/message_queue.cpp:302)
[17] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x155c0d2] (/home/simon/scratch/godot-git/scene/main/scene_tree.cpp:507)
[18] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x4649ec] (/home/simon/scratch/godot-git/main/main.cpp:1858)
[19] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x44e3a1] (/home/simon/scratch/godot-git/platform/x11/os_x11.cpp:2821)
[20] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64(main+0xc1) [0x43f521] (/home/simon/scratch/godot-git/platform/x11/godot_x11.cpp:55)
[21] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7f406622d2e1] (??:0)
[22] /home/simon/scratch/godot-git/bin/godot.x11.opt.tools.64() [0x442bba] (??:?)
-- END OF BACKTRACE --
ERROR: set_path: Another resource is loaded from path: res://pong.py (possible cyclic resource inclusion)
vaclavbenes commented 5 years ago

It happens for godot 3.1 alpha 2 and higher..

CG-Tespy commented 5 years ago

I've been having this issue, as well. On the stable version of Godot 3.1.

menip commented 5 years ago

Yup: Godot version: 3.1 and as late as 3f76d2c on godot repo

OS/device including version: Linux

Issue description: Assume you have project open utilizing python, and a node in that project with a python script attached. Clicking on script to open it causes godot to crash. Assume you have project open utilizing python, and some node. If you try to add python script to that node, godot will crash. Assume you have a project open utilizing python, with some node as well as a python script. Dragging python script to that node will result in crash.

Note in all these cases desired action is performed, just have crash. Script is created, added, opened, as is visible by opening godot again.

Steps to reproduce: In fresh project, open up asset lib and install the python package. Create new node, proceed to add new python script to it. Observe crash. Note that upon opening project again, you will see that the python script file is created.

Minimal reproduction project:

.zip added so Github not complain :woman_shrugging: GodotPythonTest.7z.zip

Note that project runs fine. In uploaded one I set sprite to some middleish screen position on _ready() as an example.

SimLeek commented 5 years ago

Same issue here. Ubuntu 18.04, godot 3.1. Is there a quick workaround to just not open the script after adding it to a node?

whogben commented 5 years ago

It crashes for me anytime I would have viewed the script itself in Godot, my workaround is to use an external editor for the python scripts.

fuderiki commented 5 years ago

Using Godot 3.1 on Windows, same issue to report. Note that on the last Release Candidate 3.1.1 the file becomes totally impossible to open afterwards

jejay commented 5 years ago

Has someone reported this to godot itself? I feel like this might be also interesting for them. A silent fail is never supposed to happen.

menip commented 5 years ago

@jejay Yes I have.

Jeremi360 commented 5 years ago

@swenner @vaclavbenes @CG-Tespy @menip @SimLeek @fuderiki @whogben @jejay @touilleMan is rewriting project to use cython - ti will be easier to be up-to-date with current godot releases he mentioned it here: #126

bitnom commented 5 years ago

:(

fuderiki commented 5 years ago

Actually apart from Script Creation from within Godot ... Godot Python basically works in 3.1.1. release. But I can't wait to see a release version of Godot Cython ... It will probably solve the problem of speed that Godot Python Faces in manipulating Godot Objects. But for the moment I have to work with this version since it's the best thing we have that links python and a game engine.