SEVERE: Failed executing HitTask.

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

SEVERE: Failed executing HitTask.

Post by Bruteforce »

Do not forget to add your Server and Datapack Revision numbers!
» Find Revision
L2J Revision Number: Last Gracia 2.2
L2JDP Revision Number: Last Gracia 2.2

I once again got this error when a player got killed when having karma:

Code: Select all

2009-maj-27 00:07:13 net.sf.l2j.gameserver.model.actor.L2Character$HitTask runSEVERE: Failed executing HitTask.java.lang.ArrayIndexOutOfBoundsException: 14    at javolution.util.FastCollection.toArray(FastCollection.java:359)    at net.sf.l2j.gameserver.model.itemcontainer.ItemContainer.getItems(ItemContainer.java:79)    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onDieDropItem(L2PcInstance.java:5187)    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.doDie(L2PcInstance.java:5041)    at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:241)    at net.sf.l2j.gameserver.model.actor.status.PlayableStatus.reduceHp(PlayableStatus.java:41)    at net.sf.l2j.gameserver.model.actor.status.PcStatus.reduceHp(PcStatus.java:113)    at net.sf.l2j.gameserver.model.actor.status.PcStatus.reduceHp(PcStatus.java:43)    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.reduceCurrentHp(L2PcInstance.java:10607)    at net.sf.l2j.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5162)    at net.sf.l2j.gameserver.model.actor.L2Character$HitTask.run(L2Character.java:2388)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)    at java.util.concurrent.FutureTask.run(FutureTask.java:138)    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)    at java.lang.Thread.run(Thread.java:619) 
And as always when I get this error, the CPU usage goes to 100% and stays there until I reboot server.
I still don't know why I get this, or how to fix it, and now I'm asking if this is something that will be fixed in Gracia 2.3.
I would much appreciate if someone could help me out.
Thanks so much in advance!
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: SEVERE: Failed executing HitTask.

Post by _DS_ »

2.2 not supported now, moving.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

_DS_ wrote:2.2 not supported now, moving.
So, should I take this as a 'Yes, it's been fixed in 2.3'?
If not, it's still valid for the bug-section, I think.
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: SEVERE: Failed executing HitTask.

Post by DrHouse »

He means that support is limited and only in this forum.

Lets see if we can avoid synchronization to fix this problem. Please try this patch:

Code: Select all

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 3078)+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)@@ -5318,6 +5318,8 @@            }              int dropCount = 0;+            final L2ItemInstance[] items = getInventory().getItems();+                        while (dropPercent > 0 && Rnd.get(100) < dropPercent && dropCount < dropLimit)            {                 int itemDropPercent = 0;@@ -5327,8 +5329,11 @@                nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;                nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS; -               for (L2ItemInstance itemDrop : getInventory().getItems())+               for (L2ItemInstance itemDrop : items)                {+                   if (itemDrop == null)+                       continue;+                                       // Don't drop                    if (                            itemDrop.isShadowItem() || // Dont drop Shadow Items 
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

Thanks a lot! I will try it asap!
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: SEVERE: Failed executing HitTask.

Post by DrHouse »

Thanks for testing. I have just realized that code above could make drop an item multiple times. If possible, try this one:

Code: Select all

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 3078)+++java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)@@ -106,6 +106,7 @@ import net.sf.l2j.gameserver.model.MacroList; import net.sf.l2j.gameserver.model.ShortCuts; import net.sf.l2j.gameserver.model.TradeList;+import net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation; import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType; import net.sf.l2j.gameserver.model.actor.L2Attackable; import net.sf.l2j.gameserver.model.actor.L2Character;@@ -5318,17 +5319,22 @@            }              int dropCount = 0;+            final L2ItemInstance[] items = getInventory().getItems();+                        while (dropPercent > 0 && Rnd.get(100) < dropPercent && dropCount < dropLimit)            {                 int itemDropPercent = 0;-               List<Integer> nonDroppableList = new FastList<Integer>();-               List<Integer> nonDroppableListPet = new FastList<Integer>();+               List<Integer> nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;;+               List<Integer> nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS; -               nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;-               nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS;--               for (L2ItemInstance itemDrop : getInventory().getItems())+               for (L2ItemInstance itemDrop : items)                {+                   // Using a single array for every while loop iteration could provoke to drop an item twice+                   if (itemDrop == null +                           || itemDrop.getLastChange() == L2ItemInstance.REMOVED +                           || itemDrop.getLocation() == ItemLocation.VOID)+                       continue;+                                       // Don't drop                    if (                            itemDrop.isShadowItem() || // Dont drop Shadow Items 
Some parts of it will be commited to trunk either it fixes the problem or it doesnt
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

Sorry, can't apply this patch.
Eclipse doesn't recognize it as a patch.
I then tried to apply it manually, but I get an error saying "itemDrop cannot be resolved".

Also, should there be two ; at the end of this line?

Code: Select all

List<Integer> nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;;
Thanks for trying to help!

Edit: I just wanted to add, that I try to apply this on the latest 2.3 svn, since that's the version I'm working on to go live with tomorrow! :)
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

I don't know what I did wrong the first time, but now the second try I could apply the patch manually! :)

Thanks, will let you know my findings!
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: SEVERE: Failed executing HitTask.

Post by DrHouse »

:D
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

Sorry, but didn't work. Still got 100% CPU after someone cleansed himself of karma by getting killed.

BTW, sometimes the karma isn't reduced upon death, it stays the same. Maybe this is what is causing the server to raise in CPU?

And, I'm running this on Gracia Final now, so this thread may be moved to bugg-section again! :)

Server Version= 3116
Datapack Version= 6189
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

I'm now starting to think it has something to do with when they are killed by guards.
Got a player who died time after time, dropping stuff all over, but no lag.
Then he started killing himself on a guard, and voila!

Edit: BTW, this time I never got an error in the console!
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: SEVERE: Failed executing HitTask.

Post by DrHouse »

So the second patch fixed the console output but lag stays, right?
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
User avatar
Notorious
Posts: 501
Joined: Thu May 28, 2009 3:50 pm
Location: Sweden

Re: SEVERE: Failed executing HitTask.

Post by Notorious »

Yes, you could say that! :)
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

I found the problem now!!! :)
It occurs when the player has no items at all left to drop, and is killed.
On first kill with no items to drop, CPU went to about 50%.
Second time it went to 100%.

So maybe there needs to be some check to see if there are any more to drop before trying to drop items when killed having karma.

I had one augmented weapon on me that I still had left.
I will remove this, and try again, just to make sure! :)

Oh, and btw... Sometimes when I try to click to pick up the items from the ground, it sais I failed to pick it up, but if I use the pick-up action-button, it picks it up normally.

Edit: Tested with no augmented weapon, and only 2 items to drop. I have it set to drop 5 items. And I got the CPU high again. So when the player can't drop the number of items set in rates.properties, ie he has less items in inventory/paperdoll, you have the problem.

Thanks you oh so so much, for fixing this!

And I use Gracia Final,
L2J Revision Number: 3124
L2JDP Revision Number: 6201
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: SEVERE: Failed executing HitTask.

Post by janiii »

Bruteforce wrote:I found the problem now!!! :)
Thanks you oh so so much, for fixing this!
very nice catch and that you found the problem! thx to you! :)

(i already looked at the problem, yes, it just loops without the end, because he cannot drop the max amount that should be dropped)
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Post Reply