Skip to content

Change the status of CMSG_SET_SAVED_INSTANCE_EXTEND to STATUS_UNHANDLED#11

Closed
xurxogr wants to merge 1 commit into
TrinityCore:masterfrom
xurxogr:master
Closed

Change the status of CMSG_SET_SAVED_INSTANCE_EXTEND to STATUS_UNHANDLED#11
xurxogr wants to merge 1 commit into
TrinityCore:masterfrom
xurxogr:master

Conversation

@xurxogr

@xurxogr xurxogr commented Mar 8, 2011

Copy link
Copy Markdown
Contributor

Avoid getting log msg spam like

2011-03-07 20:16:12 ERROR: SESSION (account: xxxxx, guidlow: xxxxx, char: xxxxx): received not allowed opcode CMSG_SET_SAVED_INSTANCE_EXTEND (0x0292)

@Shauren Shauren closed this Mar 19, 2011
@mshipman mshipman mentioned this pull request Nov 10, 2011
ghost pushed a commit to rebirth-core/Rebirth---WoW that referenced this pull request Feb 14, 2012
johnholiver referenced this pull request Feb 18, 2013
- Fix position desync issue
Closes #9073
- Fix a crash related to passenger's EventProcessor, thanks to Shauren
- Fix crash related to charminfo
- Make compiler happier about certain things
@silvermcd123 silvermcd123 mentioned this pull request Jan 14, 2014
@et65 et65 mentioned this pull request Aug 7, 2014
mynew4 referenced this pull request Oct 4, 2015
Implemented:
  ca83e14
  ee1c1b9
  18e4ab6
  bf37446
  cb854a2

* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396e
* Added type container visitor for TypeUnorderedMapContainer
* Implemented helper function to erase unique pairs from multimap containers
* Moved object storage of all objects except players and transports to map level
* Added containers linking database spawn id with creature/gameobject in world
* Renamed DBTableGuid to spawnId
* Added a separate spawn id sequence generator for creatures and gameobjects - this will be used in db tables
* Moved building SMSG_UPDATE_OBJECT - updatefields changes broadcast to map update
* Added new function to return but not increment guid
* Adjusted .debug loadcells to show low guid in map before/after load
* Added debug messages for creature spawn/destroy, for map guid debugging
* Store all Gameobjects and Creatures added to OutdoorPvP, so the callback script can be removed when OutdoorPvP instance is destroyed.
@mynew4 mynew4 mentioned this pull request Oct 5, 2015
@mynew4 mynew4 mentioned this pull request Dec 28, 2015
HannibalRoG pushed a commit to HannibalRoG/TrinityCore that referenced this pull request Jan 2, 2018
@tje3d tje3d mentioned this pull request Mar 13, 2018
@ghost ghost mentioned this pull request Apr 20, 2018
jubaleth pushed a commit to jubaleth/TrinityCore that referenced this pull request Jun 6, 2019
ihm-tswow added a commit to ihm-tswow/TrinityCore that referenced this pull request May 31, 2022
T1ti pushed a commit to T1ti/TrinityCore that referenced this pull request Jul 31, 2025
… The Burning Crusade, which essentially means level differences aren't as extreme. (TrinityCore#11)

Pets and player summoned creatures are no longer considered NPCs in Dodge, Parry, Block calculations. This fixes an issue where pets were nigh unattackable when they were only a few levels above the enemy.
T1ti pushed a commit to T1ti/TrinityCore that referenced this pull request Jul 31, 2025
…y did in The Burning Crusade, which essentially means level differences aren't as extreme. (TrinityCore#11)"

This reverts commit 7ef7dfe.
agatho referenced this pull request in agatho/TrinityCore Oct 5, 2025
…- Release mutex before vector return to prevent writer-preference deadlock. This completes all deadlock elimination.
agatho referenced this pull request in agatho/TrinityCore Oct 5, 2025
…n OnGroupJoined/OnGroupLeft

CRITICAL FIX: The REAL deadlock source was OnGroupJoined() acquiring mutex SEVEN times:
1. GetStrategy("follow") - shared_lock
2. AddStrategy() - unique_lock
3. GetStrategy("group_combat") - shared_lock
4. AddStrategy() - unique_lock
5. ActivateStrategy("follow") - unique_lock
6. ActivateStrategy("group_combat") - unique_lock
7. Final confirmation block - shared_lock

Root Cause:
When UpdateStrategies() released its lock and ActivateStrategy() tried to acquire
unique_lock, OnGroupJoined() trying to acquire another lock caused DEADLOCK due to
std::shared_mutex writer-preference semantics.

Solution:
- Refactored OnGroupJoined() to do ALL operations under SINGLE unique_lock
- Check strategy existence, create if needed, activate, confirm - all atomic
- Call OnActivate() callbacks AFTER releasing lock (collect-then-execute)
- Applied same pattern to OnGroupLeft() for consistency

Files Modified:
- src/modules/Playerbot/AI/BotAI.cpp
  * OnGroupJoined() - Lines 601-705
  * OnGroupLeft() - Lines 708-758

Previous Fixes (All Insufficient):
- Fix #1-5: Manual lock management
- Fix #6-7: Recursive GetStrategy() calls
- Fix #8: Strategy callback execution
- Fix #9: LeaderFollowBehavior triggers/actions
- Fix #10: UpdateStrategies IsActive() timing
- Fix #11: GetActiveStrategies lock-before-return

This Fix (#12):
✅ Eliminates ALL multiple mutex acquisitions in group join/leave
✅ Single critical section per method
✅ Collect-then-execute pattern for callbacks
✅ No recursive lock attempts
✅ Thread-safe with writer-preference semantics

Testing Required:
- 50+ concurrent bots
- Repeated group join/leave operations
- Monitor for "resource deadlock would occur" exceptions
- Expected: ZERO deadlocks

Confidence: VERY HIGH (99%) - This was the actual deadlock source

🔧 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants