godotengine / godotengine/godot-cpp

commit() method of surfaceTool crashes the program

Open
#222 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

Hello,

In a plugin I'm writing I've had trouble with the surfaceTool class. It seems that the commit() method crashes the program, even in very simple situations.
Consider the following code :
```
void testFunc()
{
Ref mmesh:
Ref sf;
sf.instance();
sf->begin(Mesh::PRIMITIVE_TRIANGLES);
sf->add_vertex(Vector3(0,0,0));
sf->add_vertex(Vector3(0,1,0));
sf->add_vertex(Vector3(1,0,0));
mmesh = sf->commit();//Where the program crashes no matter what
}
```

I've commented/uncommented lines and the problem always seems to originate from commit().
Godot dumps the following backtrace :

```
OpenGL ES 3.0 Renderer: GeForce GTX 960M/PCIe/SSE2
CrashHandlerException: Program crashed
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] godot_nativescript_init
[1] godot_nativescript_init
[2] godot_nativescript_init
[3] godot_nativescript_init
[4] godot_nativescript_init
[5] godot_nativescript_init
[6] NativeScript::instance_create (c:\godot\modules\gdnative\nativescript\nativescript.cpp:233)
[7] Object::set_script (c:\godot\core\object.cpp:1012)
[8] MethodBind1::call (c:\godot\core\method_bind.gen.inc:815)
[9] Object::call (c:\godot\core\object.cpp:945)
[10] Object::call (c:\godot\core\object.cpp:869)
[11] UndoRedo::_process_operation_list (c:\godot\core\undo_redo.cpp:271)
[12] UndoRedo::redo (c:\godot\core\undo_redo.cpp:311)
[13] UndoRedo::commit_action (c:\godot\core\undo_redo.cpp:249)
[14] SceneTreeDock::_script_created (c:\godot\editor\scene_tree_dock.cpp:1502)
[15] MethodBind1 >::call (c:\godot\core\method_bind.gen.inc:815)
[16] Object::call (c:\godot\core\object.cpp:945)
[17] Object::emit_signal (c:\godot\core\object.cpp:1231)
[18] Object::emit_signal (c:\godot\core\object.cpp:1288)
[19] ScriptCreateDialog::_load_exist (c:\godot\editor\script_create_dialog.cpp:215)
[20] ScriptCreateDialog::ok_pressed (c:\godot\editor\script_create_dialog.cpp:155)
[21] AcceptDialog::_ok_pressed (c:\godot\scene\gui\dialogs.cpp:387)
[22] MethodBind0::call (c:\godot\core\method_bind.gen.inc:139)
[23] Object::call (c:\godot\core\object.cpp:945)
[24] Object::emit_signal (c:\godot\core\object.cpp:1231)
[25] Object::emit_signal (c:\godot\core\object.cpp:1288)
[26] BaseButton::_gui_input (c:\godot\scene\gui\base_button.cpp:138)
[27] MethodBind1 >::call (c:\godot\core\method_bind.gen.inc:815)
[28] Object::call_multilevel (c:\godot\core\object.cpp:779)
[29] Object::call_multilevel (c:\godot\core\object.cpp:886)
[30] Viewport::_gui_call_input (c:\godot\scene\main\viewport.cpp:1514)
[31] Viewport::_gui_input_event (c:\godot\scene\main\viewport.cpp:1854)
[32] Viewport::input (c:\godot\scene\main\viewport.cpp:2607)
[33] Viewport::_vp_input (c:\godot\scene\main\viewport.cpp:1292)
[34] MethodBind1 const &>::call (c:\godot\core\method_bind.gen.inc:815)
[35] Object::call (c:\godot\core\object.cpp:945)
[36] Object::call (c:\godot\core\object.cpp:869)
[37] SceneTree::call_group_flags (c:\godot\scene\main\scene_tree.cpp:262)
[38] SceneTree::input_event (c:\godot\scene\main\scene_tree.cpp:418)
[39] InputDefault::_parse_input_event_impl (c:\godot\main\input_default.cpp:440)
[40] InputDefault::parse_input_event (c:\godot\main\input_default.cpp:260)
[41] OS_Windows::WndProc (c:\godot\platform\windows\os_windows.cpp:720)
[42] WndProc (c:\godot\platform\windows\os_windows.cpp:947)
[43] CallWindowProcW
[44] CallWindowProcW
[45] glDebugEntry
[46] CallWindowProcW
[47] DispatchMessageW
[48] OS_Windows::process_events (c:\godot\platform\windows\os_windows.cpp:2201)
[49] OS_Windows::run (c:\godot\platform\windows\os_windows.cpp:2758)
[50] widechar_main (c:\godot\platform\windows\godot_win.cpp:150)
[51] _main (c:\godot\platform\windows\godot_win.cpp:172)
[52] main (c:\godot\platform\windows\godot_win.cpp:184)
[53] __scrt_common_main_seh (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[54] BaseThreadInitThunk
-- END OF BACKTRACE --
```

I'm on Windows 10.

Kind regards,
Andarann

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.