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

OS.open_midi_inputs crashes with dummy audio #52821

Open
Tracked by #76797
qarmin opened this issue Sep 18, 2021 · 2 comments
Open
Tracked by #76797

OS.open_midi_inputs crashes with dummy audio #52821

qarmin opened this issue Sep 18, 2021 · 2 comments

Comments

@qarmin
Copy link
Contributor

qarmin commented Sep 18, 2021

Godot version

4.0.dev.custom_build. 22b2253

System information

Ubuntu 21.04 - Nvidia GTX 970, Gnome shell 3.38 X11

Issue description

Running project with

godot4 --audio-driver Dummy 

crashes with this backtrace

[1] godot4s(+0x3203960e) [0x564aa9e8a60e] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x41040) [0x7f7843149040] (??:0)

when using OS.open_midi_inputs()

Steps to reproduce

Above

Minimal reproduction project

No response

@qarmin qarmin added this to the 4.0 milestone Sep 18, 2021
@akien-mga
Copy link
Member

gdb backtrace:

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000003b2e457 in MIDIDriverALSAMidi::open (this=0x7fffffffd360) at drivers/alsamidi/midi_driver_alsamidi.cpp:130
#2  0x0000000006021ada in OS::open_midi_inputs (this=0x7fffffffd200) at core/os/os.cpp:471
#3  0x0000000005f990e6 in core_bind::OS::open_midi_inputs (this=0xaada900) at core/core_bind.cpp:179
#4  0x000000000253dc0e in call_with_ptr_args_helper<__UnexistingClass>(__UnexistingClass*, void (__UnexistingClass::*)(), void const**, IndexSequence<>) (p_instance=0xaada900, 
    p_method=&virtual table offset 160, p_args=0x0) at ./core/variant/binder_common.h:243
#5  0x000000000253d0ec in call_with_ptr_args<__UnexistingClass> (p_instance=0xaada900, p_method=&virtual table offset 160, p_args=0x0) at ./core/variant/binder_common.h:491
#6  0x000000000253ae36 in MethodBindT<>::ptrcall(Object*, void const**, void*) (this=0xab77ff0, p_object=0xaada900, p_args=0x0, r_ret=0x0) at ./core/object/method_bind.h:295
#7  0x000000000362a740 in GDScriptFunction::call (this=0xc03e950, p_instance=0xc9a1860, p_args=0x0, p_argcount=0, r_err=..., p_state=0x0) at modules/gdscript/gdscript_vm.cpp:1868
#8  0x000000000352fbe4 in GDScript::_create_instance (this=0xc9a3d60, p_args=0x0, p_argcount=0, p_owner=0xbe61880, p_is_ref_counted=false, r_error=...) at modules/gdscript/gdscript.cpp:154
#9  0x00000000035310d6 in GDScript::instance_create (this=0xc9a3d60, p_this=0xbe61880) at modules/gdscript/gdscript.cpp:371
#10 0x00000000064960bc in Object::set_script (this=0xbe61880, p_script=...) at core/object/object.cpp:892
#11 0x000000000601e146 in MainLoop::initialize (this=0xbe61880) at core/os/main_loop.cpp:61
#12 0x00000000022fa7db in OS_LinuxBSD::run (this=0x7fffffffd200) at platform/linuxbsd/os_linuxbsd.cpp:330
#13 0x00000000022f6f23 in main (argc=5, argv=0x7fffffffd718) at platform/linuxbsd/godot_linuxbsd.cpp:58

@akien-mga
Copy link
Member

Still reproducible in 4.0 RC 3.

The crash happens here:

Error MIDIDriverALSAMidi::open() {
	void **hints;

	if (snd_device_name_hint(-1, "rawmidi", &hints) < 0) {
		return ERR_CANT_OPEN;
	}

Apparently this API is not safe to call when using the dummy driver. There should be a way to error out earlier on if no suitable audio driver is configured.

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

3 participants