Open alex-tee opened 3 years ago
note that it works with jalv.gtk3
Given that a number of things have changed in the UI side, is different behavior observed with the 3.0.6-rc1 version?
I have no idea sorry, it's way too complex to build on Guix
On 01-22, alex-tee wrote:
I have no idea sorry, it's way too complex to build on Guix
100% fair. If I'm able to provide an updated libzest.so would you be good with testing it out? It should hopefully be sufficient to swap out the existing one.
Zyn is using a very old version of DPF which is in the main plugin library, but all of the drawing is in the dynamically loaded libzest.so library. Knowing which side might be responsible for the issue could narrow things down slightly.
I think the last time this issue came up on IRC (or perhaps discord?) my stance was that it was likely a host issue with regards to setting up a usable OpenGL context for which the plugin's UI callbacks to run within.
I'm not on guix anymore so I built the latest version the provided script and the UI shows properly now! however it still crashes when suil calls cleanup() on the LV2 descriptor:
[INFO:Zyn] zest_close()
[INFO] Closing MRuby Application...
Thread 1 "zrythm" received signal SIGSEGV, Segmentation fault.
br_destroy_schema (sch=...) at src/schema.c:59
59 free(sch.handles[i].opts->ids);
(gdb) bt
#0 br_destroy_schema (sch=...) at src/schema.c:59
#1 0x00007fffb41c035f in mrb_remote_free (mrb=<optimized out>, ptr=0x55558a3e96a0) at /home/alex/Documents/git/zyn-fusion-build/mruby-zest-build/src/mruby-widget-lib/src/gem.c:416
#2 0x00007fffb414274b in obj_free (end=1, obj=0x55558a4220e0, mrb=0x55558a3a99a0) at /home/alex/Documents/git/zyn-fusion-build/mruby-zest-build/mruby/src/gc.c:894
#3 free_heap (gc=<optimized out>, gc=<optimized out>, mrb=0x55558a3a99a0) at /home/alex/Documents/git/zyn-fusion-build/mruby-zest-build/mruby/src/gc.c:434
#4 mrb_gc_destroy (mrb=0x55558a3a99a0, gc=0x55558a3a9a58) at /home/alex/Documents/git/zyn-fusion-build/mruby-zest-build/mruby/src/gc.c:443
#5 0x00007fffb4154ff2 in mrb_close (mrb=0x55558a3a99a0) at /home/alex/Documents/git/zyn-fusion-build/mruby-zest-build/mruby/src/state.c:194
#6 0x00007fffb41c1779 in zest_close (z=0x55558a328700) at /home/alex/Documents/git/zyn-fusion-build/mruby-zest-build/src/mruby-widget-lib/src/api.c:220
#7 0x00007fffd846889d in ZynAddSubFXUI::~ZynAddSubFXUI() () at /home/alex/local/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so
#8 0x00007fffd84672b1 in DISTRHO::lv2ui_cleanup(void*) () at /home/alex/local/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so
#9 0x0000555555dec72b in on_plug_removed (sock=0x5555894aed80, data=0x0) at ../src/plugins/lv2/suil/x11_in_gtk3.c:108
some more debug info:
(gdb) p sch
$1 = {
json = <optimized out>,
handles = 0x55558a5206c0,
elements = 1138
}
(gdb) p sch.handles
$2 = (schema_handle_t *) 0x55558a5206c0
(gdb) p sch.handles[i]
$3 = {
flag = 0,
opts = 0xffffffea,
pattern = 0x55558a4086c0 "/part[0,15]/kit[0,15]/padpars/FreqLfo/PLFOtype",
name = 0x55558a475850 "PLFOtype",
short_name = 0x55558a408700 "type",
units = 0x0,
documentation = 0x55558a4758c0 "Shape of LFO",
scale = 0x0,
default_ = 0x55558a475cb0 "sine",
type = 105 'i',
value_min = 0,
value_max = 0
}
(gdb) p sch.handles[i].opts
$4 = (opt_t *) 0xffffffea
(gdb) p sch.handles[i].opts->
ids labels num_opts
(gdb) p sch.handles[i].opts->ids
Cannot access memory at address 0xffffffea
this is all I get from valgrind:
==387085== Invalid read of size 8
==387085== at 0x69F691D7: br_destroy_schema (schema.c:59)
==387085== by 0x69F0F35E: mrb_remote_free (gem.c:416)
==387085== by 0x69E9174A: obj_free (gc.c:894)
==387085== by 0x69E9174A: free_heap (gc.c:434)
==387085== by 0x69E9174A: mrb_gc_destroy (gc.c:443)
==387085== by 0x69EA3FF1: mrb_close (state.c:194)
==387085== by 0x69F10778: zest_close (api.c:220)
==387085== by 0x571E989C: ZynAddSubFXUI::~ZynAddSubFXUI() (in /home/alex/local/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so)
==387085== by 0x571E82B0: DISTRHO::lv2ui_cleanup(void*) (in /home/alex/local/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so)
==387085== by 0x9A072A: on_plug_removed (x11_in_gtk3.c:108)
==387085== by 0x48F4036: ??? (in /usr/lib/libgtk-3.so.0.2404.22)
==387085== by 0x5491071: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.6600.7)
==387085== by 0x54B9A84: ??? (in /usr/lib/libgobject-2.0.so.0.6600.7)
==387085== by 0x54ACC0A: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.6600.7)
==387085== Address 0xffffffea is not stack'd, malloc'd or (recently) free'd
Hm. I was hoping to clean this up by essentially allowing multiple free calls going into br_destroy_schema(). I might still end up doing that, but the old code is pass by value, so that doesn't quite work as I intended. I guess I've got to setup Zrythm at some point to replicate the behavior. I'm guessing it's an easy fix. No idea why obj_free() appears to be called multiple times though on the same object.
Zrythm does not appear to run properly on my system after building from source. Something about a GLib-GIO-ERROR, I'll leave this issue for someone else to resolve as I really don't want to be battling with gtk errors.
should I send you a precompiled package (that includes debug symbols)? what distro do you use?
I'm running Slackware-current on my primary development machine. I'm not sure that a precompiled fully solves the issue as I suspect the problem may be on the host side (given that the bug is not exhibited in the same way with other hosts). If it's precompiled I can't effectively inspect and modify host behavior to resolve the issue if it isn't clearly on zyn's side.
the UI looks like this in Zrythm:
I'm on GuixSD but users report the same issue on various distros.
below is the backtrace when the plugin crashes when the window is closed
version: 3.0.5