Debugging Plug-ins

HouseBot Plugin Development Discussions.
Post Reply
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Debugging Plug-ins

Post by ericvic »

I'm sure this used to work before my machine crashed a while ago. I'm using VC++ 6.0 and when I try to start HouseBotServer.exe as part of a debugging session I get an access violation. If I just execute it by hitting Ctrl+F5 everything runs as it should except of course no debugging.



Any ideas?



Thanks,

Eric
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Sometimes when you mix release/debug modules, I've seen that too. I realize that you can't really do much with the fact that the EXE is built in release.



Can you give me a stack trace where it crashes, or a fault address?
Scott
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

I get a First-chance exception in HouseBotServer.exe: 0xC0000005: Access Violation.



I have used this way of debugging other DLLs many times over the years with no problems. And I think I have done this with HouseBot in the past.



What environment do you use to debug your plug-ins?



Eric
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I use VC++ 6.0 running under Windows XP Pro.



If you compile and debug the sample plugin, do you get the same problem?



When stepping through the code, does it crash before you even get to the property registration callbacks?
Scott
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

Scott,



I will try the sample but with three of my plug-ins it crashes as soon as I hit F5 and it tries to load HouseBotServer.exe



Eric
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

Scott,



I tried the sample device that comes in the SDK and it didn't work either. HouseBotServer.exe seems to crash before it even gets started good, no splash screen or any sign that the app has started ever shows up.



One thing I that happened that I don't think is related is that when I tried to compile the sample I got an error about free and malloc being undefined so I had to include <stdlib.h> in stdafx.h to get it to compile.



Thanks for your help.



Eric
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

It definitely sounds like a difference between our build environments. The free and malloc errors may be indicative of the problem. Make sure you've upgraded VC all the way to SP6.



Maybe try including <malloc.h> instead of <stdlib.h> ???
Scott
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

I will try SP6. I currently have SP5.



How are you including definitions for free and malloc? Wen you compile the sample using the included project file do you not get the errors about free and malloc?



EDIT I just looked and SP6 only deals with Visual SourceSafe.



Thanks,

Eric
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

Scott,



I tried including <malloc.h> and got the same crash.



I can attach to the already running HouseBotServer.exe process and do some of the debugging but that is a pain and I don't get to debug the initial startup sequence without some trickery.



Eric
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

It's probably something in my include path that is different from yours. I'm including in some ATL paths that may make a difference.



Now that I look at the paths, they don't seem like the most obvious, but I'm sure I tweaked them that way over time (not just for HouseBot). The paths in order go like this:



Microsoft SDK\include

Microsoft SDK\src\mfc

Microsoft VisualStudio\VC98\Include

Microsoft VisualStudio\VC98\MFC\Include

Microsoft VisualStudio\VC98\ATL\Include

Microsoft Speech SDK 5.1\Include

\wtl70\Include
Scott
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

Scott,



My includes are basically the same.



Since I'm all out of ideas I guess I'm stuck with attaching to the process to do any debugging for now. I don't want to waste more time trying to figure it out, I would rather just be productive on my plug-ins.



Eric
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Well the next build will not be done on my machine, so maybe the problem will go away with the next release, since it will have a somewhat different build environment.
Scott
Post Reply