Page 18 of 24
Re: Crashes / Disconnects
Posted: Wed Mar 04, 2009 4:58 pm
by LethalEncounter
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

Re: Crashes / Disconnects
Posted: Wed Mar 04, 2009 5:06 pm
by John Adams
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
Re: Crashes / Disconnects
Posted: Wed Mar 04, 2009 5:22 pm
by LethalEncounter
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.
Re: Crashes / Disconnects
Posted: Wed Mar 04, 2009 5:25 pm
by Scatman
LOL! Oh man, I just got home and was looking through the script and was like, yep there is definitely no GetQuest in here

Re: Crashes / Disconnects
Posted: Wed Mar 04, 2009 5:28 pm
by Zcoretri
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.....
Re: Crashes / Disconnects
Posted: Wed Mar 04, 2009 5:41 pm
by John Adams
well scat's online now so i should have 12 call stacks any moment now.
Re: Crashes / Disconnects
Posted: Thu Mar 05, 2009 4:33 pm
by John Adams
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]
Re: Crashes / Disconnects
Posted: Thu Mar 05, 2009 4:36 pm
by Scatman
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.
Re: Crashes / Disconnects
Posted: Thu Mar 05, 2009 6:30 pm
by LethalEncounter
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.
Re: Crashes / Disconnects
Posted: Thu Mar 05, 2009 6:36 pm
by Scatman
Yeah I've removed it and everything runs fine. Hmm, that's how to fix, how to fix

Re: Crashes / Disconnects
Posted: Thu Mar 05, 2009 6:58 pm
by LethalEncounter
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.
Re: Crashes / Disconnects
Posted: Thu Mar 05, 2009 7:41 pm
by LethalEncounter
I went ahead and checked the changes in if you want to try them just compile in debug mode and run on windows.
Re: Crashes / Disconnects
Posted: Fri Mar 06, 2009 7:19 am
by John Adams
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.
Re: Crashes / Disconnects
Posted: Mon Mar 09, 2009 8:04 pm
by John Adams
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.
Re: Crashes / Disconnects
Posted: Tue Mar 10, 2009 2:08 pm
by Scatman
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.