Strange error - L2AttackableAI: Actor: L2GuardInstance:Patrol(31673)[268518837] - onEvtThink() failed!

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
regenx
Posts: 319
Joined: Sat Jul 17, 2010 6:55 am

Strange error - L2AttackableAI: Actor: L2GuardInstance:Patrol(31673)[268518837] - onEvtThink() failed!

Post by regenx »

Latest master..

Code: Select all

May 07, 2016 3:04:02 AM com.l2jserver.gameserver.ai.L2AttackableAI onEvtThink
WARNING: L2AttackableAI: Actor: L2GuardInstance:Patrol(31673)[268518837] - onEvtThink() failed!
java.lang.IllegalMonitorStateException
	at java.util.concurrent.locks.StampedLock.unlockWrite(Unknown Source)
	at com.l2jserver.gameserver.model.actor.L2Character.doAttack(L2Character.java:1209)
	at com.l2jserver.gameserver.ai.L2AttackableAI.thinkAttack(L2AttackableAI.java:1296)
	at com.l2jserver.gameserver.ai.L2AttackableAI.onEvtThink(L2AttackableAI.java:2546)
	at com.l2jserver.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:345)
	at com.l2jserver.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:316)
	at com.l2jserver.gameserver.ai.L2CharacterAI.onIntentionAttack(L2CharacterAI.java:283)
	at com.l2jserver.gameserver.ai.L2AttackableAI.onIntentionAttack(L2AttackableAI.java:432)
	at com.l2jserver.gameserver.ai.AbstractAI.setIntention(AbstractAI.java:282)
	at com.l2jserver.gameserver.ai.AbstractAI.setIntention(AbstractAI.java:257)
	at com.l2jserver.gameserver.ai.L2AttackableAI.onEvtAttacked(L2AttackableAI.java:2604)
	at com.l2jserver.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:348)
	at com.l2jserver.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:327)
	at com.l2jserver.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:4981)
	at com.l2jserver.gameserver.model.actor.tasks.character.HitTask.run(HitTask.java:60)
	at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
HorridoJoho
L2j Senior Developer
L2j Senior Developer
Posts: 795
Joined: Sun Aug 14, 2005 11:27 am

Re: Strange error - L2AttackableAI: Actor: L2GuardInstance:Patrol(31673)[268518837] - onEvtThink() failed!

Post by HorridoJoho »

I don't have the source at hand. But i remember it was the wrong usage of a try lock. usually it is used like:

Code: Select all

int stamp = lock.tryWriteLock();
if (stamp == 0)
{
    return;
}
try
{
    // the locked code
}
finally
{
    lock.unlockWrite(stamp);
}
but it is used like this:

Code: Select all

int stamp = lock.tryWriteLock();
try
{
    // the locked code
}
finally
{
    lock.unlockWrite(stamp);
}
The second has the flaw that it tries to unlock the lock even when it does not have locked the lock. The stamped lock indicates a failed try lock with a retuerned stamp of 0. That is why when 0 is returned, you must return from doAttack.
Post Reply