Sig fault 11-22

Heya, I recently decided to take a deep into VCV Rack API and ran into some problems. I follwed this guide 1:1 - VCV Manual - Plugin Development Tutorial and whilst loading the module library whole program crashes - full log dump Hastebin: Send and Save Text or Code Snippets for Free | Toptal® . I’ve looked around on the forum for possible fixes but neither of them really worked out for me. Someone reccomended me to build the plugin with symbols and debug it with gdb, if possible would like to know that as well. My SDK version is 2.0.6, VCV is at 2.0.6 plugin.json:

{
  "slug": "MyPlugin",
  "name": "MyPlugin",
  "version": "2.0.0",
  "license": "proprietary",
  "brand": "Haqz",
  "author": "Haqz",
  "authorEmail": "",
  "authorUrl": "",
  "pluginUrl": "",
  "manualUrl": "",
  "sourceUrl": "",
  "donateUrl": "",
  "changelogUrl": "",
  "modules": [
    {
      "slug": "MyModule",
      "name": "MyModule",
      "description": "",
      "tags": [
        "VCO"
      ]
    }
  ]
}

If something else is needed, let me know. Thanks in advance

That’s the besy way. Load the module into Rack within a GDB session, so when you get a crash, you can use the backtrace command to find where in the code the crash occurs.

Yes, but if you normally build with the SDK using make install, how do you do something similar, but with symbols? It looks like make install strips symbols.

I use make dist then manually copy the debug version (from the root folder, not the dist folder) to the plugin folder. If I’m doing a WiP (I’m on Windows) I use batch files to do this. I have different ones for different tasks, like one for updating the debug build, then starting Rack in a GDB session.

Couple questions regarding this, what exactly is the debug version, and how do i start Rack in GDB session?

After you’ve compiled a plugin with make dist you’ll end up with two versions. One is in the dist folder and is the one that most will use, this is known as the install version. It’s the same if you were to download the plugin from the VCV library. The other version is in the root folder, this is the larger file. This has the symbols left in (the dist version has them striped out) which is information added at compile time so that a debugger has access to identifiers in the code. This helps the debugger show where in the code the crash occurred.

On Windows GDB is started something like this: gdb --args Rack.exe -u [user folder] you can give a path to where Rack.exe is but I like to point my bash terminal to that folder before invoking GDB. I use aliases to do this at the command line.

debug version is the plugin.dll that is big (>20M) and has all the symbols. It will be right in your root folder of the plugin project.

copying to debug version on top of the install version sounds like a good trick. tx for that.

1 Like

That manifest looks ok. I have to confess I don’t know the answer, but I’ve never put in empty strings like that. Probably not it, but I’d try putting some dummy text in there like "foo" or omitting the blank entries. But, as I say, unlikely to be your issue.

Thanks for the help, i will check it out later!

Ok I’ve built it using make dist, copied the plugin.dll from root folder (which weighs ~2MB) and started gdb using provided command. GDB says there are no symbols. I’m also attaching my current code repo for further insight: GitHub - Haqz/VCV-TestPlugin

You can ignore this if GDB outputs: (No debugging symbols found in Rack.exe) as you’ll need a self-build of Rack itself.

Your plugin builds successfully, loads into Rack, displays in the module browser and can be added to an empty rack all without issue. No crashes.

May the crash happen becausei have too many plugins? Or something weird happens because i have so many of them?

Very doubtful, unless you’re using a VERY large patch and even then it’s super rare.

I have over 2900 modules in my library and don’t have this problem.

Surely bizzare problem, just to see if it’s something with my build, can you send your built version of my plugin?

I think it would be better if you gave me your debug build to see if there’s a difference. Post it as a ZIP file and attach it to an issue on your repo and I’ll have a look.

1 Like

I’ve also never seen configParam, configOutput, etc… with empty strings. Probably nothing… Actually, I guess helper generated that code, so it’s likely to be ok…

There you go: Sig Fault 11-22 zip · Issue #1 · Haqz/VCV-TestPlugin · GitHub

Using your debug build crashes the module browser:

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff939765990 in libRack!_ZN4rack6engine6Module10isBypassedEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
(gdb) bt
#0  0x00007ff939765990 in libRack!_ZN4rack6engine6Module10isBypassedEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#1  0x00007ff939737e92 in libRack!_ZN4rack3app17ModuleLightWidget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#2  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#3  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#4  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#5  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#6  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#7  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#8  0x00007ff93977136e in libRack!_ZN4rack2ui16SequentialLayout4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#9  0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#10 0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#11 0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#12 0x00007ff9397706a5 in libRack!_ZN4rack2ui12ScrollWidget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#13 0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#14 0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#15 0x00007ff9397780bc in libRack!_ZN4rack6widget6Widget4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#16 0x00007ff93977ac3b in libRack!_ZN4rack6window6Window4stepEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll
#17 0x00007ff93977b318 in libRack!_ZN4rack6window6Window3runEv () from /c/Program Files/VCV/Rack2 Pro/libRack.dll

Any idea why is that? I guess something in process of me building is borky but like i have no clue what I’ve done to make this happen, i followed the instructions in the tutorial