Use LibUIDropDownMenu to avoid taint
mbattersby opened this issue ยท 17 comments
The latest retail Blizzard update looks to have introduced even more new bugs with taint, UIDropDownMenu and the CompactUnitFrames (CUF). Switching to LibUIDropDownMenu removes any possibility of causing this, forever.
It's not very hard or a lot of changes, but it depends on whether you are happy to embed LibUIDropDownMenu and LibStub or not.
Describe the solution you'd like
Switch to using UIDropDownMenu. In each place a UIDropDownMenuTemplate is used:
- Remove the inherits="UIDropDownMenuTemplate" from the frame XML definition.
- At the top of the mixin lua add
local LibDD = LibStub:GetLibrary("LibUIDropDownMenu-4.0")
- As the first step of the frame's OnLoad run
LibDD:Create_UIDropDownMenu(self)
- Prefix all the
UIDropDownMenu*
calls withLibDD:
Describe alternatives you've considered
Don't do it and hope for the best.
Additional context
I'm happy to send a PR with the necessary changes, but have no way to exhaustively test them. I'm running them myself, so far with no issues.
Update: Merged in #1135
I really appreciate you taking the time to investigate this @plusmouse
After your first reply I was ready to report back that I had done some more testing in LFR and that when disabling Auctionator with no other changes the errors completely stopped. But when turning it back on again they once more started up.
I was sure it was Auctionator to blame as that's what seemed most likely.
However I followed your request and ran the taint log with Auctionator enabled once more. Below is the whole contents of the log even after multiple spam errors in chat across 10mins or more.
3/28 03:41:40.686 An action was blocked in combat because of taint from Volumizer - CompactRaidFrame1:Show()
3/28 03:41:40.686 Interface\FrameXML\CompactUnitFrame.lua:378 CompactUnitFrame_UpdateVisible()
3/28 03:41:40.686 Interface\FrameXML\CompactUnitFrame.lua:309 CompactUnitFrame_UpdateAll()
3/28 03:41:40.686 Interface\FrameXML\CompactUnitFrame.lua:48
3/28 03:51:32.927 An action was blocked in combat because of taint from Volumizer - CompactRaidFrame1:Show()
3/28 03:51:32.927 Interface\FrameXML\CompactUnitFrame.lua:378 CompactUnitFrame_UpdateVisible()
3/28 03:51:32.927 Interface\FrameXML\CompactUnitFrame.lua:309 CompactUnitFrame_UpdateAll()
3/28 03:51:32.927 Interface\FrameXML\CompactUnitFrame.lua:48
It's obvious now that "Volumizer" is in fact to blame. To confirm I disabled Volumizer with Auctionator enabled and no more errors.
I would like to ask though why the chat errors stopped when disabling Auctionator and only started again when re-enabling it making it very much look like it was at fault? Meanwhile when Volumizer was enabled no chat messages what's so ever.
I'm not sure. Looking at the Volumizer code it does use the Blizzard UI code that triggers the error.
If you use Journalator and Collectionator I did push out updates for them later on because they were using code that would likely trigger the error too, so it might be you updated them in the interim, and their initialization could have caused the error beforehand, which would explain why the error happened - they only enable when Auctionator is.
Spent a bit of time trying to replicate the issue. Couldn't, only thing that would reliably cause the issue was the old version of Auctionator. Closing this as there's nothing left to do.
plusmouse believes no issue, closing.
On the contrary. It is giving me the following error:
233x FrameXML\CompactUnitFrame.lua:1122: Attempt to access forbidden object from code tainted by an AddOn
[string "=[C]"]: in functionHide' [string "@FrameXML\CompactUnitFrame.lua"]:1122: in function
CompactUnitFrame_UpdateClassificationIndicator'
[string "@FrameXML\CompactUnitFrame.lua"]:1380: in function `CompactUnitFrame_UpdateAuras'
[string "@FrameXML\CompactUnitFrame.lua"]:96: in function <FrameXML\CompactUnitFrame.lua:45>
Locals:
(*temporary) = {
0 =
}
And spamming chat nonstop with the message: There are too many errors in your UI. As a result, your game experience may be degraded. Disable or update the failing addons if you don't want to see this message again.
Reopened since it seems other people are having an issue.
In retrospect, I think triggering the issue required the Compact Raid Frames active at some point and using the dropdown from one (e.g. setting a target marker icon). Then much later the error from the taint.
Can you try the latest alpha - it includes a fix - and let me know if it helps?
Thank you, that has resolved the error spam for me.
I've added the fix to the normal Auctionator release https://www.curseforge.com/wow/addons/auctionator/files/3718004 If this issue crops up again please comment here and I'll reopen the issue.
Can you try the latest alpha - it includes a fix - and let me know if it helps?
Thank you, that has resolved the error spam for me.
Never mind, I am still getting errors in LFR but not normal raids.
Alpha version: 9.2.5-10-g158e192
14458x FrameXML\CompactUnitFrame.lua:1122: Attempt to access forbidden object from code tainted by an AddOn
[string "=[C]"]: in function `Hide'
[string "@FrameXML\CompactUnitFrame.lua"]:1122: in function `CompactUnitFrame_UpdateClassificationIndicator'
[string "@FrameXML\CompactUnitFrame.lua"]:1380: in function `CompactUnitFrame_UpdateAuras'
[string "@FrameXML\CompactUnitFrame.lua"]:96: in function <FrameXML\CompactUnitFrame.lua:45>
Locals:
(*temporary) = <unnamed> {
0 = <userdata>
}
I suspect its another addon at this point. Can you enable just Auctionator to check?
I've verified that the fix works for #1136 (tested Auctionator before and after).
Please run /console taintLog 1
when you start playing and then upload your C:\Program Files (x86)\World of Warcraft\_retail_\Logs\taint.log
file here after you have triggered the error. That should also let us narrow down which addon is at fault.
Hi. It looks like the fix didn't entirely work. As such I've reverted it and put together a different fix. Could you verify that this fix (9.2.9) works for you?
Update: Its possible to get a CUF error with just BugSack/BugGrabber enabled:
3x FrameXML\CompactUnitFrame.lua:264: Attempt to access forbidden object from code tainted by an AddOn
[string "=[C]"]: in function `SetScript'
[string "@FrameXML\CompactUnitFrame.lua"]:264: in function `CompactUnitFrame_UnregisterEvents'
[string "@FrameXML\CompactUnitFrame.lua"]:173: in function `CompactUnitFrame_SetUnit'
[string "@Blizzard_NamePlates\Blizzard_NamePlates.lua"]:459: in function `OnRemoved'
[string "@Blizzard_NamePlates\Blizzard_NamePlates.lua"]:174: in function `OnNamePlateRemoved'
[string "@Blizzard_NamePlates\Blizzard_NamePlates.lua"]:59: in function <...eBlizzard_NamePlates\Blizzard_NamePlates.lua:47>
Instructions: