Deadlock Problems

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
wasabi2k
Posts: 110
Joined: Sun Oct 08, 2006 4:22 pm

Deadlock Problems

Post by wasabi2k »

lately i have been having issues with random deadlocks the only consistent part is the error :

Image

some info ppl might need :

L2ItemInstance @ 1311:

Code: Select all

	public synchronized void updateDatabase(boolean force)	{        if(isWear())        {        	return; <== line 1311        }		if (_existsInDb)        {
L2ItemInstance @ 1301:

Code: Select all

    public void updateDatabase()    {        this.updateDatabase(false);<== 1301    }
Inventory @ 1292:

Code: Select all

			case L2Item.SLOT_LR_HAND:			{				if (setPaperdollItem(PAPERDOLL_LHAND, null) != null)				{					// exchange 2h for 2h					setPaperdollItem(PAPERDOLL_RHAND, null);					setPaperdollItem(PAPERDOLL_LHAND, null);				}				else					setPaperdollItem(PAPERDOLL_RHAND, null); 				setPaperdollItem(PAPERDOLL_RHAND, item);				setPaperdollItem(PAPERDOLL_LRHAND, item);<== 1292				break;			}
Inventory @ 1242:

Code: Select all

	public L2ItemInstance[] equipItemAndRecord(L2ItemInstance item)	{		Inventory.ChangeRecorder recorder = newRecorder(); 		try<== 1242		{			equipItem(item); 		}		finally		{			removePaperdollListener(recorder);		}		return recorder.getChangedItems();	}
L2PcInstance @ 2461:

Code: Select all

			else			{				sm = new SystemMessage(SystemMessageId.S1_EQUIPPED);				sm.addItemName(item);			}			sendPacket(sm); 			items = getInventory().equipItemAndRecord(item);<== 2461             // Consume mana - will start a task if required; returns if item is not a shadow item            item.decreaseMana(false);        }        sm = null;
since my knowledge about this stuff is still limited i can't really figure out how to solve it ....

any help would really be appreciated.

-wasabi2k-
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Deadlock Problems

Post by _DS_ »

You have other deadlock detector reports ?
Actually it is possible to remove synchronized from updateDatabase(), it will not hurt much (imho). But this is surely an attempt to cheat while enchanting.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
wasabi2k
Posts: 110
Joined: Sun Oct 08, 2006 4:22 pm

Re: Deadlock Problems

Post by wasabi2k »

_DS_ wrote:You have other deadlock detector reports ?
nope, the error is always the same.
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Deadlock Problems

Post by _DS_ »

Inventory@965 and Inventory@153 lines ? Second stack.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
wasabi2k
Posts: 110
Joined: Sun Oct 08, 2006 4:22 pm

Re: Deadlock Problems

Post by wasabi2k »

inventory @ 965:

Code: Select all

	public synchronized void addPaperdollListener(PaperdollListener listener)	{		if (Config.ASSERT) assert !_paperdollListeners.contains(listener);  <== 965		synchronized(_paperdollListeners)		{			_paperdollListeners.add(listener);		} 	}
inventory @ 153

Code: Select all

		ChangeRecorder(Inventory inventory)		{			_inventory = inventory;			_changed = new FastList<L2ItemInstance>();			_inventory.addPaperdollListener(this); <== 153		} 
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Deadlock Problems

Post by _DS_ »

Ok, thanks, I understand. Until now you can un-synchronize updateDatabase() until new fix will be ready.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
toastgodsupreme
Posts: 750
Joined: Sun Dec 07, 2008 7:01 pm
Location: Poland

Re: Deadlock Problems

Post by toastgodsupreme »

Got this one not too long ago as well. Definitely has something to do with enchanting like DS said.
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: Deadlock Problems

Post by DrHouse »

Again another problem happening due to 2 packets from same client running at the same time in different threads:

1) UseItem
2) RequestEnchant

I will try to continue work on this when possible...

_DS_: my unfinished multithreaded mmocore in dev-svn should completly bypass these problems without sync, I need time
Image

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

Proud of being a part of this project
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Deadlock Problems

Post by _DS_ »

Today I will try to use lock instead of function synchronization (to avoid locking entire inventory), but need time too...
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: Deadlock Problems

Post by ThePhoenixBird »

Moved to Support Forum
Post Reply