|
08-28-2013, 05:51 AM
|
#1
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
Plugin wont open in host!
Hi there! My plugin builds fine, but doesnt appear when i drag it into vsthost. When i debug it i get this error:
First-chance exception at 0x66810583 (ISTest.dll) in vsthost.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x7613c41f in vsthost.exe: Microsoft C++ exception: CSEHException at memory location 0x00170bc4..
I googled this error and it seems to be a pointer or something that isnt initialized..
Have you got any tips at how i can debug this effectively? I have no idea where to start in the code, so i really just need a way of systematically trying things out to find the problem. How would you do it?
Thanks!
|
|
|
08-28-2013, 07:52 PM
|
#2
|
Human being with feelings
Join Date: Sep 2009
Posts: 623
|
I'd compile a debug version and step through it to see what causes it to crash.
|
|
|
08-29-2013, 02:19 AM
|
#3
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
But thats what i did and thats the error message i get.... I just dont know what to do from here. The error is nothing like a syntax error, where it just says "oh yeah you forgot to close a bracket there at line xy"
|
|
|
08-29-2013, 02:27 AM
|
#4
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by AndreZ
But thats what i did and thats the error message i get.... I just dont know what to do from here. The error is nothing like a syntax error, where it just says "oh yeah you forgot to close a bracket there at line xy"
|
It's not enough to just build your plugin in debug mode. You need to run the plugin so that the VST host itself runs under the debugger. Some hosts will not like you doing that, but I doubt the freeware VSTHost (this one, right? http://www.hermannseib.com/english/vsthost.htm) would have any problems with that.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
08-29-2013, 03:21 AM
|
#5
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
So how do i do it correctly? Currently im just attaching vsthost to the debugger in visual studio, loading the .dll into vsthost and having a look at the output window in VS. Is this not correct? Sorry if these questions seem stupid to you
|
|
|
08-29-2013, 03:59 AM
|
#6
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by AndreZ
So how do i do it correctly? Currently im just attaching vsthost to the debugger in visual studio, loading the .dll into vsthost and having a look at the output window in VS. Is this not correct? Sorry if these questions seem stupid to you
|
Well, that should be the correct way to do it. If the debugger doesn't launch when the plugin crashes (the host application should crash together with it) and show the stack trace, it will indeed be a very tricky thing to debug...However since the generic error message you get is an access violation, you should carefully check all of your pointer and array related code. You could also try another host such as Reaper under the debugger, that might make the debugger work better.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
08-29-2013, 04:56 AM
|
#7
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
The debugger doesnt crash, the plugin just doesnt load. I was hoping not to have to go through all the code again
What could this be? A pointer that isnt initialized? Or one that is pointing to nothing? Im guessing its something like that...
Thanks anyway for the help!
|
|
|
08-29-2013, 05:16 AM
|
#8
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
You could always try inserting breakpoints in the code to pinpoint where the error is occurring. If the debugger stops at one of the breakpoints, then you know that the variables, pointers, etc. are good until that point. It is a lot of trial and error, but you should be able to narrow down where the error is occurring.
If it still crashes, you might want to try compiling and testing one of the example projects to make sure it isn't an error with your setup.
I don't know, but I am just throwing out some ideas that hopefully will help.
|
|
|
08-29-2013, 07:22 AM
|
#9
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
Its not the setup, i already checked with another project
Breakpoints are a good idea. I'll give that a go thanks.
|
|
|
08-29-2013, 02:37 PM
|
#10
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Another option is to download DebugView, and call OutputDebugString("meh") in your plug-in's constructor, before anything else. If you see "meh" appear in DebugView before the error, then you know your plug-in at least began loading. Then you move OutputDebugString("meh") down a bit and try again, until "meh" does not appear in DebugView anymore. Then you will have found the offending code.
Just to make sure: You do know for a fact that you can drag VST DLLs into VSTHost? Because I have never tried that myself, I always just choose "New plug-in..." from one of the menus.
|
|
|
08-30-2013, 06:51 AM
|
#11
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
Quote:
Originally Posted by Tale
Another option is to download DebugView, and call OutputDebugString("meh") in your plug-in's constructor, before anything else. If you see "meh" appear in DebugView before the error, then you know your plug-in at least began loading. Then you move OutputDebugString("meh") down a bit and try again, until "meh" does not appear in DebugView anymore. Then you will have found the offending code.
Just to make sure: You do know for a fact that you can drag VST DLLs into VSTHost? Because I have never tried that myself, I always just choose "New plug-in..." from one of the menus.
|
Really good idea! Im trying this out now. Yes you can just drag plugins into vsthost to open them
|
|
|
08-30-2013, 07:13 AM
|
#12
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
I cant get the message to display even on a plugin thats loading correctly, and i've set the program to capture everything.... I just run DebugView and while im in debug mode in VS, it should output the message, right?
|
|
|
08-30-2013, 12:36 PM
|
#13
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
The nice things about DebugView is that you don't even have to do a debug build of your plug-in, it will work just as well in a release build. You just start DebugView, and then load your plug-in in the host of your choice. Everything you output using OutputDebugString() will appear in the DebugView window.
|
|
|
08-30-2013, 12:47 PM
|
#14
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
if you are using WDL-OL you can use the macro DBGMSG("my debug message") which is a wrapper for OutputDebugString() on windows. it just calls printf on osx
|
|
|
09-01-2013, 02:29 PM
|
#15
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
i expect the problem is todo with a resource not being loaded correctly. Check resource.h and MyPlugin.rc . This issue has been discussed a few times on the forum
|
|
|
09-02-2013, 04:28 AM
|
#16
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
Quote:
Originally Posted by olilarkin
i expect the problem is todo with a resource not being loaded correctly. Check resource.h and MyPlugin.rc . This issue has been discussed a few times on the forum
|
I used your python script to create the project and havent touched those two files, so i dont think its that... Thanks for the macro, i will try that.
Edit: I tried it, and it seems im not getting to the message, even if its in the plugins constructor. Can you identify the problem, or point me in the right direction? Just to be sure, i put the message under the TRACE in the constructor. That should show up, right?
Last edited by AndreZ; 09-02-2013 at 04:34 AM.
|
|
|
09-02-2013, 11:55 AM
|
#17
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Yeah, it should.
What should happen is that the host loads your DLL, at which time DllMain() (in WDL/IPlug/IPlug_include_in_plug_src.h) is called. Then the host will call VSTPluginMain(), which creates an instance of your plug-in and thus calls your constructor. If all that doesn't happen, then perhaps your build configuration is wrong, e.g. you haven't defined VST_API. Or you are not including WDL/IPlug/IPlug_include_in_plug_src.h...
|
|
|
09-03-2013, 05:26 AM
|
#18
|
Human being with feelings
Join Date: May 2013
Posts: 18
|
Quote:
Originally Posted by Tale
you haven't defined VST_API. Or you are not including WDL/IPlug/IPlug_include_in_plug_src.h...
|
IPlug_include_in_plug_src.h is included in the project and i used Oli's script to create the project and havent fiddled with the settings as far as i'm aware.
I'm totally lost The weird thing is that i dont get any error messages when i compile that i should get if it can't find a file or something isn't defined. It compiles without any errors, it just doesnt load in a host...
|
|
|
09-03-2013, 05:34 AM
|
#19
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by AndreZ
I'm totally lost The weird thing is that i dont get any error messages when i compile that i should get if it can't find a file or something isn't defined. It compiles without any errors, it just doesnt load in a host...
|
You could PM or e-mail me the DLL, so I can have a quick look.
|
|
|
09-22-2014, 10:53 PM
|
#20
|
Human being with feelings
Join Date: Apr 2014
Posts: 84
|
I got the same problem when I started to use pointers inaccurately.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:27 PM.
|