Issue information

Issue ID
#5083
Status
Fixed
Severity
Medium
Started
Hercules Elf Bot
Nov 9, 2011 11:08
Last Post
Hercules Elf Bot
Jun 9, 2012 21:23
Confirmation
N/A

Hercules Elf Bot - Nov 9, 2011 11:08

Originally posted by [b]ShadowIllusion[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5083

When you have a player online, then you press CTRL+C (or @mapexit using GM Account), it will crash after finished cleaning mapname...

But its okay if there are no player online...

QUOTE
Error occured on Wednesday, November 9, 2011 at 15:42:17.

D:\map-server_sql.exe caused an Access Violation at location 0065616c in module D:\map-server_sql.exe Reading from location fdfe06ed.

Registers:
eax=1bf4c944 ebx=7efde000 ecx=fdfdfdfd edx=0008e3c8 esi=0018fc0c edi=0018f934
eip=0065616c esp=0018f85c ebp=0018f934 iopl=0 nv up ei pl nz na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206


In src/map/npc.c, it crashed in this line, on npc_event_sub:

if( ev->nd->sc.option&OPTION_INVISIBLE )

After debugging, I found the culprit. npc/other/poring_war.txt

QUOTE
OnPCLogoutEvent:
getmapxy .@map$,.@x,.@y,0;
if (.@map$ == "poring_w02") {
if(WoP_SaveMap$ != "") {
savepoint WoP_SaveMap$,WoP_SaveMap_X,WoP_SaveMap_Y;
set WoP_SaveMap$,"";
set WoP_SaveMap_X,0;
set WoP_SaveMap_Y,0;
}
delitem 7773,countitem(7773);
set wop_team,0;
}
end;


If I comment this entire code, it will not crash. But it will crash even when I only just put:
QUOTE
OnPCLogoutEvent:
end;


Seems it hates that label? I don't think so. If I placed that label in another script, as long as its not in poring_war.txt, the server will not crash...

This post has been edited by ShadowIllusion: Nov 9 2011, 03:30 AM

Hercules Elf Bot - Dec 6, 2011 3:42

Originally posted by [b]Ind[/b]
I've tested about to 4 times to reproduce and I failed, gdb also didn't detect anything. -- i was with 3 clients open + the GM who did @mapexit.

Hercules Elf Bot - Dec 7, 2011 2:03

Originally posted by [b]Epoque[/b]
I believe this was confirmed at eAthena, with regards to the OnPCLogoutEvent label not occuring until the map_session_data for the player had been freed. This is confirmed but unresolved from what I can tell.

Hercules Elf Bot - Dec 8, 2011 15:37

Originally posted by [b]Ind[/b]
[quote name='Epoque' timestamp='1323223400' post='5190']
I believe this was confirmed at eAthena, with regards to the OnPCLogoutEvent label not occuring until the map_session_data for the player had been freed. This is confirmed but unresolved from what I can tell.
[/quote]
hum I was looking at the map_quit/npc_event_sub the only reason I see as being the possible culprit for that is the OnPCLogoutEvent being queued (because otherwise it is run on the fly while player data is still available -- reason my attempts to reproduce didn't crash). but who queues (or have) this many OnPCLogoutEvent oO

Hercules Elf Bot - Jun 1, 2012 14:58

Originally posted by [b]Ind[/b]
this was fixed by me when i did the 7s speed up performance thingo in the shutdown processing, it happened because it'd free all the units randomly as they were ordered players mobs npcs etc, and on my edit i made players be freed first then everything else (and that fixes this).