abique / vst-bridge

VST bridge for Windows vst on Linux
MIT License
273 stars 19 forks source link

Doesn't work with Bitwig Studio… #11

Closed michalrus closed 10 years ago

michalrus commented 10 years ago

Hey,

today, I was trying out Ivory plugin using vst-bridge and it works well in Ardour3. Thank you! :heart:

However, in Bitwig Studio 1.0.4, when it is scanning its Plug-in Locations, the following happens:

m@arch:~$ bitwig-studio 
JRE Path: //opt/bitwig-studio/bin/jre
Sep 12, 2014 11:53:55 AM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
com.bitwig.flt.library.metadata.reader.exception.CouldNotReadMetadataException: could not read metadata: com.bitwig.flt.library.metadata.reader.exception.CouldNotReadMetadataException: could not read metadata: Could not read VST plug-in metadata
64 bit plugin host reported errors: Pluginhost returned non zero exit code 134
Error messages:

fixme:ntdll:FILE_CreateFile L GENERIC_xxx_ACCESS
fixme:ntdll:FILE_CreateFile L GENERIC_xxx_ACCESS
fixme:ntdll:FILE_CreateFile L GENERIC_xxx_ACCESS

Other messages:

Printing plug-in meta data for /home/m/.vst-bridges/ivory.so ...

32 bit plugin host reported errors: Pluginhost returned non zero exit code 255

Other messages:

Printing plug-in meta data for /home/m/.vst-bridges/ivory.so ...

Exception Thrown:Failed to load VST plug-in //home/m/.vst-bridges/ivory.so: //home/m/.vst-bridges/ivory.so: wrong ELF class: ELFCLASS64
        at cjB.b(SourceFile:139)
        at cjF.a(SourceFile:209)
        at cjF.b(SourceFile:19)
        at cjP.a(SourceFile:42)
        at cjP.b(SourceFile:16)
        at cjH.b(SourceFile:24)
        at chK.a(SourceFile:390)
        at chK.b(SourceFile:409)
        at chK.a(SourceFile:566)
        at chK.b(SourceFile:359)
        at chK.a(SourceFile:334)
        at chK.a(SourceFile:220)
        at cga.run(SourceFile:26)
Caused by: java.io.IOException: com.bitwig.flt.library.metadata.reader.exception.CouldNotReadMetadataException: could not read metadata: Could not read VST plug-in metadata

I've ./configure'd with --debug switch. There's no /tmp/vst-*.log file created.

Not at all related, but maybe you'll care: I've added vst-bridge-git to AUR (→ PKGBUILD).

abique commented 10 years ago

Hi Michalrus, Thanks for your feedback. Why don't you upgrade Bitwig? They fixed some bugs over time.

michalrus commented 10 years ago

Haha, please, disregard this issue. I don't believe I did this… =P

Too little sleep, I guess.

(Can't close it because replying on the phone.)

abique commented 10 years ago

OK, then I close ;-) BTW, thanks for the AUR package :)

michalrus commented 10 years ago

Okay, so on 1.0.13, when scanning for new plugins (and rescanning just ivory.so), Bitwig outputs these to its stderr:

*** buffer overflow detected ***: /opt/bitwig-studio/bin/BitwigPluginHost64 terminated
======= Backtrace: =========
/usr/lib/libc.so.6(+0x73f8e)[0x7f35e99dff8e]
/usr/lib/libc.so.6(__fortify_fail+0x37)[0x7f35e9a65e57]
/usr/lib/libc.so.6(+0xf7f60)[0x7f35e9a63f60]
//home/m/.vst-bridges/ivory.so(_Z34vst_bridge_call_effect_dispatcher2P7AEffectiilPvf+0x93e)[0x7f35e8e4438e]
//home/m/.vst-bridges/ivory.so(_Z33vst_bridge_call_effect_dispatcherP7AEffectiilPvf+0x5e)[0x7f35e8e444ae]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x40ac1d]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x41fad6]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x42bd7f]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x405911]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f35e998c000]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x4066dd]

Also, at the same time Wine Windows Program Loader shows a message box:

              Wine program crash
Internal errors - invalid parameters received
                     [OK]

@abique, how do I debug this next? Is the _Z34vst_bridge_call_effect_dispatcher2P7AEffectiilPvf+0x93e symbol useful enough?

abique commented 10 years ago

Can you try with an u-he plugin? That was those that I tried.

michalrus commented 10 years ago

@abique, exactly same thing happens with Diva.so… The buffer overflow happens in Diva.so, not in host.exe:

m@arch:~$ bitwig-studio
JRE Path: //opt/bitwig-studio/bin/jre
Sep 13, 2014 1:17:51 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "/tmp/vfs_cache" as temporary files store.
*** buffer overflow detected ***: /opt/bitwig-studio/bin/BitwigPluginHost64 terminated
======= Backtrace: =========
/usr/lib/libc.so.6(+0x73f8e)[0x7f1e004eef8e]
/usr/lib/libc.so.6(__fortify_fail+0x37)[0x7f1e00574e57]
/usr/lib/libc.so.6(+0xf7f60)[0x7f1e00572f60]
//home/m/.vst-bridges/Diva.so(_Z34vst_bridge_call_effect_dispatcher2P7AEffectiilPvf+0x93e)[0x7f1dff95338e]
//home/m/.vst-bridges/Diva.so(_Z33vst_bridge_call_effect_dispatcherP7AEffectiilPvf+0x5e)[0x7f1dff9534ae]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x40ac1d]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x41fad6]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x42bd7f]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x405911]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f1e0049b000]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x4066dd]
======= Memory map: ========
00400000-0043d000 r-xp 00000000 fe:01 1457510                            /opt/bitwig-studio/bin/BitwigPluginHost64
...

On Bitwig Studio 1.0.13 and using 73835777b05e62b9a07f380f03d4493d8b27e488 (current HEAD and xembed) of vst-bridge.

Which exactly plugin works for you with 1.0.13 and 73835777b05e62b9a07f380f03d4493d8b27e488?

Another thing is, I'm using VST SDK 3, you can no longer download 2.4 from Steinberg's website, I think…

michalrus commented 10 years ago

A better (more modular) way to test this:

m@arch:~$ pacman -Q | grep -E 'vst|bitwig'
bitwig-studio 1.0.13-1
vst-bridge-git 0.3.r32.g7383577-1

m@arch:~$ vst-bridge-maker ~/.wine/drive_c/Program\ Files\ \(x86\)/Steinberg/VSTPlugins/u-he/Diva/Diva.dll ~/.vst-bridges/Diva.so
detected 32 bits dll

m@arch:~$ ls ~/.vst-bridges/
Diva.so

m@arch:~$ /opt/bitwig-studio/bin/BitwigPluginHost64 test ~/.vst-bridges/Diva.so

--------------------------------------------------------------------

Testing plugin /home/m/.vst-bridges/Diva.so
Successfully set thread realtime priority to 20
Creating plug-in instance
Waiting for reply...
C:\users\m\Desktop\/Diva.log
no deskTopFile found
fixme:shell:IShellLinkW_fnGetPath (0x128d38): WIN32_FIND_DATA is not yet filled.
fixme:shell:IShellLinkW_fnGetPath (0x128e98): WIN32_FIND_DATA is not yet filled.
fixme:shell:IShellLinkW_fnGetPath (0x128e98): WIN32_FIND_DATA is not yet filled.
fixme:shell:IShellLinkW_fnGetPath (0x128e98): WIN32_FIND_DATA is not yet filled.
fixme:shell:IShellLinkW_fnGetPath (0x128e98): WIN32_FIND_DATA is not yet filled.
fixme:shell:IShellLinkW_fnGetPath (0x12bdf8): WIN32_FIND_DATA is not yet filled.
*** buffer overflow detected ***: /opt/bitwig-studio/bin/BitwigPluginHost64 terminated
======= Backtrace: =========
/usr/lib/libc.so.6(+0x73f8e)[0x7fa705a56f8e]
/usr/lib/libc.so.6(__fortify_fail+0x37)[0x7fa705adce57]
/usr/lib/libc.so.6(+0xf7f60)[0x7fa705adaf60]
//home/m/.vst-bridges/Diva.so(_Z34vst_bridge_call_effect_dispatcher2P7AEffectiilPvf+0x93e)[0x7fa7036b838e]
//home/m/.vst-bridges/Diva.so(_Z33vst_bridge_call_effect_dispatcherP7AEffectiilPvf+0x5e)[0x7fa7036b84ae]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x40ac1d]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x41fad6]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x42021f]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x413443]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x405751]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7fa705a03000]
/opt/bitwig-studio/bin/BitwigPluginHost64[0x4066dd]
======= Memory map: ========
00400000-0043d000 r-xp 00000000 fe:01 1457510                            /opt/bitwig-studio/bin/BitwigPluginHost64
0063d000-00641000 r--p 0003d000 fe:01 1457510                            /opt/bitwig-studio/bin/BitwigPluginHost64
00641000-00642000 rw-p 00041000 fe:01 1457510                            /opt/bitwig-studio/bin/BitwigPluginHost64
00bd4000-00c16000 rw-p 00000000 00:00 0                                  [heap]
7fa6f4000000-7fa6f4021000 rw-p 00000000 00:00 0
7fa6f4021000-7fa6f8000000 ---p 00000000 00:00 0
7fa6fc000000-7fa6fc021000 rw-p 00000000 00:00 0
7fa6fc021000-7fa700000000 ---p 00000000 00:00 0
7fa703170000-7fa703172000 r-xp 00000000 fe:01 940579                     /usr/lib/libXcomposite.so.1.0.0
7fa703172000-7fa703371000 ---p 00002000 fe:01 940579                     /usr/lib/libXcomposite.so.1.0.0
7fa703371000-7fa703372000 r--p 00001000 fe:01 940579                     /usr/lib/libXcomposite.so.1.0.0
7fa703372000-7fa703373000 rw-p 00002000 fe:01 940579                     /usr/lib/libXcomposite.so.1.0.0
7fa703373000-7fa7034ae000 r-xp 00000000 fe:01 939515                     /usr/lib/libX11.so.6.3.0
7fa7034ae000-7fa7036ad000 ---p 0013b000 fe:01 939515                     /usr/lib/libX11.so.6.3.0
7fa7036ad000-7fa7036af000 r--p 0013a000 fe:01 939515                     /usr/lib/libX11.so.6.3.0
7fa7036af000-7fa7036b4000 rw-p 0013c000 fe:01 939515                     /usr/lib/libX11.so.6.3.0
7fa7036b4000-7fa7036b5000 rw-p 00000000 00:00 0
7fa7036b5000-7fa7036bc000 r-xp 00000000 fe:03 17830985                   /home/m/.vst-bridges/Diva.so
7fa7036bc000-7fa7038bb000 ---p 00007000 fe:03 17830985                   /home/m/.vst-bridges/Diva.so
7fa7038bb000-7fa7038bc000 rw-p 00006000 fe:03 17830985                   /home/m/.vst-bridges/Diva.so
7fa7038bc000-7fa7038bd000 ---p 00000000 00:00 0
7fa7038bd000-7fa7040bd000 rw-p 00000000 00:00 0                          [stack:32110]
7fa7040bd000-7fa7040be000 ---p 00000000 00:00 0
7fa7040be000-7fa7048be000 rw-p 00000000 00:00 0                          [stack:32109]
7fa7048be000-7fa7048bf000 ---p 00000000 00:00 0
7fa7048bf000-7fa7050bf000 rw-p 00000000 00:00 0                          [stack:32108]
7fa7050bf000-7fa7050c4000 r-xp 00000000 fe:01 936324                     /usr/lib/libXdmcp.so.6.0.0
7fa7050c4000-7fa7052c3000 ---p 00005000 fe:01 936324                     /usr/lib/libXdmcp.so.6.0.0
7fa7052c3000-7fa7052c4000 r--p 00004000 fe:01 936324                     /usr/lib/libXdmcp.so.6.0.0
7fa7052c4000-7fa7052c5000 rw-p 00005000 fe:01 936324                     /usr/lib/libXdmcp.so.6.0.0
7fa7052c5000-7fa7052c7000 r-xp 00000000 fe:01 936326                     /usr/lib/libXau.so.6.0.0
7fa7052c7000-7fa7054c7000 ---p 00002000 fe:01 936326                     /usr/lib/libXau.so.6.0.0
7fa7054c7000-7fa7054c8000 r--p 00002000 fe:01 936326                     /usr/lib/libXau.so.6.0.0
7fa7054c8000-7fa7054c9000 rw-p 00003000 fe:01 936326                     /usr/lib/libXau.so.6.0.0
7fa7054c9000-7fa7055cc000 r-xp 00000000 fe:01 918948                     /usr/lib/libm-2.19.so
7fa7055cc000-7fa7057cb000 ---p 00103000 fe:01 918948                     /usr/lib/libm-2.19.so
7fa7057cb000-7fa7057cc000 r--p 00102000 fe:01 918948                     /usr/lib/libm-2.19.so
7fa7057cc000-7fa7057cd000 rw-p 00103000 fe:01 918948                     /usr/lib/libm-2.19.so
7fa7057cd000-7fa7057e3000 r-xp 00000000 fe:01 922266                     /usr/lib/libgcc_s.so.1
7fa7057e3000-7fa7059e2000 ---p 00016000 fe:01 922266                     /usr/lib/libgcc_s.so.1
7fa7059e2000-7fa7059e3000 rw-p 00015000 fe:01 922266                     /usr/lib/libgcc_s.so.1
7fa7059e3000-7fa705b87000 r-xp 00000000 fe:01 918992                     /usr/lib/libc-2.19.so
7fa705b87000-7fa705d87000 ---p 001a4000 fe:01 918992                     /usr/lib/libc-2.19.so
7fa705d87000-7fa705d8b000 r--p 001a4000 fe:01 918992                     /usr/lib/libc-2.19.so
7fa705d8b000-7fa705d8d000 rw-p 001a8000 fe:01 918992                     /usr/lib/libc-2.19.so
7fa705d8d000-7fa705d91000 rw-p 00000000 00:00 0
7fa705d91000-7fa705da9000 r-xp 00000000 fe:01 919007                     /usr/lib/libpthread-2.19.so
7fa705da9000-7fa705fa9000 ---p 00018000 fe:01 919007                     /usr/lib/libpthread-2.19.so
7fa705fa9000-7fa705faa000 r--p 00018000 fe:01 919007                     /usr/lib/libpthread-2.19.so
7fa705faa000-7fa705fab000 rw-p 00019000 fe:01 919007                     /usr/lib/libpthread-2.19.so
7fa705fab000-7fa705faf000 rw-p 00000000 00:00 0
7fa705faf000-7fa70609f000 r-xp 00000000 fe:01 922276                     /usr/lib/libstdc++.so.6.0.20
7fa70609f000-7fa70629f000 ---p 000f0000 fe:01 922276                     /usr/lib/libstdc++.so.6.0.20
7fa70629f000-7fa7062a7000 r--p 000f0000 fe:01 922276                     /usr/lib/libstdc++.so.6.0.20
7fa7062a7000-7fa7062a9000 rw-p 000f8000 fe:01 922276                     /usr/lib/libstdc++.so.6.0.20
7fa7062a9000-7fa7062be000 rw-p 00000000 00:00 0
7fa7062be000-7fa7062c1000 r-xp 00000000 fe:01 918957                     /usr/lib/libdl-2.19.so
7fa7062c1000-7fa7064c0000 ---p 00003000 fe:01 918957                     /usr/lib/libdl-2.19.so
7fa7064c0000-7fa7064c1000 r--p 00002000 fe:01 918957                     /usr/lib/libdl-2.19.so
7fa7064c1000-7fa7064c2000 rw-p 00003000 fe:01 918957                     /usr/lib/libdl-2.19.so
7fa7064c2000-7fa7064c9000 r-xp 00000000 fe:01 918986                     /usr/lib/librt-2.19.so
7fa7064c9000-7fa7066c8000 ---p 00007000 fe:01 918986                     /usr/lib/librt-2.19.so
7fa7066c8000-7fa7066c9000 r--p 00006000 fe:01 918986                     /usr/lib/librt-2.19.so
7fa7066c9000-7fa7066ca000 rw-p 00007000 fe:01 918986                     /usr/lib/librt-2.19.so
7fa7066ca000-7fa7066eb000 r-xp 00000000 fe:01 938616                     /usr/lib/libxcb.so.1.1.0
7fa7066eb000-7fa7068ea000 ---p 00021000 fe:01 938616                     /usr/lib/libxcb.so.1.1.0
7fa7068ea000-7fa7068eb000 r--p 00020000 fe:01 938616                     /usr/lib/libxcb.so.1.1.0
7fa7068eb000-7fa7068ec000 rw-p 00021000 fe:01 938616                     /usr/lib/libxcb.so.1.1.0
7fa7068ec000-7fa7068f0000 r-xp 00000000 fe:01 953752                     /usr/lib/libxcb-icccm.so.4.0.0
7fa7068f0000-7fa706aef000 ---p 00004000 fe:01 953752                     /usr/lib/libxcb-icccm.so.4.0.0
7fa706aef000-7fa706af0000 r--p 00003000 fe:01 953752                     /usr/lib/libxcb-icccm.so.4.0.0
7fa706af0000-7fa706af1000 rw-p 00004000 fe:01 953752                     /usr/lib/libxcb-icccm.so.4.0.0
7fa706af1000-7fa706b12000 r-xp 00000000 fe:01 918976                     /usr/lib/ld-2.19.so
7fa706cda000-7fa706ce3000 rw-p 00000000 00:00 0
7fa706d0f000-7fa706d11000 rw-p 00000000 00:00 0
7fa706d11000-7fa706d12000 r--p 00020000 fe:01 918976                     /usr/lib/ld-2.19.so
7fa706d12000-7fa706d13000 rw-p 00021000 fe:01 918976                     /usr/lib/ld-2.19.so
7fa706d13000-7fa706d14000 rw-p 00000000 00:00 0
7fff65429000-7fff65452000 rw-p 00000000 00:00 0                          [stack]
7fff655c5000-7fff655c7000 r-xp 00000000 00:00 0                          [vdso]
7fff655c7000-7fff655c9000 r--p 00000000 00:00 0                          [vvar]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Remote plugin process died on a different thread to the main thread: End of stream
Could not test plug-in: Plugin host died: End of stream
Passed plugins:

Failed plugins:

    /home/m/.vst-bridges/Diva.so:      Plugin host died: End of stream

Passed : 0 Failed: 1
m@arch:~$

This is a clean WINEPREFIX with just Diva installed.

abique commented 10 years ago

Interesting I'll have a look. Le 13 sept. 2014 13:24, "Michal Rus" notifications@github.com a écrit :

@abique https://github.com/abique, exactly same thing happens with Diva.so… The buffer overflow happens in Diva.so, not in host.exe:

m@arch:~$ bitwig-studio JRE Path: //opt/bitwig-studio/bin/jre Sep 13, 2014 1:17:51 PM org.apache.commons.vfs2.VfsLog info INFO: Using "/tmp/vfs_cache" as temporary files store. * buffer overflow detected *: /opt/bitwig-studio/bin/BitwigPluginHost64 terminated ======= Backtrace: ========= /usr/lib/libc.so.6(+0x73f8e)[0x7f1e004eef8e] /usr/lib/libc.so.6(__fortify_fail+0x37)[0x7f1e00574e57] /usr/lib/libc.so.6(+0xf7f60)[0x7f1e00572f60] //home/m/.vst-bridges/Diva.so(_Z34vst_bridge_call_effect_dispatcher2P7AEffectiilPvf+0x93e)[0x7f1dff95338e] //home/m/.vst-bridges/Diva.so(_Z33vst_bridge_call_effect_dispatcherP7AEffectiilPvf+0x5e)[0x7f1dff9534ae] /opt/bitwig-studio/bin/BitwigPluginHost64[0x40ac1d] /opt/bitwig-studio/bin/BitwigPluginHost64[0x41fad6] /opt/bitwig-studio/bin/BitwigPluginHost64[0x42bd7f] /opt/bitwig-studio/bin/BitwigPluginHost64[0x405911] /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f1e0049b000] /opt/bitwig-studio/bin/BitwigPluginHost64[0x4066dd] ======= Memory map: ======== 00400000-0043d000 r-xp 00000000 fe:01 1457510 /opt/bitwig-studio/bin/BitwigPluginHost64 ...

On Bitwig Studio 1.0.13 and using 7383577 https://github.com/abique/vst-bridge/commit/73835777b05e62b9a07f380f03d4493d8b27e488 (current HEAD and xembed) of vst-bridge.

— Reply to this email directly or view it on GitHub https://github.com/abique/vst-bridge/issues/11#issuecomment-55491076.

michalrus commented 10 years ago

@abique, great to hear that! =)

If you use $ /opt/bitwig-studio/bin/BitwigPluginHost64 test ~/.vst-bridges/Diva.so, you'll probably be able to attach gdb/strace/….

michalrus commented 10 years ago

@abique, got it. makepkg sets these (defined in /etc/makepkg.conf):

CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"

So, after adding the following to the PKGBUILD:

unset CPPFLAGS
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS

… everything works. =)

(You might consider allowing reporters to reopen issues. This one has been closed all this time.)

abique commented 10 years ago

Hey michalrus! Good catch! I didn't know that there was a setting to re-open. I'm going to change that.