sjaehn / BChoppr

An audio stream chopping LV2 plugin
GNU General Public License v3.0
33 stars 3 forks source link

crash in zrythm #5

Closed alex-tee closed 4 years ago

alex-tee commented 4 years ago

Hi,

BChoppr crashes when I try to run it in Zrythm:

Thread 18 "zrythm" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb1fff700 (LWP 22020)]
0x00007ffff1bb5b78 in lv2_atom_forge_raw () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
(gdb) bt
#0  0x00007ffff1bb5b78 in lv2_atom_forge_raw () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
#1  0x00007ffff1bb5bfd in lv2_atom_forge_write () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
#2  0x00007ffff1bb5e94 in lv2_atom_forge_frame_time () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
#3  0x00007ffff1bb78d5 in BChoppr::notifyGUI() () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
#4  0x00007ffff1bb7315 in BChoppr::run(unsigned int) () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
#5  0x00007ffff1bb875c in run(void*, unsigned int) () from /home/alex/.guix-profile/lib/lv2/BChoppr.lv2/BChoppr.so
#6  0x000000000049ff91 in lilv_instance_run (instance=0x393a3e0, sample_count=256) at ../subprojects/lilv/lilv-0.24.6/lilv/lilv.h:1704
#7  0x00000000004a1f4e in run (plugin=0x3643700, nframes=256) at ../src/plugins/lv2_plugin.c:843
#8  0x00000000004a4e43 in lv2_plugin_process (lv2_plugin=0x3643700, g_start_frames=0, nframes=256) at ../src/plugins/lv2_plugin.c:2045
#9  0x0000000000480d0a in plugin_process (plugin=0x36332a0, g_start_frames=0, local_offset=0, nframes=256) at ../src/plugins/plugin.c:722
#10 0x000000000045f846 in node_process (node=0x3976920, nframes=256) at ../src/audio/routing.c:331
#11 0x000000000045fbaf in node_run (self=0x3976920) at ../src/audio/routing.c:445
#12 0x000000000045feed in graph_worker_thread (arg=0x2e825b0) at ../src/audio/routing.c:588
#13 0x00007ffff7f8e015 in start_thread () from /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib/libpthread.so.0
#14 0x00007ffff6ae991f in clone () from /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib/libc.so.6

It works in Ardour and jalv. any ideas what's the problem?

alex-tee commented 4 years ago

the same happens with B.Jumblr. however, B.SEQuencer and B.Shapr work

sjaehn commented 4 years ago

Thanks for your info. I haven't checked the plugin with zrythm, yet.

No idea about the reason. The segfault came from a relatively harmless line (309: lv2_atom_forge_frame_time(&forge, 0);

sjaehn commented 4 years ago

Hi Alex, I can reproduce the bug. Backtrace with -g :

`Thread 1 "zrythm" received signal SIGSEGV, Segmentation fault. 0x00007fffc8c277e1 in lv2_atom_forge_raw (forge=0x555556317290, data=0x7ffffffe90a0, size=8) at /usr/lib/lv2/atom.lv2/forge.h:308 308 lv2_atom_forge_deref(forge, f->ref)->size += size; (gdb) bt

0 0x00007fffc8c277e1 in lv2_atom_forge_raw(LV2_Atom_Forge, void const, uint32_t) (forge=0x555556317290, data=0x7ffffffe90a0, size=8)

at /usr/lib/lv2/atom.lv2/forge.h:308

1 0x00007fffc8c27889 in lv2_atom_forge_write(LV2_Atom_Forge, void const, uint32_t) (forge=0x555556317290, data=0x7ffffffe90a0, size=8)

at /usr/lib/lv2/atom.lv2/forge.h:326

2 0x00007fffc8c27bcf in lv2_atom_forge_frame_time(LV2_Atom_Forge*, int64_t) (forge=0x555556317290, frames=0) at /usr/lib/lv2/atom.lv2/forge.h:681

3 0x00007fffc8c29640 in BChoppr::notifyGUI() (this=0x555556317000)

at src/BChoppr.cpp:309

4 0x00007fffc8c2905d in BChoppr::run(unsigned int) (this=0x555556317000, n_samples=2) at src/BChoppr.cpp:239

5 0x00007fffc8c2a500 in run(void*, unsigned int) (instance=0x555556317000, n_samples=2) at src/BChoppr.cpp:476

6 0x00005555555ed4b8 in lv2_plugin_process ()

7 0x00005555555efa46 in lv2_plugin_get_latency ()

8 0x00005555555d262d in plugin_update_latency ()

9 0x00005555555bca4e in graph_setup ()

10 0x00005555555b0c31 in mixer_recalc_graph ()

11 0x00005555555a8258 in create_tracks_action_do ()

12 0x00005555555a8904 in undo_manager_perform ()

13 0x000055555567d60f in ()

14 0x00007ffff74acff4 in () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

---Type to continue, or q to quit---

15 0x00007ffff600110d in g_closure_invoke ()

at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

16 0x00007ffff601405e in () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

17 0x00007ffff601c715 in g_signal_emit_valist ()

at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

18 0x00007ffff601d608 in g_signal_emit_by_name ()

at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

19 0x00007ffff761a736 in () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

20 0x00007ffff600110d in g_closure_invoke ()

at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

21 0x00007ffff601405e in () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

22 0x00007ffff601c715 in g_signal_emit_valist ()

at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

23 0x00007ffff601d608 in g_signal_emit_by_name ()

at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0

24 0x00007ffff7532d63 in () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

25 0x00007ffff7534af3 in gtk_selection_convert ()

at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

26 0x00007ffff761b06e in () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

27 0x00007ffff761bbb8 in () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

28 0x00007ffff74a58e3 in gtk_main_do_event ()

at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

29 0x00007ffff6fb6765 in () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0

---Type to continue, or q to quit---

30 0x00007ffff6fe6f92 in () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0

31 0x00007ffff5d26417 in g_main_context_dispatch ()

at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0

32 0x00007ffff5d26650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0

33 0x00007ffff5d266dc in g_main_context_iteration ()

at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0

34 0x00007ffff62e7efd in g_application_run ()

at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0

35 0x00005555555a0d38 in main ()

`

... and the same happens with B.Slizr

sjaehn commented 4 years ago

Just found and fixed the cause of the problem. Uninitialized buffer if GUI just switched on due to conditional call of lv2_atom_forge_set_buffer(). Silent bug in Carla, Ardour, jalv, and Qtracktor. Manifest bug in zrythm. Fixed in b6699edae0cfcffdcb9032f615d393fbfed59af5. New version 1.4.2 just published to enable use within zrythm.

B.Slizr and B.Jumblr will be fixed too.

alex-tee commented 4 years ago

nice! thanks, 1.4.2 works here too. closing the issue then