Crashes / Disconnects

Old bugs stored here for reference.
Locked
LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Crashes / Disconnects

Post by LethalEncounter » Wed Mar 04, 2009 4:58 pm

Invalid data type used for GetQuest in @SpawnScripts/TimorousDeep/ZeldikilGiSok.
lua (line 33)
I'm thinking it is the call to GetQuest on line 33 of SpawnScripts/TimorousDeep/ZeldikilGiSok.lua

I'm psychic :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Crashes / Disconnects

Post by John Adams » Wed Mar 04, 2009 5:06 pm

There is no GetQuest in that entire script, Nostradamus.

;)


This is it.

Code: Select all

--[[
	Script Name	: SpawnScripts/TimorousDeep/ZeldikilGiSok.lua
	Script Purpose	: Zeldikil Gi'Sok <Mender>
	Script Author	: John Adams
	Script Date	: 2009.02.06
	Script Notes	: Auto-Generated Conversation from PacketParser Data
--]]

function spawn(NPC)
	SetPlayerProximityFunction(NPC, 10, "InRange")
end

function respawn(NPC)
	spawn(NPC)
end

function InRange(NPC, Spawn)
	Choice = math.random(1, 3)
	if Choice == 1 then
		PlayFlavor(NPC, "", "Repair your armor for coin!", "", 1689589577, 4560189, Spawn)
	elseif Choice == 2 then
		PlayFlavor(NPC, "", "I repair all types of armor!", "", 1689589577, 4560189, Spawn)
	else
		PlayFlavor(NPC, "", "Come to me for the fastest repairs this side of Gorowyn!", "", 1689589577, 4560189, Spawn)
	end
end

function hailed(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	conversation = CreateConversation()
	
	AddConversationOption(conversation, "Thank you.")
	StartConversation(NPC, Spawn, conversation, "Your armor and weapons wear down when you die during combat. When they are down to zero durability, you no longer receive any benefit from them. You can visit myself or any mender to get them repaired.")
end

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Crashes / Disconnects

Post by LethalEncounter » Wed Mar 04, 2009 5:22 pm

Ahh oops, I seemed to have copied GetQuest as the error message for each type. The error is actually what you mentioned earlier about the StartConversation. Parameter one needs to be conversation, as discussed already.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Crashes / Disconnects

Post by Scatman » Wed Mar 04, 2009 5:25 pm

LOL! Oh man, I just got home and was looking through the script and was like, yep there is definitely no GetQuest in here :P

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Crashes / Disconnects

Post by Zcoretri » Wed Mar 04, 2009 5:28 pm

John Adams wrote:There is no GetQuest in that entire script, Nostradamus.

;)

function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()

AddConversationOption(conversation, "Thank you.")
StartConversation(NPC, Spawn, conversation, "Your armor and weapons wear down when you die during combat. When they are down to zero durability, you no longer receive any benefit from them. You can visit myself or any mender to get them repaired.")
end[/code]
Nice one John, had to LMAO on that one

But as you guys have pointed out, these parameters are fubar

Code: Select all

StartConversation(NPC, Spawn, conversation, "Your armor an.....

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Crashes / Disconnects

Post by John Adams » Wed Mar 04, 2009 5:41 pm

well scat's online now so i should have 12 call stacks any moment now.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Crashes / Disconnects

Post by John Adams » Thu Mar 05, 2009 4:33 pm

Hmm, I cannot explain this behavior. Scatman asked me to check if I was seeing deadlock warnings in the console, so I went to the VM, saw the deadlock, and noticed the RAM on the machine was very low and that EQ2World.exe was sucking up 750mb of the 1GB allocated. So I minimized EQ2WorldDebug.exe, and the world crashed. :|

Code: Select all

>	EQ2WorldDebug.exe!std::operator<<<char,std::char_traits<char>,std::allocator<char> >(std::basic_ostream<char,std::char_traits<char> > & _Ostr={...}, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Str=<Bad Ptr>)  Line 569 + 0x2e bytes	C++
 	EQ2WorldDebug.exe!Mutex::lock()  Line 112 + 0x21 bytes	C++
 	EQ2WorldDebug.exe!LuaInterface::RunSpawnScript(std::basic_string<char,std::char_traits<char>,std::allocator<char> > script_name="SpawnScripts/TimorousDeep/aHaoaeranpoacher.lua", char * function_name=0x00bb9bdc, Spawn * npc=0x3247c780, Spawn * spawn=0x327b5de0, char * message=0x00000000)  Line 904	C++
 	EQ2WorldDebug.exe!ZoneServer::CallSpawnScript(Spawn * npc=0x3247c780, unsigned char type='', Spawn * spawn=0x327b5de0, char * message=0x00000000)  Line 1138	C++
 	EQ2WorldDebug.exe!ZoneServer::KillSpawn(Spawn * dead=0x327b5de0, Spawn * killer=0x3247c780, bool send_packet=true)  Line 2327	C++
 	EQ2WorldDebug.exe!EQ2Emu_lua_KillSpawn(lua_State * state=0x324520e8)  Line 113	C++
 	EQ2WorldDebug.exe!_luaD_precall()  + 0x19d bytes	C
 	EQ2WorldDebug.exe!_luaV_execute()  + 0xad8 bytes	C
 	EQ2WorldDebug.exe!_luaD_call()  + 0x43 bytes	C
 	EQ2WorldDebug.exe!_lua_call()  + 0x65 bytes	C
 	EQ2WorldDebug.exe!_luaD_rawrunprotected()  + 0x3a bytes	C
 	EQ2WorldDebug.exe!_luaD_pcall()  + 0x3e bytes	C
 	EQ2WorldDebug.exe!_lua_pcall()  + 0x53 bytes	C
 	EQ2WorldDebug.exe!LuaInterface::CallSpawnScript(lua_State * state=0x324520e8, unsigned char num_parameters='')  Line 396 + 0x18 bytes	C++
 	EQ2WorldDebug.exe!LuaInterface::RunSpawnScript(std::basic_string<char,std::char_traits<char>,std::allocator<char> > script_name="SpawnScripts/TimorousDeep/aHaoaeranpoacher.lua", char * function_name=0x1e66d59c, Spawn * npc=0x3247c780, Spawn * spawn=0x00000000, char * message=0x00000000)  Line 921 + 0x13 bytes	C++
 	EQ2WorldDebug.exe!ZoneServer::CallSpawnScript(Spawn * npc=0x3247c780, unsigned char type='', Spawn * spawn=0x00000000, char * message=0x1e66d59c)  Line 1156	C++
 	EQ2WorldDebug.exe!ZoneServer::CheckSpawnScriptTimers()  Line 2068	C++
 	EQ2WorldDebug.exe!ZoneServer::SpawnProcess()  Line 710	C++
 	EQ2WorldDebug.exe!SpawnLoop(void * tmp=0x0fdec018)  Line 3011 + 0x8 bytes	C++
 	EQ2WorldDebug.exe!_callthreadstart()  Line 293 + 0xf bytes	C
 	EQ2WorldDebug.exe!_threadstart(void * ptd=0x0bc78dd8)  Line 277	C
 	kernel32.dll!77e64829() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Crashes / Disconnects

Post by Scatman » Thu Mar 05, 2009 4:36 pm

That call stack looks like it could provide some good info. Every function I see on it is called by the poachers. It is the only spawn in the zone that calls KillSpawn.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Crashes / Disconnects

Post by LethalEncounter » Thu Mar 05, 2009 6:30 pm

I'm pretty sure I know what is happening. The server is locking the script for the poacher when it runs it. When you call the KillSpawn function in your script it is trying to open the same script to call the death function in it. It is indeed leading to a deadlock, which explains quite a few of your problems. For now until we can come up with a solution to the problem, disabling that script or commenting out the KillSpawn line should fix it.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Crashes / Disconnects

Post by Scatman » Thu Mar 05, 2009 6:36 pm

Yeah I've removed it and everything runs fine. Hmm, that's how to fix, how to fix :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Crashes / Disconnects

Post by LethalEncounter » Thu Mar 05, 2009 6:58 pm

I could have the locks check to see if they are being called from the same thread and if so, allow access to the piece of code right away. Doing so should stop most or all of the current deadlock problems. However, the problem might arise that allowing this causes other problems where the data is recursively changed. The code to this this is fairly easy, I just don't know the side effects. Let me know if you want to try it.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Crashes / Disconnects

Post by LethalEncounter » Thu Mar 05, 2009 7:41 pm

I went ahead and checked the changes in if you want to try them just compile in debug mode and run on windows.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Crashes / Disconnects

Post by John Adams » Fri Mar 06, 2009 7:19 am

Thanks, LE. I'll get a new debug binary up this morning.


Edit: Super. My phone must have rung at home, my router just died. Piece of shit. Sorry, you'll have to wait til after 3pm MST to test this fix.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Crashes / Disconnects

Post by John Adams » Mon Mar 09, 2009 8:04 pm

Mkay... interesting. For days, I ran Debug code with remote debugger attached, not one crash through all the work Scatman has done and players testing items, zoning all around. I put the release binary online, and within 2 hours, it crashes. No idea what was happening, but here's the console for the last connection (this same user seemed to be dropped a few times doing the same thing)

Code: Select all

AddAuth: 3842 Key: 1236653247
3383687 New client from ip: xxx.xxx.xxx.xxx port: 54016
ZoneAuth: Access Key, 1236653247, Character Name, Useuchu, Account ID, xxxx, TimeStamp, 1236653247
OP_ChatFiltersMsg Received 0x013d
   0: 0D 00 FF FF FF FF FF 01 - 00 00 00 80 FF FF 0B 01  | ................
OP_ChatFiltersMsg Received 0x013d
   0: 0D 00 FF FF FF FF FF FF - FF FF FF FF FF FF 0B 01  | ................
OP_Unknown Received 0x0026
   0: 01 00 00 00 96 43                                  | .....C
OP_Unknown Received 0x00b2
   0: 00 00                                              | ..
   0: CC 01 00 00                                        | ....
Unhandled command: clearallqueuedabilities
   0: 25 00 01 00 30                                     | %...0
   0: 23 00 01 00 31                                     | #...1
   0: CC 01 00 00                                        | ....
Unhandled command: clearallqueuedabilities
OP_ChatFiltersMsg Received 0x013d
   0: 0D 00 FF FF FF FF FF FF - FF FF FF FF FF FF 0B 01  | ................
   0: 01 00 07 00 64 65 74 61 - 69 6C 73                 | ....details
Left Grid 4294967295 and Entered Grid 771354606
   0: CC 01 00 00                                        | ....
Unhandled command: clearallqueuedabilities
   0: 01 00 07 00 64 65 74 61 - 69 6C 73                 | ....details
OP_BeginTrackingMsg Received 0x0175
   0: 3E                                                 | >
Zone: Removing client from ip:xxx.xxx.xxx.xxx port:54016
Removing connection
This is "unknwon"s IP, and there was some talk about a packet scanner he made, which I am still waiting for an explanation why it would be used on my server.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Crashes / Disconnects

Post by Scatman » Tue Mar 10, 2009 2:08 pm

I tried doing "/spawn set faction 1" today and instantly got booted. I don't think World crashed but John will have to verify that.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests