Windows build toolchain issue

Hi All,

I’m trying to build a plugin for Windows using the standard MingW toolchain on Ubuntu bionic. Rack crashes once the plugin declares an ifstream (works fine in Linux and Mac version). Commenting the declaration makes the plugin work. It seems I’m hitting some type of bug in the toolchain or something that is build environment specific as a plugin that uses ifstream in the plugin library (such as STS MIDI) runs fine with the library copy but crashes with my build. Does anyone know what is the exact VCV plugin library build environment (What Linux distro+version and x86_64-w64-mingw32 toolchain version)? Does it use the standard Rack-SDK available for download?

Linux is Ubuntu 16.04 or Arch Linux, like is says in the manual. But that doesn’t have much to do with mingw and windows…

Right now I have mingw gcc 7.3.0 installed, but that’s a couple years old so I’ve upgraded to gcc 9.3.0 TYPO, 9.2.0.

However, 7.3.0 is still several years after C++11 support was completed, so the problem might be your own code like undefined behavior. Post the line?

	void load(const std::string &file)
		// std::vector<std::vector<int>> fx;
		std::ifstream infile;
		// std::stringstream stream;

This is really odd. I’ve removed everything from this function other than the line declaring the ifstream. Once I load the plugin in Windows it crashes with the following in the log:

[4.473 info src/FV1EmuVCVPlugIn.cpp:77] BEFORELOAD
[4.473 info src/FV1emu.hpp:341] LOAD1
[5.085 fatal src/main.cpp:45] Fatal signal 11. Stack trace:
37:  0x0
36:  0x0
35: __C_specific_handler 0x7bcc15d0
34: RtlVirtualUnwind 0x7bcbe7b0
33: RtlVirtualUnwind 0x7bcbe7b0
32: NtRaiseException 0x7bcc0570
31: raise_func_trampoline 0x7bcb9a58
30: EntryPoint 0x9a1330
29: EntryPoint 0x9a1330
28: EntryPoint 0x9a1330
27: EntryPoint 0x9a1330
26: EntryPoint 0x9a1330
25: EntryPoint 0x9a1330
24: EntryPoint 0x9a1330
23: EntryPoint 0x9a1330
22: EntryPoint 0x9a1330
21: EntryPoint 0x9a1330
20: EntryPoint 0x9a1330
19: EntryPoint 0x9a1330
18: EntryPoint 0x9a1330
17: EntryPoint 0x9a1330
16: EntryPoint 0x9a1330
15: EntryPoint 0x9a1330
14: EntryPoint 0x9a1330
13: EntryPoint 0x9a1330

As you can see, the function is entered and crashes after the ifstream declaration. Everything else is removed or commented out. This works fine in both Linux and Mac native builds.