Open Boscop opened 8 years ago
More tests, this time they occur after loading a couple other VSTs before:
http://www.vst4free.com/free_vst.php?id=1342 "D:\VstPlugins\Distorque\Azurite.dll"
msvc debug output: Exception thrown at 0x6F5D346B (Azurite.dll) in vstscan.exe: 0xC0000005: Access violation reading location 0x70294700.
debugger shows this line as where it happens (again): https://github.com/Earlz/rust-dylib/blob/master/src/lib.rs#L369
http://www.acustica-audio.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=72&Itemid=53 "D:\VstPlugins\acustica\ACQUAVOX.dll"
msvc debug output: Exception thrown at 0x10143CDB (ACQUAVOX.dll) in vstscan.exe: 0xC0000005: Access violation reading location 0x70294700.
crash in same line as above, after FreeLibrary()
Electri-Q (posihfopit edition) http://www.pcjv.de/vst-plugins/eqs-filters/electri-q/
Exception thrown at 0x0055532D (Electri-Q (posihfopit edition).dll) in vstscan.exe: 0xC0000005: Access violation reading location 0x00000424.
msvc debugger points at this line: https://github.com/overdrivenpotato/rust-vst2/blob/master/src/host.rs#L433
Tone2 Firebird https://www.tone2.com/html/firebird%20vsti%20vst%20synthesizer%20plugin.html "D:\VstPlugins\Firebird\FireBird.dll"
'vstscan.exe' (Win32): Loaded 'D:\VstPlugins\Firebird\FireBird.dll'. Module was built without symbols. 'vstscan.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file. 'vstscan.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 'vstscan.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file. 'vstscan.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file. Exception thrown at 0x100653CD (FireBird.dll) in vstscan.exe: 0xC0000005: Access violation writing location 0x00000000.
The program '[23456] vstscan.exe' has exited with code 0 (0x0).
msvc debugger points to: https://github.com/Earlz/rust-dylib/blob/master/src/lib.rs#L311
Can anyone reproduce this behavior? I'd also be interested in whether the scanner works on your system even if it's not windows :)
So I tried testing this out with the plugins that have 64bit versions:
Running `target\debug\examples\host2.exe`
loading kern.dll
Info { name: "Kern", vendor: "Bjoern Arlt @ Full Bucket Music", presets: 64, parameters: 32, inputs: 0, outputs: 2, unique_id: 1801810542, version: 1, category: Synth, initial_delay: 0, preset_chunks: false, f64_precision: true, silent_when_stopped: false }
loading 4Front Piano.dll
Info { name: "4Front Piano Module", vendor: "4Front", presets: 1, parameters: 0, inputs: 0, outputs: 2, unique_id: 877023310, version: 65792, category: Synth, initial_delay: 0, preset_chunks: true, f64_precision: false, silent_when_stopped: false }
loading 4Front R-Piano.dll
Info { name: "4Front R-Piano", vendor: "4Front Technologies", presets: 1, parameters: 13, inputs: 0, outputs: 2, unique_id: 877019954, version: 131072, category: Synth, initial_delay: 0, preset_chunks: true, f64_precision: false, silent_when_stopped: false }
loading Azurite.dll
Info { name: "Azurite", vendor: "Distorque", presets: 27, parameters: 19, inputs: 2, outputs: 2, unique_id: 1146175834, version: 1, category: Unknown, initial_delay: 0, preset_chunks: false, f64_precision: false, silent_when_stopped: false }
thread 'main' panicked at 'Error code 6', C:\Users\IEUser\.cargo\git\checkouts\rust-dylib-8d2b52a5c98ae95d\master\src\lib.rs:37
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: Process didn't exit successfully: `target\debug\examples\host2.exe` (exit code: 101)
It seems that Azurite crashes upon unloading due to ERROR_INVALID_HANDLE
. I'll do some testing on OSX but I'm not sure how to approach this issue, I'd like to avoid leaking plugins if possible.
EDIT: These tests were run with the default rustup install on Win10, perhaps the results differ with msvc
?
I was writing a VST scanner that goes over all VSTs in my VST folder and calls get_info() on them. Btw, all my VSTs are Win32 and mostly free ones. After my scanner has processed a couple of VSTs, it crashes on some VSTs, but not always the same one on different runs. Also the way it crashes is different. Sometimes I get
thread panicked at 'Error code 126'
(ERROR_MOD_NOT_FOUND
), sometimes I getthread panicked at 'Error code 1411'
upon unloading (which isERROR_CLASS_DOES_NOT_EXIST
according to MSDN). It looks like these are maybe 2 different problems: One that occurs directly when loading a plugin (error 126), and one that only occurs after loading and unloading a couple of plugins, and then it occurs when unloading another plugin (but it happens on different plugins on different runs). The second problem seems to be related to the way plugins are unloaded. E.g. the access violation happened on line 959 (right after FreeLibrary) here: http://pastebin.com/NQpUd3sm Sometimes it freezes (like in an infinite loop), sometimes I get an access violation right after FreeLibrary on the plugin was called. (When it's frozen / in an infinite loop and I kill it, it's still visible in process explorer as suspended. Probably until I reboot. (So now I have like 12 instances there.)) (I then changed my scanner code to start a new thread for loading each VST but it didn't change the behavior.)Below are some tests I did with free VSTs, you can download the VSTs if you want to reproduce this: http://www.fullbucket.de/music/kern.html (the version on vst4free is an older one.) http://www.acoustica.com/plugins/vst-directx.htm or http://www.vst4free.com/free_vst.php?plugin=Classic_Auto-Filter&id=505 (not sure if it's the same version as in the installer. I used the installer) http://www.yohng.com/software/piano.html http://www.yohng.com/software/rpiano.html
All tests are done with the win32 version of these VSTs. All of these VSTs have been tested with common DAWs like Ableton Live, Reaper and VSThost and they work.
This is the line referenced in the error output: https://github.com/Earlz/rust-dylib/blob/master/src/lib.rs#L37