Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2011, 07:35 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default Crash Issue

Upgraded to the latest build and applied all the SQL but many of my spells are crashing zones (windows) .. What am I doing wrong ?

Morty
Reply With Quote
  #2  
Old 10-17-2011, 07:53 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Build with debug information, attach the debugger to a running zone, make it crash, post the call stack.
Reply With Quote
  #3  
Old 10-17-2011, 09:02 PM
hdaar44
Fire Beetle
 
Join Date: May 2005
Posts: 1
Default

how u attach debugger to a running zone?
Reply With Quote
  #4  
Old 10-17-2011, 09:19 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Debug -> Attach to Process
Reply With Quote
  #5  
Old 10-17-2011, 09:59 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Alright thats ... I'm used to just getting a core drop and then doing a dbg on it but windows is a whole other ball game .. I'll see if I can find that option in my compiler ..

morty
Reply With Quote
  #6  
Old 10-17-2011, 10:40 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default Debug Info ?

Can some one link me a good guide for debugging binary's and stuff here ? I mean it's totally different .. I compiled with debug mode and i have athe following:

EmuShareMem.dll
EmuShareMem.exp
EmuShareMem.ilk
EmuShareMem.lib
EmuShareMem.pdb

World.bsc
WorldDebug.exe
WorldDebug.ilk
WorldDebug.pdb

ZonePerl.exe
ZonePerl.ilk
ZonePerl.pdb

What do I do with these files other than the exe files do i move them in there as well do they play a part in the debugging ?

And after I put them in there I boot the server then do Attach Process and open a new zone with the file or how does that work exactly *boggle*

mort
Reply With Quote
  #7  
Old 10-17-2011, 11:00 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

You most likely want to add debugging information to the release version if that is what is crashing. If zone.exe is all that's crashing then that's what you should focus on.
  • Open the solution in Visual Studio.
  • Select Release or ReleaseBots in the dropdown at the top.
  • Right-click zone in the solution window and select properties.
  • In the property pages, find C/C++ and change Debug Information Format to Program Database (/Zi)
  • Under Linker/Debugging change Generate Debug Info to Yes (/DEBUG)
  • Compile
  • Copy all of the normal executables to your server directory along with zone.pdb

From here it depends on how you can duplicate the problem.

If it is easy to reproduce then start the server and get your toon that can cause the crash to the zone. Look in the logs folder to find what the process ID is for the zone you are in. It's the number in the log file name. In Visual Studio select Debug->Attach to Process and find the zone.exe that has the same number as the log file. Make it crash, copy the call stack from Visual Studio and post it if you can't figure it out yourself.

If it is not easy to reproduce then you will probably have better results with a minidump. Secrets posted information on how to force those to be generated by crashes. You open them in Visual Studio, click the green arrow, and it will show you where the crash occured.
Reply With Quote
  #8  
Old 10-19-2011, 02:56 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Ok excellent instructions man, I got as far as the copy the call stack.. where is the call stack and how do i copy it ?
Reply With Quote
  #9  
Old 10-19-2011, 04:36 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

The call stack window is one of the tabs at the bottom of the screen. You select the contents, copy, paste.
Reply With Quote
  #10  
Old 10-20-2011, 01:07 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Finally figured it out hehe , good instructions like i said.

Hopefully you can also tell me how to fix it that would rock

Code:
>	Zone.exe!Mob::CalcFocusEffect(focusType type=focusManaCost, unsigned short focus_id=65535, unsigned short spell_id=7058, bool best_focus=false)  Line 3707 + 0x6 bytes	C++
 	Zone.exe!Client::GetFocusEffect(focusType type=focusManaCost, unsigned short spell_id=7058)  Line 4168 + 0x1e bytes	C++
 	Zone.exe!Client::GetActSpellCost(unsigned short spell_id=7058, int cost=1375)  Line 313 + 0xf bytes	C++
 	Zone.exe!Mob::DoCastSpell(unsigned short spell_id=7058, unsigned short target_id=322, unsigned short slot=0, int cast_time=50, int mana_cost=1375, unsigned int * oSpellWillFinish=0x00000000, unsigned int item_slot=4294967295, unsigned int timer=4294967295, unsigned int timer_duration=0, unsigned int type=0, short resist_adjust=0)  Line 399 + 0x19 bytes	C++
 	Zone.exe!Mob::CastSpell(unsigned short spell_id=7058, unsigned short target_id=0, unsigned short slot=0, int cast_time=-1, int mana_cost=-1, unsigned int * oSpellWillFinish=0x00000000, unsigned int item_slot=4294967295, unsigned int timer=4294967295, unsigned int timer_duration=0, unsigned int type=0, short * resist_adjust=0x00000000)  Line 313	C++
 	Zone.exe!Client::Handle_OP_CastSpell(const EQApplicationPacket * app=0x014e9ce8)  Line 4595	C++
 	Zone.exe!Client::HandlePacket(const EQApplicationPacket * app=0x014e9ce8)  Line 456	C++
 	Zone.exe!Client::Process()  Line 740 + 0xf bytes	C++
 	Zone.exe!EntityList::MobProcess()  Line 488 + 0x1a bytes	C++
 	Zone.exe!main(int argc=1, char * * argv=0x003a2fe0)  Line 480	C++
 	Zone.exe!__tmainCRTStartup()  Line 266 + 0x12 bytes	C
 	kernel32.dll!7c816d4f() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	kernel32.dll!7c8399f3() 	
 	Zone.exe!Database::LoadVariables()  Line 1016 + 0x14 bytes	C++
 	cc7d83cc()
Also the window above had an arrow pointing to this section ..

Code:
	for (int i = 0; i < EFFECT_COUNT; i++) {
>		switch (focus_spell.effectid[i]) {
		case SE_Blank:
			break;
Reply With Quote
  #11  
Old 10-20-2011, 01:50 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Looking at your call stack, and looking at the source code, I could see this crash happening if you had an item with no innate focus effect, but that item has an aug which does have
a focus effect.

Not sure if that code has been altered recently, but this patch may fix it (totally untested):
Code:
Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp   (revision 2034)
+++ spell_effects.cpp   (working copy)
@@ -4110,20 +4110,20 @@
                                                focus_max = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id, true);
                                                if (focus_max > 0 && focus_max_real >= 0 && focus_max > focus_max_real) {
                                                        focus_max_real = focus_max;
-                                                       UsedItem = TempItem;
+                                                       UsedItem = TempItemAug;
                                                } else if (focus_max < 0 && focus_max < focus_max_real) {
                                                        focus_max_real = focus_max;
-                                                       UsedItem = TempItem;
+                                                       UsedItem = TempItemAug;
                                                }
                                        }
                                        else {
                                                Total = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id);
                                                if (Total > 0 && realTotal >= 0 && Total > realTotal) {
                                                        realTotal = Total;
-                                                       UsedItem = TempItem;
+                                                       UsedItem = TempItemAug;
                                                } else if (Total < 0 && Total < realTotal) {
                                                        realTotal = Total;
-                                                       UsedItem = TempItem;
+                                                       UsedItem = TempItemAug;
                                                }
                                        }
Reply With Quote
  #12  
Old 10-20-2011, 02:09 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Quote:
The Chunk Size did not match the number of added/removed lines!
Is what I got when using Apply Patch

Anyway , I assumed + means add, and - means take away while looking at that so thats what I did and did it manually.. Also updated to the latest build so it's compiling now hopefully it doesn't wig out on something else now ! hehe

Much appreciated hopefully this will work

Morty
Reply With Quote
  #13  
Old 10-21-2011, 02:35 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Well... That fix worked now i'm getting something else entirely ! haha .. Any ideas here??

Code:
>	Zone.exe!Mob::ExecWeaponProc(unsigned short spell_id=19361, Mob * on=0x01564b08)  Line 2728 + 0x10 bytes	C++
 	Zone.exe!Mob::TryWeaponProc(const Item_Struct * weapon=0x04e49a88, Mob * on=0x01564b08, unsigned short hand=13)  Line 3793	C++
 	Zone.exe!Mob::TryWeaponProc(const ItemInst * weapon_g=0x015d9d10, Mob * on=0x01564b08, unsigned short hand=13)  Line 3680	C++
 	Zone.exe!Client::Process()  Line 397	C++
 	Zone.exe!EntityList::MobProcess()  Line 488 + 0x1a bytes	C++
 	Zone.exe!main(int argc=2, char * * argv=0x003a3020)  Line 480	C++
 	Zone.exe!__tmainCRTStartup()  Line 266 + 0x12 bytes	C
 	kernel32.dll!7c816d4f() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	kernel32.dll!7c8399f3() 	
 	Zone.exe!Client::AutoPutLootInInventory(ItemInst & inst={...}, bool try_worn=true, bool try_cursor=false, ServerLootItem_Struct * * bag_item_data=0x3a064000)  Line 622 + 0x6 bytes	C++
 	00000f06()
Reply With Quote
  #14  
Old 10-21-2011, 02:55 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by KingMort View Post
Well... That fix worked now i'm getting something else entirely ! haha .. Any ideas here??

Code:
>	Zone.exe!Mob::ExecWeaponProc(unsigned short spell_id=19361, Mob * on=0x01564b08)  Line 2728 + 0x10 bytes	C++
 	Zone.exe!Mob::TryWeaponProc(const Item_Struct * weapon=0x04e49a88, Mob * on=0x01564b08, unsigned short hand=13)  Line 3793	C++
 	Zone.exe!Mob::TryWeaponProc(const ItemInst * weapon_g=0x015d9d10, Mob * on=0x01564b08, unsigned short hand=13)  Line 3680	C++
 	Zone.exe!Client::Process()  Line 397	C++
 	Zone.exe!EntityList::MobProcess()  Line 488 + 0x1a bytes	C++
 	Zone.exe!main(int argc=2, char * * argv=0x003a3020)  Line 480	C++
 	Zone.exe!__tmainCRTStartup()  Line 266 + 0x12 bytes	C
 	kernel32.dll!7c816d4f() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	kernel32.dll!7c8399f3() 	
 	Zone.exe!Client::AutoPutLootInInventory(ItemInst & inst={...}, bool try_worn=true, bool try_cursor=false, ServerLootItem_Struct * * bag_item_data=0x3a064000)  Line 622 + 0x6 bytes	C++
 	00000f06()
I am actually dealing with a similar issue with Lillu right now, verifying the code first before I submit it. That has to do with a spell trying to proc a spell that doesn't exist most likely.

Check your spells table for 19361, if it isn't there that's the ultimate problem. But there should be some safety checks in the code for it.

There's a few different functions that bump into this problem. Ultimately ExecWeaponProc can use some functions to check the validity of the spell before it tries to fire off.

First check your spells table for that and get back to me.

Thanks,
Akkadius
Reply With Quote
  #15  
Old 09-16-2012, 01:07 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I know this is an old thread, but I am trying to figure out how to attach a debugger to a zone as well. I tried setting debugging to yes and changing the C++ settings on the zone, but when I compile, there is no zone.pdb file. Did how this works change or am I just doing it incorrectly?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:57 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3