1

I apologize for the vague subject, but I'm inexperienced in this area, and couldn't come up with something more specific.

I am debugging a third party application (written in VC++ 2005) that loads COM plugins. My plugin was written in C# 4.0. When a particular method in my plugin is called, the application crashes, but gives me a fairly useless call stack:

151f0d2d()  
clr.dll!_COMToCLRDispatchHelper@28()  + 0x28 bytes  
clr.dll!BaseWrapper<Stub *,FunctionBase<Stub *,&DoNothing<Stub *>,&StubRelease<Stub>,2>,0,&CompareDefault<Stub *>,2>::~BaseWrapper<Stub *,FunctionBase<Stub *,&DoNothing<Stub *>,&StubRelease<Stub>,2>,0,&CompareDefault<Stub *>,2>()  + 0x175b8b bytes 
clr.dll!COMToCLRWorkerBody()  + 0x80 bytes  
clr.dll!COMToCLRWorkerDebuggerWrapper()  + 0x34 bytes   
clr.dll!_COMToCLRWorker@8()  + 0x12b bytes  

All I think that this tells me is that there's a problem related to CCW. The method that the application is supposed to call in my plugin at the point of the crash doesn't actually get called, either. I changed my plugin to immediately throw a NotImplementedException, and it isn't thrown. However, if I modify another method in the same interface to throw NotImplementedException, the application does report that error properly.

Can anyone recommend further debugging strategies?

Dave
  • 14,618
  • 13
  • 91
  • 145
  • How about commenting-out your method, duplicating one that works for sure (along with any `ComVisible` attribute it might have), renaming it to the problematic one and checking if it is being called? – AVIDeveloper Feb 24 '12 at 16:28
  • I'm not sure what that would prove, but the function signatures are already identical between the function that works and the one that doesn't work. And throwing immediately is a sure-fire way to know my method is being called. – Dave Feb 24 '12 at 16:40
  • Ah.. voodoo land... in that case, try to expose a new method with a new name and the same signature and see if anything changes. Also, since they have the same signature, write some code in the problematic method, have the good method call the bad method, and from outside - call the good method (just to make sure that you're working with the assembly you think you're working with). – AVIDeveloper Feb 24 '12 at 16:47
  • I can call the "bad" method from the "good" method and it invokes the "bad" method as expected. It's all in the same assembly. – Dave Feb 24 '12 at 17:02
  • Did you try creating a whole new method and calling it from COM? If this would work then it will indicate that the problem was in the creation process of the "bad" method. – AVIDeveloper Feb 24 '12 at 17:09

0 Answers0