CTD, unsure of exact command

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

Marginal
decaying skeleton
decaying skeleton
Posts: 4
Joined: Thu Apr 22, 2004 6:49 am

CTD, unsure of exact command

Post by Marginal » Sun Apr 25, 2004 7:28 am

I'm Working on converting some old macros to the new MQ2Data, but after one of the recent MQ2 downloads i started crashing to desktop when executing some macros.

I tried to pinpoint the exact commandline that caused the crash, but was unable to (ie. could not reproduce bug by out-commenting all but one line and execute them one by one). This piece of code crashed me though:
[Edit:]From the output window, it looks like the macro actually finishes without problems, but i crash just after. Other simple macros like follow.mac works just fine.

Code: Select all

#event MissedNote "You miss a note, bringing your song to a close!" 
#event NeedTarget "You must first select a target for this spell!" 
#event Slow       "you slow down" 
#event Exp        "You gain " 
#event Tell       "tells you" 
#event Recovered "You haven't recovered yet..." 
#event Notsee   "You cannot see" 
#event Died "You have entered" 

Sub Main(p0,p1,p2,p3,p4,p5,p6) 

/declare cirx global 
/declare ciry global 
/declare cirr global 
/declare a array 
/declare nsongs global 
/declare cursong global 
/declare prevsong global 
/declare exper global 
/declare aaexp global 
/declare health global 
/declare songtimer timer 
/declare selotimer timer 
/declare angstimer timer 
/declare puretonetimer timer 
/declare bellowtimer timer 
/declare rangecalc global 
/declare lastmobid global 
/varset rangecalc 0 

  /if (!${Defined[p0]}) { 
    /echo usage: foo
    /endmacro
  } 

/return 
Running
MQ2: April 25 2004 00:40:04
Visual Studio 6, SP6

Output window:

Code: Select all

[MQ2]Macro - Loading macro: C:\Games\MQ2\Macros\test.mac
[MQ2]Macro - Starting macro with '/call Main'
[MQ2]Call - Calling subroutine Main with params 
[MQ2]Echo - [MQ2] usage: foo
[MQ2]WriteChatColor([MQ2] usage: foo)
[MQ2]WriteChatColor(Cleared the following: Timers Arrays)
[MQ2]EndMacro - Ended
[MQ2]WriteChatColor(The current macro has ended.)
Call Stack:

Code: Select all

 :arrow: MQ2MAIN! HideDoCommand + 808 bytes
MQ2MAIN! DoNextCommand(void) + 208 bytes
MQ2MAIN! Heartbeat(void) + 280 bytes
MQ2MAIN! Detour_ProcessGameEvents(void) + 5 bytes
EQGAME! 004acd5f()
Disassembly window:

Code: Select all

015D2DBB   call        dword ptr [esi+40h]
015D2DBE   add         esp,8
015D2DC1   mov         edi,ebp
015D2DC3   or          ecx,0FFFFFFFFh
015D2DC6   xor         eax,eax
 :arrow: 015D2DC8   repne scas  byte ptr [edi]
015D2DCA   not         ecx
015D2DCC   sub         edi,ecx
015D2DCE   mov         eax,ecx
015D2DD0   mov         esi,edi
015D2DD2   mov         edi,offset _szLastCommand (01648580)
Context: MQ2MAIN! HideDoCommand

Code: Select all

Name:this
Value: CXX0017: Error: symbol "this" not found
I'm new to MQ...hope this is the info you need

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Ayup. Dats a bug.

Post by Vexix » Sun Apr 25, 2004 8:00 am

Nice post, Marginal. I think you got all the info Lax will need. I'm having the same issue. Seems to be a problem with /return from subroutines. Here my info.

Error:
First-chance exception in eqgame.exe(MQ2MAIN.DLL):0XC0000005 Access Violation.

Output:
[MQ2]Return - Returned to /call ScanVendor
[MQ2]WriteChatColor(Cleared the following: Timers Arrays)
[MQ2]EndMacro - Ended
[MQ2]WriteChatColor(The current macro has ended.)
Call Stack:
:arrow: MQ2MAIN! HideDoCommand + 1118 bytes
MQ2MAIN! DoNextCommand(void) + 289 bytes
MQ2MAIN! Heartbeat(void) + 357 bytes
MQ2MAIN! Detour_ProcessGameEvents(void) + 8 bytes
EQGAME! 004acd5f()
20656874()
013335B9 or ecx,0FFFFFFFFh
013335BC xor eax,eax
:arrow: 013335BE repne scas byte ptr [edi]
013335C0 not ecx
013335C2 sub edi,ecx
013335C4 mov esi,edi
013335C6 mov eax,ecx
In Lax we trust!

--Vexix

Marginal
decaying skeleton
decaying skeleton
Posts: 4
Joined: Thu Apr 22, 2004 6:49 am

Post by Marginal » Sun Apr 25, 2004 6:25 pm

Fixed in April 25 2004 12:21:02 release. Thanks devs :)