Crash in MQMain calling invalid method on Plugin

TypePun

Lifetime Member
Joined
Mar 20, 2007
Messages
56
Reaction score
0
Points
6
Location
San Francisco, California
I'm writing a plugin that creates a custom data type. If I call the plugin with known methods, everything works fine. If I call with an unknown method, the plugin crashes in MQ2Main.dll. My GetMember method returns false in this case, which is the expected behavior.

I expect to see an error message of the form 'No method x on object y', or something similar, which I see if I intentionally call an invalid method on a known type.

I would like to debug MQ2Main, but when I build it in debug mode and deploy it, the injector issues errors about missing entry points.

Can anyone tell me how to debug MQ2Main? I am sure that the problem is in my type initialization, but I am not able to tell what I am doing wrong from simply reading through the source code.

My plugin, when it is complete and working, will create a number of useful string containers such as set, map, queue, list, stack and priority_queue.

Thank you in advance for your help.
 
I suspect that the fault is in your code. I've written a few plugins and advice is to take a plugin that is small and try to digest what it is doing.

As you've found any error on your part is likely to crash the client. Look at how you are to report a crash to see how to attach a debugger.

Personally I add a DEBUG() function and dump everything to a file.
 
I built my plugin in debug mode and I am able to debug it. When it returns from GetMember with a result of false, the crash occurs. Hence my desire to debug into MQ2Main.dll.

I was thinking about building the base MQ2 release and hosting my plugin there. I know that I can build that release in debug mode and debug it. The problem is, I can't build the MMOBugs code in debug mode and run it.

There must be a way to build the MMOBugs release in Debug mode -- I am sure the developers here have to debug the code every now and then.

For the record, I am 100% sure the error is in my code. I don't know what I am doing wrong and I am interesting in seeing where the code fails in MQ2Main that is causing the access violation.
 
I created a new solution and added my files and built it. I get the expected results. Something must have been off in the compilation options that were set. I'll compare the old and new settings and see where there is a difference.