View Single Post
Old 09-27-2019, 05:25 PM   #381
ryukau
Human being with feelings
 
Join Date: Sep 2019
Posts: 4
Default VST3 plugin with GUI makes REAPER segfaults

This report is not related to REAPER. It was my fault.

https://forum.cockos.com/showpost.ph...&postcount=426

---

Hi.

I made a VST3 plugin and tested on REAPER v5.983. Without GUI the plugin runs nicely on my environment. But with GUI, REAPER segfaults when I try to load the plugin. On Windows, the plugin with GUI built from the same code runs nicely on REAPER and other DAWs.

Environment:
- Xubuntu 18.0.4
- REAPER v5.983
- VST3 SDK version is `vstsdk3613_08_04_2019_build_81`

Source code and debug build of plugin:
- https://drive.google.com/drive/folde...rpRm_BbY0XCWk6

Backtrace:
I used libSwell with debug flag on.

Code:
GNU gdb (Ubuntu 8.1-0ubuntu3.1) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../reaper...(no debugging symbols found)...done.
[New LWP 7697]
[New LWP 7703]
[New LWP 7699]
[New LWP 7702]
[New LWP 7708]
[New LWP 7704]
[New LWP 7705]
[New LWP 7700]
[New LWP 7701]
[New LWP 7698]
[New LWP 7709]
[New LWP 7707]
[New LWP 7706]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `../reaper'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f62ab3b89ec in std::__uniq_ptr_impl<VSTGUI::CView::Impl, std::default_delete<VSTGUI::CView::Impl> >::_M_ptr
    (this=0x10) at /usr/include/c++/7/bits/unique_ptr.h:147
147	      pointer    _M_ptr() const { return std::get<0>(_M_t); }
[Current thread is 1 (Thread 0x7f62fbbe3d00 (LWP 7697))]
#0  0x00007f62ab3b89ec in std::__uniq_ptr_impl<VSTGUI::CView::Impl, std::default_delete<VSTGUI::CView::Impl> >::_M_ptr() const (this=0x10) at /usr/include/c++/7/bits/unique_ptr.h:147
#1  0x00007f62ab3b6d42 in std::unique_ptr<VSTGUI::CView::Impl, std::default_delete<VSTGUI::CView::Impl> >::get() const (this=0x10) at /usr/include/c++/7/bits/unique_ptr.h:337
#2  0x00007f62ab3b5858 in std::unique_ptr<VSTGUI::CView::Impl, std::default_delete<VSTGUI::CView::Impl> >::operator->() const (this=0x10) at /usr/include/c++/7/bits/unique_ptr.h:331
#3  0x00007f62ab3b2990 in VSTGUI::CView::getViewSize() const (this=0x0)
    at /home/cu/code/vst/VST_SDK_debug/VST3_SDK/vstgui4/vstgui/lib/cview.cpp:731
#4  0x00007f62ab319514 in VSTGUI::CView::getHeight() const (this=0x0)
    at /home/cu/code/vst/VST_SDK_debug/VST3_SDK/vstgui4/vstgui/lib/cview.h:165
#5  0x00007f62ab347e0a in Steinberg::Vst::VSTGUIEditor::attached(void*, char const*) (this=
    0x2a2fb40, parent=0x4800348, type=0xaed21b "X11EmbedWindowID")
    at /home/cu/code/vst/VST_SDK_debug/VST3_SDK/public.sdk/source/vst/vstguieditor.cpp:174
        vr = {left = 3, top = -207, right = -10971, bottom = 192561344}
        platformType = VSTGUI::kDefaultNative
#6  0x000000000087c11e in  ()
#7  0x0000000000863f7d in  ()
#8  0x00000000006fb8bb in  ()
#9  0x0000000000702184 in  ()
#10 0x0000000000702f6b in  ()
#11 0x00007f62fa11620a in SWELL_CreateDialog(SWELL_DialogResourceIndex*, char const*, HWND__*, long (*)(HWND__*, unsigned int, unsigned long, long), long) (reshead=0xf10820, resid=0xbd <error: Cannot access memory at address 0xbd>, parent=0x0, dlgproc=0x702f20, param=44272608) at swell-dlg-generic.cpp:327
        hFoc = 0x0
        forceStyles = 0
        forceNonChild = false
        p = 0xf13320
        r = {left = 0, top = 0, right = 543, bottom = 351}
        owner = 0x2af6790
        h = 0x1e7af00
        rv = 0x2a38be0
#12 0x00000000006b84b1 in  ()
#13 0x00000000006fbef9 in  ()
#14 0x00000000006eb37d in  ()
#15 0x00000000006d7a51 in  ()
#16 0x00007f62fa107e8f in SwellDialogDefaultWindowProc(HWND__*, unsigned int, unsigned long, long) (hwnd=0x2764300, uMsg=273, wParam=1, lParam=0) at swell-wnd-generic.cpp:6616
        r = 140721277244480
        d = 0x6d0640
#17 0x00007f62fa0f2092 in SendMessage(HWND__*, unsigned int, unsigned long, long) (hwnd=0x2764300, msg=273, wParam=1, lParam=0) at swell-wnd-generic.cpp:307
        wp = 0x7f62fa107d8f <SwellDialogDefaultWindowProc(HWND__*, unsigned int, unsigned long, long)>
        ret = 40842064
#18 0x00000000006d44eb in  ()
#19 0x00007f62fa107e8f in SwellDialogDefaultWindowProc(HWND__*, unsigned int, unsigned long, long) (hwnd=0x2764300, uMsg=78, wParam=1071, lParam=140721277252240) at swell-wnd-generic.cpp:6616
        r = 0
        d = 0x6d0640
#20 0x00007f62fa0f2092 in SendMessage(HWND__*, unsigned int, unsigned long, long) (hwnd=0x2764300, msg=78, wParam=1071, lParam=140721277252240) at swell-wnd-generic.cpp:307
        wp = 0x7f62fa107d8f <SwellDialogDefaultWindowProc(HWND__*, unsigned int, unsigned long, long)>
        ret = 1168231104513
#21 0x00007f62fa0ff6ca in listViewWindowProc(HWND, UINT, WPARAM, LPARAM) (hwnd=0x26f3350, msg=515, wParam=0, lParam=458833) at swell-wnd-generic.cpp:4199
        nm = 
          {hdr = {hwndFrom = 0x26f3350, idFrom = 1071, code = 4294967293}, iItem = 0, iSubItem = 0, uNewState = 1, uOldState = 0, uChanged = 0, ptAction = {x = 0, y = 0}, lParam = 0}
        changed = false
        hdr_size = 0
        row_height = 19
        hit = 0
        subitem = 0
        r = {left = 0, top = 0, right = 584, bottom = 308}
        hdr_size_nomargin = 0
        n = 1
        totalw = 0
        ypos = 7
        lvs = 0x2ae77f0
        s_clickpt = {x = 81, y = 7}
#22 0x00007f62fa1241ce in SendMouseMessage(HWND, UINT, WPARAM, LPARAM) (hwnd=0x26f3350, msg=515, wParam=0, lParam=458833) at swell-generic-gdk.cpp:746
        htc = 1
        ret = 1
#23 0x00007f62fa12546a in OnButtonEvent(GdkEventButton*) (b=0x1e672c0) at swell-generic-gdk.cpp:1128
        hwnd = 0x2764300
        p = {x = 232, y = 30}
        hwnd2 = 0x26f3350
        p2 = {x = 81, y = 7}
        msg = 515
#24 0x00007f62fa126342 in swell_gdkEventHandler(GdkEvent*, gpointer) (evt=0x1e672c0, data=0x1)
    at swell-generic-gdk.cpp:1463
        oldEvt = 0x0
#25 0x00007f62fa12645d in SWELL_RunEvents() () at swell-generic-gdk.cpp:1518
        evt = 0x1e672c0
        ctx = 0x1e6ecc0
#26 0x00007f62fa0f33a1 in SWELL_RunMessageLoop() () at swell-wnd-generic.cpp:773
        now = 4402858
        lock = {m_m = 0x989680}
        rec = 0x0
#27 0x00000000004132d6 in  ()
#28 0x00007f62fa5a1b97 in __libc_start_main (main=
    0x4129f0, argc=1, argv=0x7ffc39be4ae8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc39be4ad8) at ../csu/libc-start.c:310
        result = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {0, 8040103607255459140, 4295168, 140721277258464, 0, 0, -8039948351159114428, -7975353381422996156}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7f62fb9ea733 <_dl_init+259>, 0x7f62fb5af370}, data = {prev = 0x0, cleanup = 0x0, canceltype = -73488589}}}
        not_first_call = <optimized out>
#29 0x0000000000418a2a in _start ()
I also tested example plugins with GUI included with VST3 SDK (again and noteexpressionsynth). Their GUI shows up and REAPER didn't crash. The example plugin uses VST3EditorDelegate class and the plugin I made uses VSTGUIEditor class for GUI.

I'm not sure this is caused by REAPER or VST3 SDK is doing something wrong. If this is not REAPER's bug I'll forward this report to VST3 SDK developers.

Last edited by ryukau; 01-19-2020 at 05:35 PM.
ryukau is offline   Reply With Quote